tbx  0.7.5
Public Types | Public Member Functions | List of all members
tbx::res::ResToolAction Class Reference

Class for ToolAction gadget template. More...

#include <restoolaction.h>

Inheritance diagram for tbx::res::ResToolAction:
tbx::res::ResGadget tbx::res::ResBase

Public Types

enum  { TYPE_ID = 0x4014 }
 

Public Member Functions

 ResToolAction (const ResGadget &other)
 Construct an tool action gadget resource. More...
 
 ResToolAction (const ResToolAction &other)
 Construct an tool action gadget resource. More...
 
ResToolActionoperator= (const ResGadget &other)
 Assign from a ResGadget. More...
 
ResToolActionoperator= (const ResToolAction &other)
 Assign from another tool action gadget resource. More...
 
 ResToolAction ()
 Construct a tool action gadget resource. More...
 
bool generate_select () const
 Check if the select event will be generated. More...
 
void generate_select (bool value)
 Set if the select event will be generated. More...
 
bool has_text () const
 Check if tool action shows text. More...
 
void has_text (bool value)
 Set if tool action shows text. More...
 
bool on () const
 Check if the tool action starts off in the on state. More...
 
void on (bool value)
 Set if the tool action starts off in the on state. More...
 
bool auto_toggle () const
 Check if the tool action should automatically toggle between states. More...
 
void auto_toggle (bool value)
 Set if the tool action should automatically toggle between states. More...
 
bool no_pressed_sprite () const
 Check if there is no sprite for the pressed state. More...
 
void no_pressed_sprite (bool value)
 Set if there is no sprite for the pressed state. More...
 
bool auto_repeat () const
 Check if button presses auto repeat. More...
 
void auto_repeat (bool value)
 Set if button presses auto repeat. More...
 
bool show_transient () const
 Check if the select show object will be shown transiently. More...
 
void show_transient (bool value)
 Set if the select show object will be shown transiently. More...
 
bool show_as_pop_up () const
 Check if the select show object will be shown as a pop up. More...
 
void show_as_pop_up (bool value)
 Set if the select show object will be shown pop up. More...
 
bool has_fade_sprite () const
 Check if the tool action has a faded sprite provided. More...
 
void has_fade_sprite (bool value)
 Set if the tool action has a faded sprite provided. More...
 
const char * off_ident () const
 Get the text or sprite name shown when the tool action is off. More...
 
void off_ident (const char *value, int max_length=-1)
 Set the text or sprite name shown when the tool action is off. More...
 
void off_ident (const std::string &value, int max_length=-1)
 Set the text or sprite name shown when the tool action is off. More...
 
int max_off_ident () const
 Get the maximum length of the off identifier.
 
const char * on_ident () const
 Get the text or sprite name shown when the tool action is on. More...
 
void on_ident (const char *value, int max_length=-1)
 Set the text or sprite name shown when the tool action is on. More...
 
void on_ident (const std::string &value, int max_length=-1)
 Set the text or sprite name shown when the tool action is on. More...
 
int max_on_ident () const
 Get the maximum length of the on identifier.
 
int click_event () const
 Get the event that will generated when the tool action is clicked. More...
 
void click_event (int value)
 Set the event that will generated when the tool action is clicked. More...
 
const char * select_show () const
 Get the name of the object shown when select is clicked. More...
 
void select_show (const char *value)
 Set the name of the object shown when select is clicked. More...
 
void select_show (const std::string &value)
 Set the name of the object shown when select is clicked. More...
 
int adjust_event () const
 Get the event that will generated when the tool action is clicked with adjust. More...
 
void adjust_event (int value)
 Set the event that will generated when the tool action is clicked with adjust. More...
 
const char * adjust_show () const
 Get the name of the object shown when adjust is clicked. More...
 
void adjust_show (const char *value)
 Set the name of the object shown when adjust is clicked. More...
 
void adjust_show (const std::string &value)
 Set the name of the object shown when adjust is clicked. More...
 
const char * fade_ident () const
 Get the text or sprite name for the faded tool action. More...
 
void fade_ident (const char *value, int max_length=-1)
 Set the text or sprite name shown when the tool action is faded. More...
 
void fade_ident (const std::string &value, int max_length=-1)
 Set the text or sprite name shown when the tool action is faded. More...
 
int max_fade () const
 Get the maximum length of the faded identifier.
 
- Public Member Functions inherited from tbx::res::ResGadget
 ResGadget (const ResGadget &other)
 Construct a resource gadget as a copy of another. More...
 
ResGadgetoperator= (const ResGadget &other)
 Assign a resource gadget as a copy of another. More...
 
 ResGadget (int type, int size)
 Construct an empty gadget of the given type and size. More...
 
