tbx  0.7.3
Public Types | Public Member Functions | List of all members
tbx::Scale Class Reference

Class to show a toolbox Scale object. More...

#include <scale.h>

Inheritance diagram for tbx::Scale:
tbx::ShowFullObject tbx::ShowPointObject tbx::Object

Public Types

enum  { TOOLBOX_CLASS = 0x82c00 }
 

Public Member Functions

 Scale ()
 Uninitialised constructor. More...
 
 Scale (const Scale &other)
 Construct from another Scale object. More...
 
 Scale (const Object &other)
 Construct a Scale from an Object that refers to a Scale. More...
 
 Scale (const std::string &template_name)
 Create a Scale from the named template. More...
 
 Scale (const res::ResScale &object_template)
 Create a Scale from an in memory template resource. More...
 
Scaleoperator= (const Scale &other)
 Assign this Scale from another. More...
 
Scaleoperator= (const Object &other)
 Assign this Scale from an Object that refers to a Scale. More...
 
bool operator== (const Object &other) const
 Check if this Scale refers to the same underlying toolbox object as another. More...
 
bool operator!= (const Object &other) const
 Check if this Scale does not refers to the same underlying toolbox object as another. More...
 
Window window () const
 Return the underlying toolbox window used to implement the Scale object.
 
void value (int pc)
 Set the scale percentage. More...
 
int value () const
 Get the scale percentage.
 
void lower_bound (int value)
 Set the lower bound for the scale. More...
 
int lower_bound () const
 Get the lower bound for the scale. More...
 
void upper_bound (int value)
 Set the upper bound for the scale. More...
 
int upper_bound () const
 Get the upper bound for the scale. More...
 
void step_size (int value)
 Set the step size for the scale. More...
 
int step_size () const
 Get the step size for the scale. More...
 
void title (std::string msg)
 Set the title for the scale dialogue.
 
std::string title () const
 Return the title of the scale dialogue.
 
int title_length () const
 Return the title length.
 
void add_about_to_be_shown_listener (AboutToBeShownListener *listener)
 This event is raised just before the Scale underlying window is about to be shown. More...
 
void remove_about_to_be_shown_listener (AboutToBeShownListener *listener)
 Remove about to be shown listener. More...
 
void add_has_been_hidden_listener (HasBeenHiddenListener *listener)
 This event is raised after the Scale dialog has been completed. More...
 
void remove_has_been_hidden_listener (HasBeenHiddenListener *listener)
 Remove has been hidden listener. More...
 
void add_apply_factor_listener (ScaleApplyFactorListener *listener)
 Add listener for save button on print dialogue. More...
 
void remove_apply_factor_listener (ScaleApplyFactorListener *listener)
 Remove listener for save button on print dialogue. More...
 
- Public Member Functions inherited from tbx::ShowFullObject
 ShowFullObject ()
 Constructor with no reference to a Toolbox object. More...
 
 ShowFullObject (ObjectId handle)
 Construct from a Toolbox object id. More...
 
 ShowFullObject (const Object &other)
 Construct as reference to another Toolbox object. More...
 
 ShowFullObject (const std::string &template_name)
 Create a Toolbox object and make this object a reference to it. More...
 
 ShowFullObject (const res::ResObject &object_template)
 Create Toolbox object from a memory template and make this object a reference to it. More...
 
void show (const ShowFullSpec &full_spec)
 Show object with full position specified.
 
void show (const ShowFullSpec &full_spec, const Object &parent)
 Show object with full position specified.
 
void show (const ShowFullSpec &full_spec, const Component &parent)
 Show object with full position specified.
 
- Public Member Functions inherited from tbx::ShowPointObject
 ShowPointObject ()
 Constructor with no reference to a Toolbox object. More...
 
 ShowPointObject (ObjectId handle)
 Construct from a Toolbox object id. More...
 
 ShowPointObject (const Object &other)
 Construct as reference to another Toolbox object. More...
 
 ShowPointObject (const std::string &template_name)
 Create a Toolbox object and make this object a reference to it. More...
 
 ShowPointObject (const res::ResObject &object_template)
 Create Toolbox object from a memory template and make this object a reference to it. More...
 
void show (const Object &parent)
 Show object with given parent object.
 
void show (const Component &parent)
 Show object with given parent component.
 
void show (const Point &pos)
 Show object with top left at the given position.
 
void show (const Point &pos, const Object &parent)
 Show object with top left at the given position.
 
void show (const Point &pos, const Component &parent)
 Show object with top left at the given position.
 
void show_as_menu ()
 Show object as a menu at default position.
 
void show_as_menu (const Object &parent)
 Show object as a menu with the given parent.
 
void show_as_menu (const Component &parent)
 Show object as a menu with the given parent.
 
