tbx
0.7.6
|
#include <resmenu.h>
Public Member Functions | |
ResMenuItem (const ResMenuItem &other) | |
Create a ResMenuItem as a copy of another. More... | |
ResMenuItem & | operator= (const ResMenuItem &other) |
Assign this menu item to be equal to another. More... | |
ResMenuItem () | |
Construct a ResMenuItem with flags unset, item text "" and show objects and help message null. | |
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 | ticked () const |
Check if the item is ticked. More... | |
void | ticked (bool t) |
Set if the item is ticked. More... | |
bool | dotted_line () const |
Check if this entry is followed by a dotted line. More... | |
void | dotted_line (bool value) |
Set if this entry is followed by a dotted line. More... | |
bool | faded () const |
Check if entry is faded. More... | |
void | faded (bool value) |
Set if entry is faded. More... | |
bool | sprite () const |
Check if this entry shows a sprite. More... | |
bool | has_submenu () const |
Check if this entry has a sub menu. More... | |
void | has_submenu (bool value) |
Set if this entry has a sub menu. More... | |
bool | generate_submenu_event () const |
Check if the sub menu event will be generated. More... | |
void | generate_submenu_event (bool value) |
Set if the sub menu event will be generated. More... | |
bool | show_transient () const |
Check if shown object will be shown transiently. More... | |
void | show_transient (bool value) |
Set if shown object will be shown transiently. More... | |
ComponentId | component_id () const |
Get component ID of menu item. | |
void | component_id (ComponentId id) |
Set component ID. More... | |
const char * | text () const |
Get text or sprite name for entry. More... | |
void | text (const char *value, int max_length=-1) |
Set text or sprite name for entry. More... | |
void | text (const std::string &value, int max_length=-1) |
Set text or sprite name for entry. More... | |
int | max_text () const |
Maximum space for text or sprite name. | |
const char * | click_show () const |
Get the name of the object to show on click. More... | |
void | click_show (const char *show_name) |
Set the name of the object to show on click. More... | |
void | click_show (const std::string &show_name) |
Set the name of the object to show on click. More... | |
const char * | submenu_show () const |
Get the name of the sub menu to show for this menu item. More... | |
void | submenu_show (char *show_name) |
Set the name of the sub menu to show for this menu item. More... | |
void | submenu_show (const std::string &show_name) |
Set the name of the sub menu to show for this menu item. More... | |
int | submenu_event () const |
Get the event ID generated when sub menu is shown. More... | |
void | submenu_event (int event_id) |
Set the event ID generated when sub menu is shown. More... | |
int | click_event () const |
Get the event ID generated when the item is clicked. More... | |
void | click_event (int event_id) |
Set the event ID generated when the item is clicked. More... | |
const char * | help_message () const |
Get the menu item help message. More... | |
void | help_message (const char *value, int max_length=-1) |
Set the item help message. More... | |
void | help_message (const std::string &value, int max_length=-1) |
Set the item help message. More... | |
int | max_help_message () const |
Get the maximum help message length. | |
![]() | |
ResBase (const ResBase &other) | |
Copy constructor. More... | |
virtual | ~ResBase () |
Destructor. | |
ResBase & | operator= (const ResBase &other) |
Assignment. More... | |
Protected Member Functions | |
void | make_writeable () |
Make item writeable. | |
![]() | |
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... | |
Friends | |
class | ResMenu |
class | tbx::Menu |
Additional Inherited Members | |
![]() | |
ResImpl * | _impl |
Internal Resource implementation. | |
Menu item object.
|
inline |
Create a ResMenuItem as a copy of another.
other | ResMenuItem to copy |
|
inline |
Get the event ID generated when the item is clicked.
|
inline |
Set the event ID generated when the item is clicked.
event_id | event ID or 0 for the default |
|
inline |
Get the name of the object to show on click.
|
inline |
Set the name of the object to show on click.
show_name | pointer to zero terminated object name or 0 if none |
|
inline |
Set the name of the object to show on click.
show_name | object name |
|
inline |
Set component ID.
id | component ID of menu item |
|
inline |
Check if this entry is followed by a dotted line.
|
inline |
Set if this entry is followed by a dotted line.
value | set to true if the entry is followed by a dotted line |
|
inline |
Check if entry is faded.
|
inline |
Set if entry is faded.
value | set to true if the entry should be faded |
|
inline |
Get all flags as a word raw access.
Not normally used as there are named methods that allow access to the individual items in the flags
|
inline |
Set all flags as a word.
Not normally used as there are named methods that allow access to the individual items in the flags
|
inline |
Check if the sub menu event will be generated.
The sub menu event occurs when the user traverses this entry's sub menu arrow with the mouse pointer (if has_submenu() == true).
|
inline |
Set if the sub menu event will be generated.
The sub menu event occurs when the user traverses this entry's sub menu arrow with the mouse pointer (if has_submenu() == true).
value | set to true if the sub menu event should be generated |
|
inline |
Check if this entry has a sub menu.
ie a sub menu arrow appears next to the entry
|
inline |
Set if this entry has a sub menu.
ie a sub menu arrow appears next to the entry
value | set to true if this menu has a sub menu |
|
inline |
Get the menu item help message.
|
inline |
Set the item help message.
@param value pointer to zero terminated menu help message or 0 for none. @param max_length maximum length for help message or -1 to use current value. This is alway adjusted to allow for the full length of the help message.
|
inline |
Set the item help message.
@param value menu help message. @param max_length maximum length for help message or -1 to use current value. This is alway adjusted to allow for the full length of the help message.
|
inline |
Assign this menu item to be equal to another.
other | ResMenuItem to copy |
|
inline |
Check if shown object will be shown transiently.
|
inline |
Set if shown object will be shown transiently.
value | set to true if object will be shown transiently |
|
inline |
Check if this entry shows a sprite.
When not set this entry shows text
|
inline |
Get the event ID generated when sub menu is shown.
|
inline |
Set the event ID generated when sub menu is shown.
event_id | event ID or 0 for the default |
|
inline |
Get the name of the sub menu to show for this menu item.
|
inline |
Set the name of the sub menu to show for this menu item.
show_name | pointer to zero terminated sub menu object name or 0 for none. |
|
inline |
Set the name of the sub menu to show for this menu item.
show_name | sub menu object name |
|
inline |
Get text or sprite name for entry.
The sprite() flag determines if this is a sprite or text entry
|
inline |
Set text or sprite name for entry.
The sprite() flag determines if this is a sprite or text entry
value | pointer to zero terminated text or sprite name |
max_length | maximum length of the text or sprite name that will be used with this menu item or -1 (the default) for the length of value |
|
inline |
Set text or sprite name for entry.
The sprite() flag determines if this is a sprite or text entry
value | text or sprite name |
max_length | maximum length of the text or sprite name that will be used with this menu item or -1 (the default) for the length of value |
|
inline |
Check if the item is ticked.
|
inline |
Set if the item is ticked.
t | set to true if the item should be ticked |