void check_type (int type) const
 Check if this gadgets type is as specified. More...
 
unsigned int flags () const
 Get all flags as a word raw access. More...
 
void flags (unsigned int value)
 Set all flags as a word. More...
 
bool back () const
 Check if gadget is at the back (created first) More...
 
void back (bool value)
 Set if gadget should be at the back. More...
 
bool faded () const
 Check if the gadget is faded. More...
 
void faded (bool value)
 Set if the gadget is faded. More...
 
unsigned short type () const
 Get the gadget type. More...
 
unsigned short stored_size () const
 Get the size stored in template. More...
 
int size () const
 Size of gadget (including header). More...
 
int xmin () const
 Get the minimum x coordinate of the gadget's bounding box. More...
 
void xmin (int x)
 Set the minimum x coordinate of the gadget's bounding box. More...
 
int ymin () const
 Get the minimum y coordinate of the gadget's bounding box. More...
 
void ymin (int y)
 Set the minimum y coordinate of the gadget's bounding box. More...
 
int xmax () const
 Get the maximum x coordinate of the gadget's bounding box. More...
 
void xmax (int x)
 Set the maximum x coordinate of the gadget's bounding box. More...
 
int ymax () const
 Get the maximum y coordinate of the gadget's bounding box. More...
 
void ymax (int y)
 Set the maximum y coordinate of the gadget's bounding box. More...
 
ComponentId component_id () const
 Get the Component ID. More...
 
void component_id (ComponentId value)
 Set the Component ID. More...
 
const char * help_message () const
 Get the help message for the gadget. More...
 
void help_message (const char *msg, int max_length=-1)
 Set the help message for the gadget. More...
 
void help_message (const std::string &msg, int max_length=-1)
 Set the help message for the gadget. More...
 
int max_help () const
 Max size of message.
 
- Public Member Functions inherited from tbx::res::ResBase
 ResBase (const ResBase &other)
 Copy constructor. More...
 
virtual ~ResBase ()
 Destructor.
 
ResBaseoperator= (const ResBase &other)
 Assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tbx::res::ResGadget
static int gadget_size (unsigned int type_and_size)
 Get gadget size given its type and size value. More...
 
- Protected Member Functions inherited from tbx::res::ResGadget
void make_writeable ()
 Make item writeable.
 
- Protected Member Functions inherited from tbx::res::ResBase
 ResBase (ResImpl *impl)
 Create from internal resource implementation. More...
 
const char * string (int offset) const
 Return a string at the given offset. More...
 
void string (int offset, const char *value)
 Set a string at the given offset. More...
 
void string (int offset, std::string value)
 Set a string at the given offset. More...
 