void show_as_menu (const Point &pos)
 Show object as a menu at the given point with the given parent.
 
void show_as_menu (const Point &pos, const Object &parent)
 Show object as a menu at the given point with the given parent.
 
void show_as_menu (const Point &pos, const Component &parent)
 Show object as a menu at the given point with the given parent.
 
void show_as_submenu (const MenuItem &parent)
 Show object as a sub menu from the given menu item.
 
void show_as_submenu (const Point &pos, const MenuItem &parent)
 Show object as a sub menu at the given point from the given menu item.
 
- 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 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 show a toolbox Scale object.

The scale object show a dialogue that allow the scale factors of a document to be set.

Constructor & Destructor Documentation

tbx::Scale::Scale ( )
inline

Uninitialised constructor.

The Scale object must be assigned to a valid Toolbox object before its properties or methods are used

tbx::Scale::Scale ( const Scale other)
inline

Construct from another Scale object.

This object then refers to the same underlying Toolbox object as the other Scale object

Parameters
otherScale to copy reference from.
tbx::Scale::Scale ( const Object other)
inline

Construct a Scale from an Object that refers to a Scale.

This class then refers to the same underlying Toolbox object as the other object

Parameters
otherObject to copy.
Exceptions
ObjectNullExceptionif the other object refers to a null object handle
ObjectClassExceptionif the other object is not a Scale
tbx::Scale::Scale ( const std::string &  template_name)
inline

Create a Scale from the named template.

Parameters
template_nameThe name of the template to create the object from
Exceptions
OsErrorif an object cannot be created from the named template
ObjectClassExceptionif the template is not for a Scale
tbx::Scale::Scale ( const res::ResScale object_template)

Create a Scale from an in memory template resource.

Parameters
object_templateThe template to create the object from
Exceptions
OsErrorif an object cannot be created from the template

Member Function Documentation

void tbx::Scale::add_about_to_be_shown_listener ( AboutToBeShownListener listener)

This event is raised just before the Scale underlying window is about to be shown.

Parameters
listenerlistener to add
void tbx::Scale::add_apply_factor_listener ( ScaleApplyFactorListener listener)

Add listener for save button on print dialogue.

Parameters
listenerlistener to add
void tbx::Scale::add_has_been_hidden_listener ( HasBeenHiddenListener listener)

This event is raised after the Scale dialog has been completed.

Parameters
listenerlistener to add
void tbx::Scale::lower_bound ( int  value)

Set the lower bound for the scale.

Parameters
valuelowest value the scale can be set to
int tbx::Scale::lower_bound ( ) const

Get the lower bound for the scale.

Returns
lowest value ths scale can be set to
bool tbx::Scale::operator!= ( const Object other) const
inline

Check if this Scale does not refers to the same underlying toolbox object as another.

Parameters
otherObject to compare to
Returns
true if they do not refer to the same underlying toolbox object
Scale& tbx::Scale::operator= ( const Scale other)
inline

Assign this Scale from another.

Both objects will then refer to the same underlying toolbox object

Parameters
otherScale to copy
Returns
reference to this Scale
Scale& tbx::Scale::operator= ( const Object other)
inline

Assign this Scale from an Object that refers to a Scale.

This class then refers to the same underlying toolbox object as the other object

Parameters
otherObject to copy.
Returns
reference to this Scale
Exceptions
ObjectNullExceptionif the other object refers to a null object handle
ObjectClassExceptionif the other object is not a Scale
bool tbx::Scale::operator== ( const Object other) const
inline

Check if this Scale refers to the same underlying toolbox object as another.

Parameters
otherObject to compare to
Returns
true if they refer to the same underlying toolbox object
void tbx::Scale::remove_about_to_be_shown_listener ( AboutToBeShownListener listener)

Remove about to be shown listener.

Parameters
listenerlistener to remove
void tbx::Scale::remove_apply_factor_listener ( ScaleApplyFactorListener listener)

Remove listener for save button on print dialogue.

Parameters
listenerlistener to remove
void tbx::Scale::remove_has_been_hidden_listener ( HasBeenHiddenListener listener)

Remove has been hidden listener.

Parameters
listenerlistener to remove
void tbx::Scale::step_size ( int  value)

Set the step size for the scale.

Parameters
valueincrement for the scale
int tbx::Scale::step_size ( ) const

Get the step size for the scale.

Returns
increments used for the scale
void tbx::Scale::upper_bound ( int  value)

Set the upper bound for the scale.

Parameters
valuemaximum value for the scale
int tbx::Scale::upper_bound ( ) const

Get the upper bound for the scale.

Returns
maximum value for the scale
void tbx::Scale::value ( int  pc)
inline

Set the scale percentage.

Parameters
pcthe new percentage for the scale

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