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

Class for StringSet gadget template. More...

#include <resstringset.h>

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

Public Types

enum  { TYPE_ID = 896 }
 

Public Member Functions

 ResStringSet (const ResGadget &other)
 Construct an string set gadget resource. More...
 
 ResStringSet (const ResStringSet &other)
 Construct an string set gadget resource. More...
 
ResStringSetoperator= (const ResGadget &other)
 Assign from a ResGadget. More...
 
ResStringSetoperator= (const ResStringSet &other)
 Assign from another string set gadget resource. More...
 
 ResStringSet ()
 Construct a string set gadget resource. More...
 
bool generate_value_changed () const
 Check if the value changed event will be generated. More...
 
void generate_value_changed (bool value)
 Set if the value changed event will be generated. More...
 
bool writable () const
 Check if user can enter values in the string set. More...
 
void writable (bool value)
 Set if user can enter values in the string set. More...
 
bool generate_event_before_showing_menu () const
 Check if an event will be generated before the menu is shown. More...
 
void generate_event_before_showing_menu (bool value)
 Set if an event will be generated before the menu is shown. More...
 
bool no_value_field () const
 Check if string set has no display or writable field. More...
 
void no_value_field (bool value)
 Set if string set has no display or writable field. More...
 
ResJustification justification () const
 Get justification of the value. More...
 
void justification (ResJustification value)
 Set justification of the value. More...
 
const char * string_set () const
 Get the set of values shown in the string set menu. More...
 
void string_set (const char *value)
 Set the set of values shown in the string set menu. More...
 
void string_set (const std::string &value)
 Set the set of values shown in the string set menu. More...
 
const char * title () const
 Get the title for the menu. More...
 
void title (const char *value)
 Set the title for the menu. More...
 
void title (const std::string &value)
 Set the title for the menu. More...
 
const char * selected_string () const
 Get the initially selected string. More...
 
void selected_string (const char *value, int max_length=-1)
 Set the initially selected string. More...
 
void selected_string (const std::string &value, int max_length=-1)
 Set the initially selected string. More...
 
int max_selected_string () const
 Get the maximum length the selected string can be increased to when using the string set.
 
const char * allowable () const
 Get the allowable characters in a writable string set. More...
 
void allowable (const char *value, int max_length=-1)
 Set the allowable characters in a writable string set. More...
 
void allowable (const std::string &value, int max_length=-1)
 Set the allowable characters in a writable string set. More...
 
int max_allowable () const
 Get the maximum length the allowable character can be changed to when the gadget is shown.
 
ComponentId before () const
 Get the component ID of the gadget before this one in the Tab order. More...
 
void before (ComponentId value)
 Set the component ID of the gadget before this one in the Tab order. More...
 
ComponentId after () const
 Get the component ID of the gadget after this one in the Tab order. More...
 
void after (ComponentId value)
 Set the component ID of the gadget after this one in the Tab order. More...
 
- 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 StringSet gadget template.

Constructor & Destructor Documentation

◆ ResStringSet() [1/3]

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

Construct an string set gadget resource.

Parameters
otherResGadget to copy resource from
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an string set

◆ ResStringSet() [2/3]

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

Construct an string set gadget resource.

Parameters
otherstring set to copy resource from

◆ ResStringSet() [3/3]

tbx::res::ResStringSet::ResStringSet ( )
inline

Construct a string set gadget resource.

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

Member Function Documentation

◆ after() [1/2]

ComponentId tbx::res::ResStringSet::after ( ) const
inline

Get the component ID of the gadget after this one in the Tab order.

Returns
component ID of next gadget

◆ after() [2/2]

void tbx::res::ResStringSet::after ( ComponentId  value)
inline

Set the component ID of the gadget after this one in the Tab order.

Parameters
valuecomponent ID of next gadget

◆ allowable() [1/3]

const char* tbx::res::ResStringSet::allowable ( ) const
inline

Get the allowable characters in a writable string set.

See also
tbx::WritableField::allowable()
Returns
pointer to zero terminated string of allowable characters or 0 if there is no restriction

◆ allowable() [2/3]

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

Set the allowable characters in a writable string set.

See also
tbx::WritableField::allowable()
Parameters
valuepointer to zero terminated string of allowable characters or 0 if there is no restriction
max_lengthmaximum length the allowable character can be changed to when the gadget is shown or -1 (the default) for the length of value.

◆ allowable() [3/3]

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

Set the allowable characters in a writable string set.

See also
tbx::WritableField::allowable()
Parameters
valuestring of allowable characters
max_lengthmaximum length the allowable character can be changed to when the gadget is shown or -1 (the default) for the length of value.