void string_with_length (int offset, const char *value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
void string_with_length (int offset, const std::string &value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
const char * message (int offset) const
 Get the message string at the given offset. More...
 
void message (int offset, const char *value)
 Set a message at the given offset. More...
 
void message (int offset, std::string value)
 Set a message at the given offset. More...
 
void message_with_length (int offset, const char *value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
void message_with_length (int offset, const std::string &value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
int int_value (int offset) const
 Get an integer value. More...
 
void int_value (int offset, int value)
 Set a number at the specified offset. More...
 
unsigned int uint_value (int offset) const
 Get an unsigned integer value. More...
 
void uint_value (int offset, unsigned int value)
 Set an unsigned number at the specified offset. More...
 
unsigned char byte_value (int offset) const
 Get a byte value. More...
 
void byte_value (int offset, unsigned char value)
 Set an unsigned byte (8 bit value) at the specified offset. More...
 
unsigned short ushort_value (int offset) const
 Get a unsigned short value. More...
 
void ushort_value (int offset, unsigned short value)
 Set an unsigned short (16 bit value) at the specified offset. More...
 
bool flag (int offset, int mask) const
 Check if any of the bits in a mask are set. More...
 
void flag (int offset, int mask, bool on)
 Set/clear the bits in mask. More...
 
int flag_value (int offset, int mask) const
 Get the bits for the given mask. More...
 
void flag_value (int offset, int mask, int value)
 Set bits in given mask clearing others. More...
 
void init_string (int offset, const char *value)
 Initialise a string in a constructor helper. More...
 
void init_message (int offset, const char *value)
 Initialise a message in a constructor helper. More...
 
void init_sprite_area_ref (int offset)
 Initialise a sprite area reference. More...
 
void init_object_ref (int offset)
 Initialise an object reference. More...
 
- Protected Attributes inherited from tbx::res::ResBase
ResImpl * _impl
 Internal Resource implementation.
 

Detailed Description

Class for ToolAction gadget template.

Constructor & Destructor Documentation

◆ ResToolAction() [1/3]

tbx::res::ResToolAction::ResToolAction ( const ResGadget other)
inline

Construct an tool action gadget resource.

Parameters
otherResGadget to copy resource from
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an tool action

◆ ResToolAction() [2/3]

tbx::res::ResToolAction::ResToolAction ( const ResToolAction other)
inline

Construct an tool action gadget resource.

Parameters
othertool action to copy resource from

◆ ResToolAction() [3/3]

tbx::res::ResToolAction::ResToolAction ( )
inline

Construct a tool action gadget resource.

All options are false, events unset and messages are null.

Member Function Documentation

◆ adjust_event() [1/2]

int tbx::res::ResToolAction::adjust_event ( ) const
inline

Get the event that will generated when the tool action is clicked with adjust.

Returns
event ID of event generated or 0 for the default

◆ adjust_event() [2/2]

void tbx::res::ResToolAction::adjust_event ( int  value)
inline

Set the event that will generated when the tool action is clicked with adjust.

Parameters
valueevent ID of event generated or 0 for the default

◆ adjust_show() [1/3]

const char* tbx::res::ResToolAction::adjust_show ( ) const
inline

Get the name of the object shown when adjust is clicked.

Returns
pointer to zero terminate object name or 0 if none

◆ adjust_show() [2/3]

void tbx::res::ResToolAction::adjust_show ( const char *  value)
inline

Set the name of the object shown when adjust is clicked.

Parameters
valuepointer to zero terminate object name or 0 if none

◆ adjust_show() [3/3]

void tbx::res::ResToolAction::adjust_show ( const std::string &  value)
inline

Set the name of the object shown when adjust is clicked.

Parameters
valueobject name

◆ auto_repeat() [1/2]

bool tbx::res::ResToolAction::auto_repeat ( ) const
inline

Check if button presses auto repeat.

Returns
true if button presses auto repeat

◆ auto_repeat() [2/2]

void tbx::res::ResToolAction::auto_repeat ( bool  value)
inline

Set if button presses auto repeat.

Parameters
valueset to true to make button presses auto repeat

◆ auto_toggle() [1/2]

bool tbx::res::ResToolAction::auto_toggle ( ) const
inline

Check if the tool action should automatically toggle between states.

Returns
true if auto toggle is on

◆ auto_toggle() [2/2]

void tbx::res::ResToolAction::auto_toggle ( bool  value)
inline

Set if the tool action should automatically toggle between states.

Parameters
valueset to true to turn auto toggle on

◆ click_event() [1/2]

int tbx::res::ResToolAction::click_event ( ) const
inline

Get the event that will generated when the tool action is clicked.

Returns
event ID of event generated or 0 for the default

◆ click_event() [2/2]

void tbx::res::ResToolAction::click_event ( int  value)
inline

Set the event that will generated when the tool action is clicked.

Parameters
valueevent ID of event generated or 0 for the default

◆ fade_ident() [1/3]

const char* tbx::res::ResToolAction::fade_ident ( ) const
inline

Get the text or sprite name for the faded tool action.

The has_text() method determines if this refers to text or a sprite

Returns
pointer to zero terminated text/sprite name or 0 if none

◆ fade_ident() [2/3]

void tbx::res::ResToolAction::fade_ident ( const char *  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is faded.

The has_text() method determines if this refers to text or a sprite

Parameters
valuepointer to zero terminated text/sprite name or 0 if none
max_lengthThe maximum length the faded text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ fade_ident() [3/3]

void tbx::res::ResToolAction::fade_ident ( const std::string &  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is faded.

The has_text() method determines if this refers to text or a sprite

Parameters
valuetext/sprite name
max_lengthThe maximum length the faded text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ generate_select() [1/2]

bool tbx::res::ResToolAction::generate_select ( ) const
inline

Check if the select event will be generated.

Returns
true if the select event will be generated

◆ generate_select() [2/2]

void tbx::res::ResToolAction::generate_select ( bool  value)
inline

Set if the select event will be generated.

Parameters
valueset to true if the select event will be generated

◆ has_fade_sprite() [1/2]

bool tbx::res::ResToolAction::has_fade_sprite ( ) const
inline

Check if the tool action has a faded sprite provided.

Returns
true if a faded sprite is provided

◆ has_fade_sprite() [2/2]

void tbx::res::ResToolAction::has_fade_sprite ( bool  value)
inline

Set if the tool action has a faded sprite provided.

Parameters
valueset to true if a faded sprite is provided

◆ has_text() [1/2]

bool tbx::res::ResToolAction::has_text ( ) const
inline

Check if tool action shows text.

Returns
true if the tool action shows text

◆ has_text() [2/2]

void tbx::res::ResToolAction::has_text ( bool  value)
inline

Set if tool action shows text.

Parameters
valueset to true if the tool action shows text

◆ no_pressed_sprite() [1/2]

bool tbx::res::ResToolAction::no_pressed_sprite ( ) const
inline

Check if there is no sprite for the pressed state.

Returns
true if there is no pressed sprite

◆ no_pressed_sprite() [2/2]

void tbx::res::ResToolAction::no_pressed_sprite ( bool  value)
inline

Set if there is no sprite for the pressed state.

Parameters
valueset to true if there is no pressed sprite

◆ off_ident() [1/3]

const char* tbx::res::ResToolAction::off_ident ( ) const
inline

Get the text or sprite name shown when the tool action is off.

The has_text() method determines if this refers to text or a sprite

Returns
pointer to zero terminated text/sprite name or 0 if none

◆ off_ident() [2/3]

void tbx::res::ResToolAction::off_ident ( const char *  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is off.

The has_text() method determines if this refers to text or a sprite

Parameters
valuepointer to zero terminated text/sprite name or 0 if none
max_lengthThe maximum length the off text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ off_ident() [3/3]

void tbx::res::ResToolAction::off_ident ( const std::string &  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is off.

The has_text() method determines if this refers to text or a sprite

Parameters
valuetext/sprite name
max_lengthThe maximum length the off text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ on() [1/2]

bool tbx::res::ResToolAction::on ( ) const
inline

Check if the tool action starts off in the on state.

Returns
true if the tool action is on

◆ on() [2/2]

void tbx::res::ResToolAction::on ( bool  value)
inline

Set if the tool action starts off in the on state.

Parameters
valueset to true to set the tool action on

◆ on_ident() [1/3]

const char* tbx::res::ResToolAction::on_ident ( ) const
inline

Get the text or sprite name shown when the tool action is on.

The has_text() method determines if this refers to text or a sprite

Returns
pointer to zero terminated text/sprite name or 0 if none

◆ on_ident() [2/3]

void tbx::res::ResToolAction::on_ident ( const char *  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is on.

The has_text() method determines if this refers to text or a sprite

Parameters
valuepointer to zero terminated text/sprite name or 0 if none
max_lengthThe maximum length the on text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ on_ident() [3/3]

void tbx::res::ResToolAction::on_ident ( const std::string &  value,
int  max_length = -1 
)
inline

Set the text or sprite name shown when the tool action is on.

The has_text() method determines if this refers to text or a sprite

Parameters
valuetext/sprite name
max_lengthThe maximum length the on text will be changed to when the tool action is shown or -1 (the default) for the length of value.

◆ operator=() [1/2]

ResToolAction& tbx::res::ResToolAction::operator= ( const ResGadget other)
inline

Assign from a ResGadget.

Parameters
otherResGadget to copy
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an tool action

◆ operator=() [2/2]

ResToolAction& tbx::res::ResToolAction::operator= ( const ResToolAction other)
inline

Assign from another tool action gadget resource.

Parameters
othertool action gadget resource to copy

◆ select_show() [1/3]

const char* tbx::res::ResToolAction::select_show ( ) const
inline

Get the name of the object shown when select is clicked.

Returns
pointer to zero terminate object name or 0 if none

◆ select_show() [2/3]

void tbx::res::ResToolAction::select_show ( const char *  value)
inline

Set the name of the object shown when select is clicked.

Parameters
valuepointer to zero terminate object name or 0 if none

◆ select_show() [3/3]

void tbx::res::ResToolAction::select_show ( const std::string &  value)
inline

Set the name of the object shown when select is clicked.

Parameters
valueobject name

◆ show_as_pop_up() [1/2]

bool tbx::res::ResToolAction::show_as_pop_up ( ) const
inline

Check if the select show object will be shown as a pop up.

Returns
true if the select show object will be shown as a pop up

◆ show_as_pop_up() [2/2]

void tbx::res::ResToolAction::show_as_pop_up ( bool  value)
inline

Set if the select show object will be shown pop up.

Parameters
valueset to true if the select show object should be shown pop up

◆ show_transient() [1/2]

bool tbx::res::ResToolAction::show_transient ( ) const
inline

Check if the select show object will be shown transiently.

Returns
true if the select show object will be shown transiently

◆ show_transient() [2/2]

void tbx::res::ResToolAction::show_transient ( bool  value)
inline

Set if the select show object will be shown transiently.

Parameters
valueset to true if the select show object should be shown transiently

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