tbx  0.7.6
Public Types | Public Member Functions | List of all members
tbx::Iconbar Class Reference

Class to represent toolbox iconbar icon. More...

#include <iconbar.h>

Inheritance diagram for tbx::Iconbar:
tbx::Object

Public Types

enum  { TOOLBOX_CLASS = 0x82900 }
 

Public Member Functions

 Iconbar ()
 Construct an uninitiased Iconbar. More...
 
 Iconbar (const Iconbar &other)
 Construct a Iconbar from another Iconbar. More...
 
 Iconbar (const Object &other)
 Construct a Iconbar from another toolbox object. More...
 
 Iconbar (const char *template_name)
 Construct a iconbar creating a toolbox iconbar object. More...
 
 Iconbar (const res::ResIconbar &object_template)
 Construct an iconbar creating a toolbox iconbar object. More...
 
Iconbaroperator= (const Iconbar &other)
 Assign a Iconbar to an existing Iconbar. More...
 
Iconbaroperator= (const Object &other)
 Assign a Iconbar to an existing object. More...
 
bool operator== (const Object &other) const
 Checks if this Iconbar refers to the same underlying toolbox object as the given object. More...
 
bool operator!= (const Object &other) const
 Checks if this Iconbar refers to the same underlying toolbox object as the given object. More...
 
int icon_handle () const
 Return the underling WIMP icon handle of the icon bar.
 
void menu (Menu m)
 Set the menu for the icon bar. More...
 
Menu menu () const
 Get the menu from the icon bar. More...
 
void help_message (const std::string &value)
 Set the help message of the icon bar. More...
 
std::string help_message () const
 Get the current help message for the icon bar. More...
 
int help_message_length () const
 Return the length of the current help message. More...
 
void text (std::string value)
 Set the text for a text & sprite icon bar. More...
 
std::string text () const
 Get the current text of the icon bar for a text & sprite icon bar. More...
 
int text_length () const
 Get the length of the icon bar text. More...
 
void sprite (const std::string &value)
 Set the sprite to use for the icon bar. More...
 
std::string sprite () const
 Get the sprite used by the icon bar. More...
 
int sprite_length () const
 Get sprite name length.
 
void select_show (Object show_object)
 Set object to show when the icon bar is clicked with select. More...
 
Object select_show ()
 Get object shown when the icon bar is clicked with select. More...
 
void adjust_show (Object show_object)
 Set the object to show when the icon bar is clicked with adjust. More...
 
Object adjust_show ()
 Get object shown when the icon bar is clicked with adjust. More...
 
void add_click_listener (IconbarClickListener *listener)
 Add listener for button click with the select or adjust mouse buttons. More...
 
void remove_click_listener (IconbarClickListener *listener)
 Remove listener for button click with the select or adjust mouse buttons. More...
 
void add_click_command (Command *command)
 Add command to be run if the iconbar is clicked with the select or adjust mouse buttons. More...
 
void remove_click_command (Command *command)
 Remove command to be run if the iconbar is clicked with the select or adjust mouse buttons. More...
 
void add_select_command (Command *command)
 Add command to be run if the button is selected with the select mouse button. More...
 
void remove_select_command (Command *command)
 Remove command to be run if the button is selected with the select mouse button. More...
 
void add_adjust_command (Command *command)
 Add command to be run if the button is selected with the adjust mouse button only. More...
 
void remove_adjust_command (Command *command)
 Remove command to be run if the button is selected with the adjust mouse button only. More...
 
void add_loader (Loader *loader, int file_type=-2)
 Add a file loader. More...
 
void remove_loader (Loader *loader, int file_type=-2)
 Remove a file loader. More...
 
- Public Member Functions inherited from tbx::Object
 Object ()
 Constructs an object unattached to a toolbox object. More...
 
 Object (ObjectId handle)
 Construct an object referencing the given toolbox object. More...
 
 Object (const Object &other)
 Construct an object referencing the same toolbox object as another.
 
 Object (const std::string &template_name)
 Create a toolbox object with the given name in the application resources and assign a reference to it in this object. More...
 
void delete_object ()
 Delete the underlying toolbox object. More...
 
bool null () const
 Check if object has been initialised. More...
 
ObjectId handle () const
 Return the underlying toolbox object id this object references. More...
 
Objectoperator= (const Object &other)
 Assign this object to reference the same toolbox object as another. More...
 
bool operator== (const Object &other) const
 Check if this object references the same toolbox object as another. More...
 
bool operator!= (const Object &other) const
 Check if this object does not reference the same toolbox object as another. More...
 
 operator bool () const
 Operator to check if an object has been initialised. More...
 
int toolbox_class () const
 Get the toolbox class of this object. More...
 
