Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Class abgui.ImageButton

is abgui.Image is abguibase.Widget
A button showing an image and calling its listeners when clicked.

Constructor

function init(pathOrIcon=null, align=HCENTER|VCENTER)
Overridesabgui.Image.init()
Initialize a new image button.
Parameters:
pathOrIcon – either a path to an icon file, or an icon loaded via graph.icon. null if the icon cannot be set yet.
align – the horizontal and vertical alignment flags.

Fields

clickedBg The background for the clicked state.
listeners The listeners
normalBg The background for the normal state.

Functions

addListener(l) Add a listener.
doClick() Perform a button click, i.e. notify the listeners.
draw() Draw the button.
focusable() An ImageButton is focusable.
handled(event) Handle keystrokes and clicking via the pointer.
removeListener(l) Remove a listener.
function focusable()
Overridesabguibase.Widget.focusable()
An ImageButton is focusable.
Returns:true
function addListener(l)
Add a listener. This must be a function reference or an instance function reference, taking the argument (this).
Parameters:
l – the listener to add.
function removeListener(l)
Remove a listener.
Parameters:
l – the listener to remove.
function doClick()
Perform a button click, i.e. notify the listeners.
function draw()
Overridesabgui.Image.draw()
Draw the button.
function handled(event)
Overridesabguibase.Widget.handled()
Handle keystrokes and clicking via the pointer.
Parameters:
event – the event.
Returns:true if the event was handled.
mShell Home  > Documentation  > mdoc