Properties module

This documentation is poor. If you need something, look into the source ;-)

Table of contents:


Credits

Martin Stachọ © 2002
martin.stachon@tiscali.cz,
http://www.webpark.cz/stachon/

Thanks to Judith Evans and Roland Stowasser for testing and suggestions.

Free for non-commercial use. Contact author for use in commercial applications.


What's this?

This library lets you add a Property sheet to your win32lib program. At this point, only one sheet per program is supported. Property sheet is table of two columns. The left column has name of a property and the right has its value, which is editable in various ways. Property sheet looks like this :


Features:

This version requires win32lib 0.55.x, 0.57.x or later, preferably 0.58 (when aviable)


Creating a Property Sheet

Property sheet is created with function :


Adding and Setting Properties

After you have created a Property Sheet, you can add properties to it. Properties appear in the order you add them, also you must child properties right after its parent is added. Property which has a child is marked with '+' sign and clicking on it expands its children. There is no way to delete a property, however you can hide it. The routine used for adding is:

After you are done adding properties and setting their values, you should draw them by calling redrawProperties(1)

You can set property value with procedure : This procedure is specially used with ptComboBox and ptDropDowList You can retrieve property value with : You can make a property visible/invisible with : You can disable property. Disabled property is drawn with gray text, cannot be clicked to, and cannot be edited:
These routines are used to change parent property collapsed/expanded state: You can specify whether the property waits for enter to be pressed to change or not.


Events

This library lets you set up handlers to invoke when an event happens with certain property cell. You register handler with:

The invoked function must have these parameters:

Events list

peLeftUp

Description Invoked whenever an enabled property is clicked with left mouse button.
params = {}
Return value Not used

peRightUp

Description Invoked whenever an enabled property is clicked with right mouse button. Typically used to show a popup menu.
params = {mouse_x, mouse_y} -- mouse position relative to Property Sheet (useful for popup()).
Return value Not used

peDblClick

Description Invoked whenever user double clicks on enabled property with left button. Note: as for win32lib 0.57.9, this doesn't work with EditText. You need to add w32Clickable to classAttr for EditText.
params = {}
Return value Not used

peEditButton

Description Used only with property type ptEditAndButton. Invoked when the "..." button is clicked.
params = {text} -- current text of edit box
Return value Handler returns the new text for edit box.

peChange

Description Invoked whenever property value has been changed.
params = {text} -- the new value
Return value Handler returns one of the following: