Property

Properties viewer and editor.

Dependencies

SpreadSheet

Summary
PropertyProperties viewer and editor.
AddCreates property control.
ClearClear Property control.
DefineExport the propety definition list from the control.
RemoveRemoves one or more properties from the list.
FindReturns the current index of the property.
ForEachIterator
GetParamGet the property parameter.
GetValueGet the property value.
InsertInsert properties in the list on a given position.
InsertFileInsert properties from a file.
SaveSave content of the control in a file.
SetSet property value and parameter.
SetColSizeSet column size.
SetColorsSet colors of property elements.
SetFontSet font of propety element.
SetParamSet property parameter.
SetRowHeightSet row height.
About

Add

Property_Add(HParent,  
X = 0,
Y = 0,
W = 200,
H = 100,
Style = "",
Handler = "")

Creates property control.

Parameters

hGuiHandle of the parent.
X..HControl coordinates.
StyleWhite space separated list of style names.  Currently any SS style can be added.
HandlerNotification handler.

Handler

Result : Handler(hCtrl, Event, Name, Value, Param)
hCtrlHandle of the control that sends notification.
EventEvent name.  Can be S (Select) EB (Edit Before), EA (Edit After) and CB (ComboBox).
NameName of the selected property.
ValueValue of the selected property.  If event is EA, this argument contains user input.
ParamParameter of the selected property.  If event is EA, this argument contains user input.
ResultReturn 1 to prevent selection (S) or to prevent user changing the value (EA).  For details about CB, see Insert and Define.

Events

SSelect
EBEdit before.
EAEdit after.  Value contains user input.  Return 1 to prevent change of value / param.
CBComboBox 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.
FForEach.  You can fire this event with ForEach function and it will iterate all properties in the control.

Retunrs

Control’s handle.

Clear

Property_Clear(HCtrl)

Clear Property control.

Define

Property_Define(HCtrl,  
ComboEvent = false)

Export the propety definition list from the control.

Parameters

ComboEventSet 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.

Remove

Property_Remove(hCtrl,
PropertyNames)

Removes one or more properties from the list.

Parameters

PropertyNamesNew line separated list of property names.

Find

Property_Find(hCtrl,  
Name,  
StartAt = )

Returns the current index of the property.

Parameters

NameName of the property, the one with lower index will be returned.
StartAtIndex from which to start searching, by default 0.

Returns

Positive number or 0 if property by that name is not found.

ForEach

Property_ForEach(hCtrl,  
SkipSeparators = TRUE)

Iterator

Parameters

SkipSeparatorsSet to FALSE not to skip separators while iterating.

Remarks

The function will rise “F” event for the control.

GetParam

Property_GetParam(hCtrl,
Name)

Get the property parameter.

Parameters

NameProperty name or index for which to get the value.

Returns

Parameter

GetValue

Property_GetValue(hCtrl,
Name)

Get the property value.

Parameters

NameProperty name or index for which to get the value.

Returns

Value

Insert

Property_Insert(hCtrl,  
Properties,  
Position = )

Insert properties in the list on a given position.

Parameters

PropertiesProperty 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.
PositionPosition 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.

Definition

NameName of the property to be displayed in the first column.
TypeType of the property.  Currently supported types are: Text, Button, WideButton, CheckBox, ComboBox, Integer, Float, Hyperlink, Separator.  If not specified, Text is used by default.
ValueValue 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.
ParamIndex of the selected item (ComboBox), 1|0 (Checkbox).

Remarks

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 commentslines that start with “;” char.

InsertFile

Property_InsertFile(hCtrl,  
FileName,  
ParseIni =  false)

Insert properties from a file.

Parameters

FileNameFile from which to import properties.  The file contains property definition list.
ParseIniSet to TRUE if file is an INI file.

Remarks

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.

Save

Property_Save(hCtrl,  
FileName,  
ComboEvent = false)

Save content of the control in a file.

Parameters

FileNameFile to save to.  If exists, it will be first deleted (without confirmation).
ComboEventSet to TRUE to generate combobox event (CB).  See Define for more details.

Returns

FALSE if there was a problem saving file, TRUE otherwise.

Set

Property_Set(hCtrl,  
Name,  
Value,  
Param = "")

Set property value and parameter.

Parameters

NameProperty name for which to get the value, or its index in the list
ValueProperty value.
ParamOptional property parameter.

SetColSize

Property_SetColSize(HCtrl,  
C = 120)

Set column size.

Parameters

CSize of the first column, by default 120.  The other column will be sized automatically according to the control width.

SetColors

Property_SetColors(hCtrl,
Colors)

Set colors of property elements.

Parameters

ColorsString containing white space separated colors of property elements.

Colors

PB PFproperty bg & fg
VB VFvalue bg & fg
SB SFseparator bg & fg

Example

Property_SetColors("pbAAEEAA sbBFFFFF")   ;set property and separator background color

SetFont

Property_SetFont(HCtrl,
Element,
Font)

Set font of propety element.

Parameters

ElementOne of the four available elements: Property, Value, Separator, Hyperlink.
FontFont description in AHK format

SetParam

Property_SetParam(HCtrl,
Name,
Param)

Set property parameter.

Parameters

NameProperty name for which to get the value, or its index in the list
ParamProperty parameter.

SetRowHeight

Property_SetRowHeight(hCtrl,
Height)

Set row height.

About

Property_Add(HParent,  
X = 0,
Y = 0,
W = 200,
H = 100,
Style = "",
Handler = "")
Creates property control.
Property_Clear(HCtrl)
Clear Property control.
Property_Define(HCtrl,  
ComboEvent = false)
Export the propety definition list from the control.
Property_Remove(hCtrl,
PropertyNames)
Removes one or more properties from the list.
Property_Find(hCtrl,  
Name,  
StartAt = )
Returns the current index of the property.
Property_ForEach(hCtrl,  
SkipSeparators = TRUE)
Iterator
Property_GetParam(hCtrl,
Name)
Get the property parameter.
Property_GetValue(hCtrl,
Name)
Get the property value.
Property_Insert(hCtrl,  
Properties,  
Position = )
Insert properties in the list on a given position.
Property_InsertFile(hCtrl,  
FileName,  
ParseIni =  false)
Insert properties from a file.
Property_Save(hCtrl,  
FileName,  
ComboEvent = false)
Save content of the control in a file.
Property_Set(hCtrl,  
Name,  
Value,  
Param = "")
Set property value and parameter.
Property_SetColSize(HCtrl,  
C = 120)
Set column size.
Property_SetColors(hCtrl,
Colors)
Set colors of property elements.
Property_SetFont(HCtrl,
Element,
Font)
Set font of propety element.
Property_SetParam(HCtrl,
Name,
Param)
Set property parameter.
Property_SetRowHeight(hCtrl,
Height)
Set row height.
SpreadSheet control is extremelly fast and small Excell like control, developed in Assembler.
Close