32 #ifndef TBX_WRITEABLEFIELD_H_
33 #define TBX_WRITEABLEFIELD_H_
39 class TextChangedListener;
51 enum {TOOLBOX_CLASS = 512};
184 void font(
const std::string &name,
int width,
int height);
WritableField(const Component &other)
Construct a writable field from a Component.
Definition: writablefield.h:87
std::string string_property(int property_id) const
Get a string property from the toolbox object.
Definition: component.cc:261
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
~WritableField()
Destroy a Writable Field gadget.
Definition: writablefield.h:60
WritableField & operator=(const Component &other)
Assign a writable field to refer to the same underlying toolbox component as an existing Gadget.
Definition: writablefield.h:110
ObjectId handle() const
Return the object handle for his component.
Definition: component.h:95
bool operator==(const Gadget &other) const
Check if this display field refers to the same underlying toolbox gadget as another gadget.
Definition: writablefield.h:117
bool operator!=(const Gadget &other) const
Check if this display field refers to the same underlying toolbox gadget as another gadget.
Definition: writablefield.h:124
The Window object represents a toolbox window.
Definition: window.h:70
std::string allowable() const
Get the pattern that specifies the character that can be entered into this field.
Definition: writablefield.h:178
void remove_text_changed_listener(TextChangedListener *listener)
Remove a text changed listener.
Definition: writablefield.cc:133
Base class for components in an object.
Definition: component.h:42
ObjectId _handle
Underlying toolbox handle.
Definition: component.h:45
ComponentId id() const
Get the component ID of this component.
Definition: component.h:103
WritableField wrapper class for an underlying toolbox WritableField gadget.
Definition: writablefield.h:49
WritableField(const Gadget &other)
Construct a writable field from another gadget.
Definition: writablefield.h:78
void font(const std::string &name, int width, int height)
Set the font used for the writable field.
Definition: writablefield.cc:85
std::string text() const
Get the the text that is being displayed.
Definition: writablefield.h:136
void system_font(int width, int height)
Set the writable field to use the system font to display the text.
Definition: writablefield.cc:105
void text(const std::string &value)
Set the the text to display.
Definition: writablefield.h:131
int text_length() const
Get the length of the text property.
Definition: writablefield.h:143
int allowable_length() const
Get the length of the allowable pattern.
Definition: writablefield.h:182
void add_key_listener(KeyListener *listener)
Add a listener to report the keys pressed in a Writable field.
Definition: writablefield.cc:141
void remove_key_listener(KeyListener *listener)
Remove the keys pressed event.
Definition: writablefield.cc:149
WritableField & operator=(const Gadget &other)
Assign a writable field to refer to the same underlying toolbox gadget as an existing Gadget.
Definition: writablefield.h:101
WritableField & operator=(const WritableField &other)
Assign a writable field to refer to the same underlying toolbox gadget as another.
Definition: writablefield.h:93
void add_text_changed_listener(TextChangedListener *listener)
Add a listener to report when the text has changed in the writable field.
Definition: writablefield.cc:125
int _id
Underlying toolbox component id.
Definition: component.h:46
Listener for text changed events.
Definition: textchangedlistener.h:93
int string_property_length(int property_id) const
Get a the length of a string property from the toolbox object.
Definition: component.cc:302
Listener for KeyPressed WIMP event.
Definition: keylistener.h:179
This is the base class for all Gadgets.
Definition: gadget.h:49
WritableField()
Construct an uninitialised display field.
Definition: writablefield.h:53
void check_toolbox_class(int class_id) const
Check the underlying gadget class for this object has the given class id.
Definition: gadget.cc:47
void allowable(const std::string &value)
Definition: writablefield.h:172
WritableField(const WritableField &other)
Construct a writable field from another writableField.
Definition: writablefield.h:67