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

Class for NumberRange gadget template. More...

#include <resnumberrange.h>

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

Public Types

enum  { TYPE_ID = 832 }
 
enum  SliderType { NO_SLIDER, SLIDER_RIGHT, SLIDER_LEFT }
 Enumaration for how slider is shown. More...
 

Public Member Functions

 ResNumberRange (const ResGadget &other)
 Construct an number range gadget resource. More...
 
 ResNumberRange (const ResNumberRange &other)
 Construct an number range gadget resource. More...
 
ResNumberRangeoperator= (const ResGadget &other)
 Assign from a ResGadget. More...
 
ResNumberRangeoperator= (const ResNumberRange &other)
 Assign from another number range gadget resource. More...
 
 ResNumberRange ()
 Construct a number range 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 number range is writable. More...
 
void writable (bool value)
 Set if number range is writable. More...
 
bool no_display_area () const
 Check if display area is omitted from the number range. More...
 
void no_display_area (bool value)
 Set if display area is omitted from the number range. More...
 
bool has_adjuster_arrows () const
 Check if the number range shows adjuster arrows. More...
 
void has_adjuster_arrows (bool value)
 Set if the number range shows adjuster arrows. More...
 
SliderType slider_type () const
 Get how the slider is displayed. More...
 
void slider_type (SliderType value)
 Set how the slider is displayed. More...
 
ResJustification justification () const
 Get the horizontal position of the number range in its bounding box. More...
 
void justification (ResJustification value)
 Set the horizontal position of the number range in its bounding box. More...
 
WimpColour slider_colour () const
 Get slider foreground colour. More...
 
void slider_colour (WimpColour value)
 Set slider foreground colour. More...
 
WimpColour slider_background_colour () const
 Get slider background colour. More...
 
void slider_background_colour (WimpColour value)
 Set slider background colour. More...
 
int lower_bound () const
 Get the minimum value for the number range. More...
 
void lower_bound (int value)
 Set the minimum value for the number range. More...
 
int upper_bound () const
 Get the maximum value for the number range. More...
 
void upper_bound (int value)
 Set the maximum value for the number range. More...
 
int step_size () const
 Get the step size value for the number range. More...
 
void step_size (int value)
 Set the step size value for the number range. More...
 
int initial_value () const
 Get the initial value for the number range. More...
 
void initial_value (int value)
 Set the initial value for the number range. More...
 
int precision () const
 Get the precision of the number range. More...
 
void precision (int value)
 Set the precision of the number range. More...
 
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...
 
int display_length () const
 Get the length of the display field. More...
 
void display_length (int value)
 Set the length of the display field. 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 NumberRange gadget template.

Member Enumeration Documentation

◆ SliderType

Enumaration for how slider is shown.

Enumerator
NO_SLIDER 

no slider

SLIDER_RIGHT 

slider to the right of the display area

SLIDER_LEFT 

slider to the left of the display area

Constructor & Destructor Documentation

◆ ResNumberRange() [1/3]

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

Construct an number range gadget resource.

Parameters
otherResGadget to copy resource from
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an number range

◆ ResNumberRange() [2/3]

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

Construct an number range gadget resource.

Parameters
othernumber range to copy resource from

◆ ResNumberRange() [3/3]

tbx::res::ResNumberRange::ResNumberRange ( )
inline

Construct a number range gadget resource.

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

Member Function Documentation

◆ after() [1/2]

ComponentId tbx::res::ResNumberRange::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::ResNumberRange::after ( ComponentId  value)
inline

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

Parameters
valuecomponent ID of next gadget

◆ before() [1/2]

ComponentId tbx::res::ResNumberRange::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::ResNumberRange::before ( ComponentId  value)
inline

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

Parameters
valuecomponent ID of previous gadget

◆ display_length() [1/2]

int tbx::res::ResNumberRange::display_length ( ) const
inline

Get the length of the display field.

Returns
length of the display field

◆ display_length() [2/2]

void tbx::res::ResNumberRange::display_length ( int  value)
inline

Set the length of the display field.

Parameters
valuelength of the display field

◆ generate_value_changed() [1/2]

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

Check if the value changed event will be generated.

Returns
true if the value changed event will be generated

◆ generate_value_changed() [2/2]

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

Set if the value changed event will be generated.

Parameters
valueset to true to generate the value changed event

◆ has_adjuster_arrows() [1/2]

bool tbx::res::ResNumberRange::has_adjuster_arrows ( ) const
inline

Check if the number range shows adjuster arrows.

Returns
true if the number range shows adjuster arrows

◆ has_adjuster_arrows() [2/2]

void tbx::res::ResNumberRange::has_adjuster_arrows ( bool  value)
inline

