StdProps

Webs: Faemalia -:- Greatprawn -:- Playground -:- Technical -:- Tweak
Technical Web Sections: Register -:- Users -:- Changes -:- Index -:- Search -:- Statistics

Standard Properties system in Dia. Much, much better than doing dialogs in GTK. Plus, it automatically handles loading, saving and defaults dialogs.

To use StdProps in an object, you need to create two arrays, one of PropDescriptions and one of PropOffsets. These two tables together define the types of the values in your object and tie them to the object layout. This allows the properties system to create the properties dialogs we get by double-clicking the objects, as well as the defaults dialogs, loading, saving and copying.

Constants

Methods

Relating Events to Functions

Property Flags

PROP_FLAG_MULTIVALUE:

PROP_FLAG_DONT_MERGE
are both only relevant in group properties (or in multi-object properties when that is implemented) and are more complex than I want to go into here.

PROP_FLAG_LOAD_ONLY
means the property is outdated and will only be used while loading the object and converting it to whatever new format.

PROP_FLAG_VISIBLE
determines if it is shown in the properties dialog at all. The position property, for instance, is not shown at all currently.

PROP_FLAG_DONT_SAVE
says that the property should not be stored automatically when using the object_save_using_properties, but will instead be handled manually by the objects own load/save functions. Not to be used without a very good reason.

PROP_FLAG_NO_DEFAULTS
determines whether the property will be editable in the defaults dialogs (double-clicking the icon). I believe this is the flag you want.

PROP_FLAG_STANDARD
means that the property is taken from the special selectors in the toolbox, like line width, foreground color etc, rather than from object defaults.

PROP_FLAG_WIDGET_ONLY
means there is no data to store for this property. It is used for instance for the frame property.

PROP_FLAG_OPTIONAL
means that old versions of the object may not have the property saved, and that should not be considered an error, or (less nice) that the property is not always saved, and so lack of it means it will be assigned a default value. This should only be used when adding new properties to an object that people may already have saved some of.


Edit -:- Attach -:- Ref-By -:- Printable -:- More