void check_toolbox_class (int class_id) const
 Check if this objects toolbox class is as specified. More...
 
void * client_handle () const
 Return user defined handle stored against this object. More...
 
void client_handle (void *client_handle)
 Set a user defined handle for this object. More...
 
Object parent_object () const
 Get parent object. More...
 
Component parent_component () const
 Get parent component. More...
 
Object ancestor_object () const
 Get ancestor object. More...
 
Component ancestor_component () const
 Get ancestor component. More...
 
void show ()
 Show the object at the default place. More...
 
void show_centred ()
 Show the object in the centre of the screen. More...
 
void show_at_pointer ()
 Show the object at the current mouse position. More...
 
void hide ()
 Hide the object. More...
 
bool showing () const
 Check if an object is currently showing.
 
void add_command (int command_id, Command *command)
 Add a command to this Object. More...
 
void remove_command (int command_id, Command *command)
 Remove a command from this object. More...
 
void add_user_event_listener (int event_id, UserEventListener *listener)
 Add a user event listener. More...
 
void remove_user_event_listener (int event_id, UserEventListener *listener)
 Remove a user event listener from this object. More...
 
void add_object_deleted_listener (ObjectDeletedListener *listener)
 Add listener for when the toolbox object referenced by this object has been deleted. More...
 
void remove_object_deleted_listener (ObjectDeletedListener *listener)
 Remove listener for when the toolbox object referenced by this object has been deleted. More...
 
void remove_all_listeners ()
 Remove all listeners and commands from this object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from tbx::Object
 Object (const res::ResObject &object_template)
 Protected constructor to create an object.
 
void add_listener (int action, Listener *listener, RawToolboxEventHandler handler)
 Add a listener for the given toolbox event. More...
 
void remove_listener (int action, Listener *listener)
 Remove listener for toolbox event. More...
 
void set_handler (int action, Listener *listener, RawToolboxEventHandler handler)
 Set handler for an event that should not have more than one listener. More...
 
int int_property (int property_id) const
 Return the value of a property that returns an integer. More...
 
void int_property (int property_id, int value)
 Set the value of a property that requires an integer. More...
 
std::string string_property (int property_id) const
 Return the value of a property that returns text. More...
 
void string_property (int property_id, const std::string &value)
 Set the value of a property that requires a string. More...
 
int string_property_length (int property_id) const
 Gets the size of a string properties buffer. More...
 
bool bool_property (int property_id) const
 Get a boolean property from the toolbox Cobject. More...
 
void bool_property (int property_id, bool value)
 Set a boolean property from the toolbox object. More...
 
- Protected Attributes inherited from tbx::Object
ObjectId _handle
 Handle for toolbox object.
 

Detailed Description

Class to represent toolbox iconbar icon.

Constructor & Destructor Documentation

◆ Iconbar() [1/5]

tbx::Iconbar::Iconbar ( )
inline

Construct an uninitiased Iconbar.

The Iconbar should not be used until it has been initialised by assigning it to another initialised Iconbar.

◆ Iconbar() [2/5]

tbx::Iconbar::Iconbar ( const Iconbar other)
inline

Construct a Iconbar from another Iconbar.

Both Iconbars will refer to the same underlying toolbox Iconbar

◆ Iconbar() [3/5]

tbx::Iconbar::Iconbar ( const Object other)
inline

Construct a Iconbar from another toolbox object.

The Iconbar and the object will refer to the same underlying toolbox Iconbar

Exceptions
ObjectClassErrorThe object assigned to does not refer to a toolbox Iconbar

◆ Iconbar() [4/5]

tbx::Iconbar::Iconbar ( const char *  template_name)
inline

Construct a iconbar creating a toolbox iconbar object.

Parameters
template_namename of icon bar template to use

◆ Iconbar() [5/5]

tbx::Iconbar::Iconbar ( const res::ResIconbar object_template)

Construct an iconbar creating a toolbox iconbar object.

Parameters
object_templatein memory template used to create the toolbox iconbar

Member Function Documentation

◆ add_adjust_command()

void tbx::Iconbar::add_adjust_command ( Command command)

Add command to be run if the button is selected with the adjust mouse button only.

Parameters
commandcommand to add

◆ add_click_command()

void tbx::Iconbar::add_click_command ( Command command)

Add command to be run if the iconbar is clicked with the select or adjust mouse buttons.

Parameters
commandcommand to add

◆ add_click_listener()

void tbx::Iconbar::add_click_listener ( IconbarClickListener listener)

Add listener for button click with the select or adjust mouse buttons.

Requires the icon bar to generate the default clicked event.

Parameters
listenerlistener to add

◆ add_loader()

void tbx::Iconbar::add_loader ( Loader loader,
int  file_type = -2 
)