◆ before() [1/2]

ComponentId tbx::res::ResStringSet::before ( ) const
inline

Get the component ID of the gadget before this one in the Tab order.

Returns
component ID of previous gadget

◆ before() [2/2]

void tbx::res::ResStringSet::before ( ComponentId  value)
inline

Set the component ID of the gadget before this one in the Tab order.

Parameters
valuecomponent ID of previous gadget

◆ generate_event_before_showing_menu() [1/2]

bool tbx::res::ResStringSet::generate_event_before_showing_menu ( ) const
inline

Check if an event will be generated before the menu is shown.

Returns
true if the event will be generated

◆ generate_event_before_showing_menu() [2/2]

void tbx::res::ResStringSet::generate_event_before_showing_menu ( bool  value)
inline

Set if an event will be generated before the menu is shown.

Parameters
valueset to true to generate the event

◆ generate_value_changed() [1/2]

bool tbx::res::ResStringSet::generate_value_changed ( ) const
inline

Check if the value changed event will be generated.

Returns
true if the event will be generated

◆ generate_value_changed() [2/2]

void tbx::res::ResStringSet::generate_value_changed ( bool  value)
inline

Set if the value changed event will be generated.

Parameters
valueset to true to generate the event

◆ justification() [1/2]

ResJustification tbx::res::ResStringSet::justification ( ) const
inline

Get justification of the value.

Returns
ResJustification value specifying justification

◆ justification() [2/2]

void tbx::res::ResStringSet::justification ( ResJustification  value)
inline

Set justification of the value.

Parameters
valueResJustification value specifying justification

◆ no_value_field() [1/2]

bool tbx::res::ResStringSet::no_value_field ( ) const
inline

Check if string set has no display or writable field.

Returns
true if no value field is shown

◆ no_value_field() [2/2]

void tbx::res::ResStringSet::no_value_field ( bool  value)
inline

Set if string set has no display or writable field.

Parameters
valueset to true if no value field should be shown

◆ operator=() [1/2]

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

Assign from a ResGadget.

Parameters
otherResGadget to copy
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an string set

◆ operator=() [2/2]

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

Assign from another string set gadget resource.

Parameters
otherstring set gadget resource to copy

◆ selected_string() [1/3]

const char* tbx::res::ResStringSet::selected_string ( ) const
inline

Get the initially selected string.

Returns
pointer to zero terminated string or 0 if none

◆ selected_string() [2/3]

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

Set the initially selected string.

Parameters
valuepointer to zero terminated string or 0 if none
max_lengthThe maximum length the selected string can be increased to when using the string set or -1 (the default) to use the length of value.

◆ selected_string() [3/3]

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

Set the initially selected string.

Parameters
valueselected string
max_lengthThe maximum length the selected string can be increased to when using the string set or -1 (the default) to use the length of value.

◆ string_set() [1/3]

const char* tbx::res::ResStringSet::string_set ( ) const
inline

Get the set of values shown in the string set menu.

The values are separated by commas. To include a comma use "\," to include a backslash use "\\".

Returns
pointer to zero terminated list of strings or 0 if none

◆ string_set() [2/3]

void tbx::res::ResStringSet::string_set ( const char *  value)
inline

Set the set of values shown in the string set menu.

The values are separated by commas. To include a comma use "\," to include a backslash use "\\".

Parameters
valuepointer to zero terminated list of strings or 0 if none

◆ string_set() [3/3]

void tbx::res::ResStringSet::string_set ( const std::string &  value)
inline

Set the set of values shown in the string set menu.

The values are separated by commas. To include a comma use "\," to include a backslash use "\\".

Parameters
valuelist of strings

◆ title() [1/3]

const char* tbx::res::ResStringSet::title ( ) const
inline

Get the title for the menu.

Returns
pointer to zero terminated menu title or 0 if none

◆ title() [2/3]

void tbx::res::ResStringSet::title ( const char *  value)
inline

Set the title for the menu.

Parameters
valuepointer to zero terminated menu title or 0 if none

◆ title() [3/3]

void tbx::res::ResStringSet::title ( const std::string &  value)
inline

Set the title for the menu.

Parameters
valuemenu title

◆ writable() [1/2]

bool tbx::res::ResStringSet::writable ( ) const
inline

Check if user can enter values in the string set.

Returns
true if string set is writable

◆ writable() [2/2]

void tbx::res::ResStringSet::writable ( bool  value)
inline

Set if user can enter values in the string set.

Parameters
valueset to true to make the string set is writable

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