Set if the number range shows adjuster arrows.

Parameters
valueset to true to shows adjuster arrows

◆ initial_value() [1/2]

int tbx::res::ResNumberRange::initial_value ( ) const
inline

Get the initial value for the number range.

Returns
initial value (this is the value scaled by the precision)

◆ initial_value() [2/2]

void tbx::res::ResNumberRange::initial_value ( int  value)
inline

Set the initial value for the number range.

Parameters
valuethe initial value (this is the value scaled by the precision)

◆ justification() [1/2]

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

Get the horizontal position of the number range in its bounding box.

Returns
ResJustification enumeration specifying the position

◆ justification() [2/2]

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

Set the horizontal position of the number range in its bounding box.

Parameters
valueResJustification enumeration specifying the position

◆ lower_bound() [1/2]

int tbx::res::ResNumberRange::lower_bound ( ) const
inline

Get the minimum value for the number range.

Returns
minimum value (this is the value scaled by the precision)

◆ lower_bound() [2/2]

void tbx::res::ResNumberRange::lower_bound ( int  value)
inline

Set the minimum value for the number range.

Parameters
valuethe minimum value (this is the value scaled by the precision)

◆ no_display_area() [1/2]

bool tbx::res::ResNumberRange::no_display_area ( ) const
inline

Check if display area is omitted from the number range.

Returns
true if there is no display area

◆ no_display_area() [2/2]

void tbx::res::ResNumberRange::no_display_area ( bool  value)
inline

Set if display area is omitted from the number range.

Parameters
valueset to true to omit the display area

◆ operator=() [1/2]

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

Assign from a ResGadget.

Parameters
otherResGadget to copy
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an number range

◆ operator=() [2/2]

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

Assign from another number range gadget resource.

Parameters
othernumber range gadget resource to copy

◆ precision() [1/2]

int tbx::res::ResNumberRange::precision ( ) const
inline

Get the precision of the number range.

The precision sets the number of decimal places displayed on the number range. All values are passed to and retrieved from the number range scaled by the power of ten of this value.

e.g. If the precision is 2, 123 is passed to the methods and shown as 1.23.

Returns
the number of decimal places to display

◆ precision() [2/2]

void tbx::res::ResNumberRange::precision ( int  value)
inline

Set the precision of the number range.

This sets the number of decimal places displayed on the number range. All values are passed to and retrieved from the number range scaled by the power of ten of this value.

e.g. If the precision is 2, 123 is passed to the methods and shown as 1.23.

Parameters
valuethe number of decimal places to display

◆ slider_background_colour() [1/2]

WimpColour tbx::res::ResNumberRange::slider_background_colour ( ) const
inline

Get slider background colour.

Returns
WimpColour with slider colour

◆ slider_background_colour() [2/2]

void tbx::res::ResNumberRange::slider_background_colour ( WimpColour  value)
inline

Set slider background colour.

Parameters
valueWimpColour with slider colour

◆ slider_colour() [1/2]

WimpColour tbx::res::ResNumberRange::slider_colour ( ) const
inline

Get slider foreground colour.

Returns
WimpColour with slider colour

◆ slider_colour() [2/2]

void tbx::res::ResNumberRange::slider_colour ( WimpColour  value)
inline

Set slider foreground colour.

Parameters
valueWimpColour with slider colour

◆ slider_type() [1/2]

SliderType tbx::res::ResNumberRange::slider_type ( ) const
inline

Get how the slider is displayed.

Returns
SliderType enumeration value specifying how the slider is displayed

◆ slider_type() [2/2]

void tbx::res::ResNumberRange::slider_type ( SliderType  value)
inline

Set how the slider is displayed.

Parameters
valueset to the SliderType enumeration value for the display required

◆ step_size() [1/2]

int tbx::res::ResNumberRange::step_size ( ) const
inline

Get the step size value for the number range.

Returns
step size value (this is the value scaled by the precision)

◆ step_size() [2/2]

void tbx::res::ResNumberRange::step_size ( int  value)
inline

Set the step size value for the number range.

Parameters
valuethe step size value (this is the value scaled by the precision)

◆ upper_bound() [1/2]

int tbx::res::ResNumberRange::upper_bound ( ) const
inline

Get the maximum value for the number range.

Returns
maximum value (this is the value scaled by the precision)

◆ upper_bound() [2/2]

void tbx::res::ResNumberRange::upper_bound ( int  value)
inline

Set the maximum value for the number range.

Parameters
valuethe maximum value (this is the value scaled by the precision)

◆ writable() [1/2]

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

Check if number range is writable.

Returns
true if the number range is writable

◆ writable() [2/2]

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

Set if number range is writable.

Parameters
valueset to true to make the number range writable

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