Add a file loader.

Parameters
loaderthe loader to add
file_typethe file type for the loader or -2 (the default) for any type.

◆ add_select_command()

void tbx::Iconbar::add_select_command ( Command command)

Add command to be run if the button is selected with the select mouse button.

Parameters
commandcommand to add

◆ adjust_show() [1/2]

Object tbx::Iconbar::adjust_show ( )

Get object shown when the icon bar is clicked with adjust.

Returns
object to show (may be null)

◆ adjust_show() [2/2]

void tbx::Iconbar::adjust_show ( Object  show_object)

Set the object to show when the icon bar is clicked with adjust.

Parameters
show_objectobject to show

◆ help_message() [1/2]

std::string tbx::Iconbar::help_message ( ) const

Get the current help message for the icon bar.

Returns
current help message

◆ help_message() [2/2]

void tbx::Iconbar::help_message ( const std::string &  value)

Set the help message of the icon bar.

Parameters
valuenew help message

◆ help_message_length()

int tbx::Iconbar::help_message_length ( ) const

Return the length of the current help message.

Returns
Number of characters for this property

◆ menu() [1/2]

Menu tbx::Iconbar::menu ( ) const

Get the menu from the icon bar.

Returns
current menu (may be a null menu if none has been assigned)

◆ menu() [2/2]

void tbx::Iconbar::menu ( Menu  m)

Set the menu for the icon bar.

Parameters
mnew menu for icon bar

◆ operator!=()

bool tbx::Iconbar::operator!= ( const Object other) const
inline

Checks if this Iconbar refers to the same underlying toolbox object as the given object.

Returns
true if the Iconbar and object do not refer to the same thing.

◆ operator=() [1/2]

Iconbar& tbx::Iconbar::operator= ( const Iconbar other)
inline

Assign a Iconbar to an existing Iconbar.

Both Iconbars will refer to the same underlying toolbox Iconbar

◆ operator=() [2/2]

Iconbar& tbx::Iconbar::operator= ( const Object other)
inline

Assign a Iconbar to an existing object.

The Iconbar and the object will refer to the same underlying toolbox Iconbar

Exceptions
ObjectClassErrorThe object assigned to does not refer to a toolbox Iconbar

◆ operator==()

bool tbx::Iconbar::operator== ( const Object other) const
inline

Checks if this Iconbar refers to the same underlying toolbox object as the given object.

Returns
true if the Iconbar and object refer to the same thing.

◆ remove_adjust_command()

void tbx::Iconbar::remove_adjust_command ( Command command)

Remove command to be run if the button is selected with the adjust mouse button only.

Parameters
commandcommand to remove

◆ remove_click_command()

void tbx::Iconbar::remove_click_command ( Command command)

Remove command to be run if the iconbar is clicked with the select or adjust mouse buttons.

Parameters
commandcommand to remove

◆ remove_click_listener()

void tbx::Iconbar::remove_click_listener ( IconbarClickListener listener)

Remove listener for button click with the select or adjust mouse buttons.

Parameters
listenerlistener to remove

◆ remove_loader()

void tbx::Iconbar::remove_loader ( Loader loader,
int  file_type = -2 
)

Remove a file loader.

Parameters
loaderthe loader to remove
file_typethe file type for the loader or -2 (the default) for any type.

◆ remove_select_command()

void tbx::Iconbar::remove_select_command ( Command command)

Remove command to be run if the button is selected with the select mouse button.

Parameters
commandcommand to remove

◆ select_show() [1/2]

Object tbx::Iconbar::select_show ( )

Get object shown when the icon bar is clicked with select.

Returns
object to show (may be null)

◆ select_show() [2/2]

void tbx::Iconbar::select_show ( Object  show_object)

Set object to show when the icon bar is clicked with select.

Parameters
show_objectobject to show

◆ sprite() [1/2]

std::string tbx::Iconbar::sprite ( ) const

Get the sprite used by the icon bar.

Returns
name of the sprite

◆ sprite() [2/2]

void tbx::Iconbar::sprite ( const std::string &  value)

Set the sprite to use for the icon bar.

Parameters
valuenew sprite name

◆ text() [1/2]

std::string tbx::Iconbar::text ( ) const

Get the current text of the icon bar for a text & sprite icon bar.

Returns
current text

◆ text() [2/2]

void tbx::Iconbar::text ( std::string  value)

Set the text for a text & sprite icon bar.

Parameters
valuenew value of text
Exceptions
OsErrorif the text is longer than the maximum size specified when the Icon bar icon was created

◆ text_length()

int tbx::Iconbar::text_length ( ) const

Get the length of the icon bar text.

Returns
icon bar text length

The documentation for this class was generated from the following files: