BitmapButtonCustomGui Class Reference

#include <customgui_bitmapbutton.h>

Inheritance diagram for BitmapButtonCustomGui:

Detailed Description

Bitmap button custom GUI (CUSTOMGUI_BITMAPBUTTON).
Here are the settings: BITMAPBUTTON_CUSTOMGUISETTINGS

Private Member Functions

 BitmapButtonCustomGui ()
 
 ~BitmapButtonCustomGui ()
 

Set Image

Bool SetImage (BaseBitmap *bmp, Bool copybmp, Bool secondstate=false)
 
Bool SetImage (const Filename &name, Bool secondstate=false)
 
Bool SetImage (IconData *bmp, Bool secondstate=false)
 
Bool SetImage (Int32 icon_id, Bool secondstate=false)
 

Miscellaneous

void SetToggleState (Bool set)
 
void SetDragArray (const AtomArray *bl)
 
void SetCallback (const BitmapButtonCallback &cb)
 
void SetCommandDragId (Int32 cmdid)
 
Int32 GetMaxWidth () const
 

Additional Inherited Members

- Public Member Functions inherited from BaseCustomGui< 1000479 >
Int32 GetWidth ()
 
Int32 GetHeight ()
 
void Redraw ()
 
Bool LayoutChanged ()
 
Bool Activate ()
 
Bool SetDefaultForResEdit ()
 
Bool SetData (const TriState< GeData > &tristate)
 
TriState< GeDataGetData ()
 
void SetLayoutMode (Int32 mode)
 
Int32 GetLayoutMode ()
 
Bool SupportLayoutSwitch ()
 
- Public Member Functions inherited from _BaseCustomGui
Int32 GetWidth (Int32 plugid)
 
Int32 GetHeight (Int32 plugid)
 
void Redraw (Int32 plugid)
 
Bool LayoutChanged (Int32 plugid)
 
Bool Activate (Int32 plugid)
 
Bool SetDefaultForResEdit (Int32 plugid)
 
Bool SetData (Int32 plugid, const TriState< GeData > &tristate)
 
TriState< GeDataGetData (Int32 plugid)
 
void SetLayoutMode (Int32 plugid, Int32 mode)
 
Int32 GetLayoutMode (Int32 plugid)
 
Bool SupportLayoutSwitch (Int32 plugid)
 

Constructor & Destructor Documentation

◆ BitmapButtonCustomGui()

BitmapButtonCustomGui ( )
private

◆ ~BitmapButtonCustomGui()

~BitmapButtonCustomGui ( )
private

Member Function Documentation

◆ SetImage() [1/4]

Bool SetImage ( BaseBitmap bmp,
Bool  copybmp,
Bool  secondstate = false 
)

Sets the image from a BaseBitmap.

Parameters
[in]bmpThe bitmap image.
[in]copybmpIf true the bitmap is copied. If false, the bitmap pointer is only assigned but caller is still the ownership of it, so it must make sure the bitmap is available during all the BitmapButtonCustomGui life.
[in]secondstateIf true a second state for toggle and clickable buttons is stored.
Returns
true if successful, otherwise false.

◆ SetImage() [2/4]

Bool SetImage ( const Filename name,
Bool  secondstate = false 
)

Sets the image from a Filename.

Parameters
[in]nameThe filename for the image to load.
[in]secondstateIf true a second state for toggle and clickable buttons is stored.
Returns
true if successful, otherwise false.

◆ SetImage() [3/4]

Bool SetImage ( IconData bmp,
Bool  secondstate = false 
)

Sets the image from an IconData.

Warning
The icon bitmap is copied.
Parameters
[in]bmpThe icon data. The caller owns the pointed icon data.
[in]secondstateIf true a second state for toggle and clickable buttons is stored.
Returns
true if successful, otherwise false.

◆ SetImage() [4/4]

Bool SetImage ( Int32  icon_id,
Bool  secondstate = false 
)

Sets the image from an icon ID.

Warning
The icon bitmap is copied.
Parameters
[in]icon_idThe icon ID.
[in]secondstateIf true a second state for toggle and clickable buttons is stored.
Returns
true if successful, otherwise false.

◆ SetToggleState()

void SetToggleState ( Bool  set)

Sets the toggle state of the button.

Parameters
[in]setThe new toggle state.

◆ SetDragArray()

void SetDragArray ( const AtomArray bl)

Stores an atom array that can be dragged from the button by the user. This is only possible for non-button mode (BITMAPBUTTON_BUTTON is false).

Parameters
[in]blThe atom array to store. The array is not copied. The caller owns the pointed array.

◆ SetCallback()

void SetCallback ( const BitmapButtonCallback cb)

Registers a callback with the bitmap button. Called when the button is pressed.

Parameters
[in]cbThe callback to register.

◆ SetCommandDragId()

void SetCommandDragId ( Int32  cmdid)

Sets the command ID for the bitmap button.

Note
Enables drag and drop of the command into tool bars and menu managers. Used e.g. in the Script Manager.
Parameters
[in]cmdidThe command ID.

◆ GetMaxWidth()

Int32 GetMaxWidth ( ) const

Gets the maximum width of the user area that the Bitmap is being drawn into, allowing you to size the bitmap prior to setting.

Returns
The maximum width.