an option database More...
#include <vtkKWOptionDataBase.h>


Public Types | |
| typedef vtkKWObject | Superclass |
Public Member Functions | |
| virtual const char * | GetClassName () |
| virtual int | IsA (const char *type) |
| void | PrintSelf (ostream &os, vtkIndent indent) |
| void | DeepCopy (vtkKWOptionDataBase *p) |
| virtual void | RemoveAllEntries () |
| virtual int | GetNumberOfEntries () |
| virtual void | ConfigureWidget (vtkKWWidget *obj) |
| virtual void | AddFontOptions (const char *font) |
| virtual int | AddEntry (const char *pattern, const char *command, const char *value) |
| virtual int | AddEntryAsInt (const char *pattern, const char *command, int value) |
| virtual int | AddEntryAsInt3 (const char *pattern, const char *command, int v0, int v1, int v2) |
| virtual int | AddEntryAsInt3 (const char *pattern, const char *command, int value3[3]) |
| virtual int | AddEntryAsDouble (const char *pattern, const char *command, double value) |
| virtual int | AddEntryAsDouble3 (const char *pattern, const char *command, double v0, double v1, double v2) |
| virtual int | AddEntryAsDouble3 (const char *pattern, const char *command, double value3[3]) |
| virtual void | AddBackgroundColorOptions (double r, double g, double b) |
| virtual void | AddBackgroundColorOptions (double rgb[3]) |
Static Public Member Functions | |
| static vtkKWOptionDataBase * | New () |
| static int | IsTypeOf (const char *type) |
| static vtkKWOptionDataBase * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
| vtkKWOptionDataBase () | |
| ~vtkKWOptionDataBase () | |
Protected Attributes | |
| vtkKWOptionDataBaseInternals * | Internals |
an option database
This class can be used to store entries specifying how to automatically override the default settings/look&feel of any vtkKWWidget subclass at run-time.
For example, you may want all your vtkKWPushButton objects to use a blue background by default; this can be done by adding the following entry to the application's option database at startup: myapplication->GetOptionDataBase()->AddEntry( "vtkKWPushButton", "SetBackgroundColor", "0.2 0.2 0.8"); From then on, anytime a vtkKWPushButton is created (using Create()), its look&feel is configured and overriden automatically given the entries in the database (here, its BackgroundColor is set to a blue-ish color).
Collections of entries can be grouped inside a *theme*, subclass of vtkKWTheme. Check the Examples/Cxx/Theme for more details. Each vtkKWApplication object has a unique instance of a vtkKWOptionDataBase.
Note that each entry is added as a pattern, a command, and a value:
Definition at line 78 of file vtkKWOptionDataBase.h.
Reimplemented from vtkKWObject.
Definition at line 83 of file vtkKWOptionDataBase.h.
| vtkKWOptionDataBase::vtkKWOptionDataBase | ( | ) | [protected] |
| vtkKWOptionDataBase::~vtkKWOptionDataBase | ( | ) | [protected] |
| static vtkKWOptionDataBase* vtkKWOptionDataBase::New | ( | ) | [static] |
Reimplemented from vtkKWObject.
| virtual const char* vtkKWOptionDataBase::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkKWObject.
| static int vtkKWOptionDataBase::IsTypeOf | ( | const char * | type | ) | [static] |
Reimplemented from vtkKWObject.
| virtual int vtkKWOptionDataBase::IsA | ( | const char * | type | ) | [virtual] |
Reimplemented from vtkKWObject.
| static vtkKWOptionDataBase* vtkKWOptionDataBase::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkKWObject.
| void vtkKWOptionDataBase::PrintSelf | ( | ostream & | os, | |
| vtkIndent | indent | |||
| ) | [virtual] |
Reimplemented from vtkKWObject.
| void vtkKWOptionDataBase::DeepCopy | ( | vtkKWOptionDataBase * | p | ) |
| virtual int vtkKWOptionDataBase::AddEntry | ( | const char * | pattern, | |
| const char * | command, | |||
| const char * | value | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsInt | ( | const char * | pattern, | |
| const char * | command, | |||
| int | value | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsInt3 | ( | const char * | pattern, | |
| const char * | command, | |||
| int | v0, | |||
| int | v1, | |||
| int | v2 | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsInt3 | ( | const char * | pattern, | |
| const char * | command, | |||
| int | value3[3] | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsDouble | ( | const char * | pattern, | |
| const char * | command, | |||
| double | value | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsDouble3 | ( | const char * | pattern, | |
| const char * | command, | |||
| double | v0, | |||
| double | v1, | |||
| double | v2 | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual int vtkKWOptionDataBase::AddEntryAsDouble3 | ( | const char * | pattern, | |
| const char * | command, | |||
| double | value3[3] | |||
| ) | [virtual] |
Add a new entry in the database. Return the unique Id of the entry
| virtual void vtkKWOptionDataBase::RemoveAllEntries | ( | ) | [virtual] |
Remove all entries.
| virtual int vtkKWOptionDataBase::GetNumberOfEntries | ( | ) | [virtual] |
Get number of entries.
| virtual void vtkKWOptionDataBase::ConfigureWidget | ( | vtkKWWidget * | obj | ) | [virtual] |
Configure a widget according to the options in the database. Return the Id of the entry if found, -1 otherwise
| virtual void vtkKWOptionDataBase::AddBackgroundColorOptions | ( | double | r, | |
| double | g, | |||
| double | b | |||
| ) | [virtual] |
Convenience method to set all the known background color options to a specific color.
| virtual void vtkKWOptionDataBase::AddBackgroundColorOptions | ( | double | rgb[3] | ) | [inline, virtual] |
Add a new entry in the database. Return the unique Id of the entry
Definition at line 119 of file vtkKWOptionDataBase.h.
| virtual void vtkKWOptionDataBase::AddFontOptions | ( | const char * | font | ) | [virtual] |
Convenience method to set all the known font options to a specific font.
vtkKWOptionDataBaseInternals* vtkKWOptionDataBase::Internals [protected] |
Definition at line 135 of file vtkKWOptionDataBase.h.
1.6.1