Properties viewer and editor.
Property | Properties viewer and editor. |
Add | Creates property control. |
Clear | Clear Property control. |
Define | Export the propety definition list from the control. |
Remove | Removes one or more properties from the list. |
Find | Returns the current index of the property. |
ForEach | Iterator |
GetParam | Get the property parameter. |
GetValue | Get the property value. |
Insert | Insert properties in the list on a given position. |
InsertFile | Insert properties from a file. |
Save | Save content of the control in a file. |
Set | Set property value and parameter. |
SetColSize | Set column size. |
SetColors | Set colors of property elements. |
SetFont | Set font of propety element. |
SetParam | Set property parameter. |
SetRowHeight | Set row height. |
About |
Property_Add( HParent, X = 0, Y = 0, W = 200, H = 100, Style = "", Handler = "" )
Creates property control.
hGui | Handle of the parent. |
X..H | Control coordinates. |
Style | White space separated list of style names. Currently any SS style can be added. |
Handler | Notification handler. |
Result : Handler(hCtrl, Event, Name, Value, Param)
hCtrl | Handle of the control that sends notification. |
Event | Event name. Can be S (Select) EB (Edit Before), EA (Edit After) and CB (ComboBox). |
Name | Name of the selected property. |
Value | Value of the selected property. If event is EA, this argument contains user input. |
Param | Parameter of the selected property. If event is EA, this argument contains user input. |
Result | Return 1 to prevent selection (S) or to prevent user changing the value (EA). For details about CB, see Insert and Define. |
S | Select |
EB | Edit before. |
EA | Edit after. Value contains user input. Return 1 to prevent change of value / param. |
CB | ComboBox event. Insert & Define fire up this event when they encounter ComboBox type (and so, functions using them, InsertFile & Save). Insert fires it up automatically when it encounters ComboBox without Value. Define requires this event to be explicitly enabled. |
F | ForEach. You can fire this event with ForEach function and it will iterate all properties in the control. |
Control’s handle.
Property_Define( HCtrl, ComboEvent = false )
Export the propety definition list from the control.
ComboEvent | Set to TRUE to generate combobox event (CB). From the handler, return text you want to put in the Value parameter or “*” to let the function automatically set it up. Value holds the handle of the ListBox. |
Property_Insert( hCtrl, Properties, Position = )
Insert properties in the list on a given position.
Properties | Property Definition List. Definition is a multiline string containing 1 property attribute per line. Definition List is the list of such definitions, separated by at least one blank line. |
Position | Position in the list (1 based) at which to insert properties from the Definition List. 0 (default) means that properties will be appended to the list. Insertion is very slow operation compared to appending. |
Name | Name of the property to be displayed in the first column. |
Type | Type of the property. Currently supported types are: Text, Button, WideButton, CheckBox, ComboBox, Integer, Float, Hyperlink, Separator. If not specified, Text is used by default. |
Value | Value of the property. For ComboBox item this contains pipe delimited list of items. In the case of Separator, you can put its desired height as value. If omited, notification handler will be called in time of population with CE event, and Param=”Insert”, so you can handle the ComboBox the way you want. |
Param | Index of the selected item (ComboBox), 1|0 (Checkbox). |
The fastest way to add properties into the list is to craft property definition list and append it into the control with one call to this function. Using this function in a loop in many iterations will lead to seriously degraded performance (especially with Position option) with very large number of properties ( around 1K )
Property defintion list can contain comments | lines that start with “;” char. |
Property_InsertFile( hCtrl, FileName, ParseIni = false )
Insert properties from a file.
FileName | File from which to import properties. The file contains property definition list. |
ParseIni | Set to TRUE if file is an INI file. |
Insert function doesn’t tolerate `r symbol. If you are manually loading text from a file, make sure you replace `r`n with `n or use *t option with FileRead.
Property_Save( hCtrl, FileName, ComboEvent = false )
Save content of the control in a file.
FileName | File to save to. If exists, it will be first deleted (without confirmation). |
ComboEvent | Set to TRUE to generate combobox event (CB). See Define for more details. |
FALSE if there was a problem saving file, TRUE otherwise.
Property_SetColors( hCtrl, Colors )
Set colors of property elements.
Colors | String containing white space separated colors of property elements. |
PB PF | property bg & fg |
VB VF | value bg & fg |
SB SF | separator bg & fg |
Property_SetColors("pbAAEEAA sbBFFFFF") ;set property and separator background color
Creates property control.
Property_Add( HParent, X = 0, Y = 0, W = 200, H = 100, Style = "", Handler = "" )
Clear Property control.
Property_Clear( HCtrl )
Export the propety definition list from the control.
Property_Define( HCtrl, ComboEvent = false )
Removes one or more properties from the list.
Property_Remove( hCtrl, PropertyNames )
Returns the current index of the property.
Property_Find( hCtrl, Name, StartAt = )
Iterator
Property_ForEach( hCtrl, SkipSeparators = TRUE )
Get the property parameter.
Property_GetParam( hCtrl, Name )
Get the property value.
Property_GetValue( hCtrl, Name )
Insert properties in the list on a given position.
Property_Insert( hCtrl, Properties, Position = )
Insert properties from a file.
Property_InsertFile( hCtrl, FileName, ParseIni = false )
Save content of the control in a file.
Property_Save( hCtrl, FileName, ComboEvent = false )
Set property value and parameter.
Property_Set( hCtrl, Name, Value, Param = "" )
Set column size.
Property_SetColSize( HCtrl, C = 120 )
Set colors of property elements.
Property_SetColors( hCtrl, Colors )
Set font of propety element.
Property_SetFont( HCtrl, Element, Font )
Set property parameter.
Property_SetParam( HCtrl, Name, Param )
Set row height.
Property_SetRowHeight( hCtrl, Height )