hwtk::propertysheet

Create and manipulate hierarchical multicolumn widgets.

Format

hwtk::propertysheet - pathName ?option value? …

Description

A hwtk::propertysheet creates a simple, 2 column tree with a name column and value column. Standard and custom editors can be assigned to each row in the value column to allow editing of different types of data. Items can be displayed in a hierarchical format.

Standard Options

-clientdata
Database name: clientData
Database class: ClientData
Acts as a data storage for a widgets. User can store any data and this will not have any effect on widget property.

Widget Specific Options

-boldlabels
Database name: boldlabels
Database class: Boldlabels
Boolean value. If true, sets the font for labels to be bold. Defaults to true.
-fittocontent
Database name: fittocontent
Database class: Fittocontent
Boolean value. If true, fittocontent is automatically called when the widget is mapped. Defaults to true.
-showheader
Database name: showHeader
Database class: ShowHeader
Boolean value. If true, headers of propertysheet are displayed, else they are hidden. Defaults to true.

Widget Commands

pathName cget option
Returns the current value of the configuration option given by option.
pathName columncget tag option
Returns the current value of the configuration option for the column tag.
pathName column configure tag ?option? ?value option value? …
Works the same as configure for any other widget for column tag.
pathName column list
Returns a list of columns currently available.
pathName configure ?option? ?value option value …?
Query or modify the configuration options of the widget. If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. If option is specified with no value, then the command returns a list describing the named option: the elements of the list are the option name, database name, database class, default value, and current value. If no option is specified, returns a list describing all of the available options for pathName.
pathName editorpost tag
Displays the editor for the given tag.
pathName editorunpost
Closes the active editor.
pathName fittocontent
Size the propertysheet to show all content.
pathName getvalue tag
Returns the value of the item specified by tag.
pathName identify element x y
Returns the name of the element under the point given by x and y, or an empty string if the point does not lie within any element. x and y are pixel coordinates relative to the widget. Some widgets accept other identify subcommands.
pathName instate statespec ?script?
Test the widget’s state. If script is not specified, returns 1 if the widget state matches statespec and 0 otherwise. If script is specified, equivalent to
if{[pathNameinstatestateSpec]}script
pathName itemcget tag option
Returns the current value of option for the item specified by tag. Option may have any of the values accepted by the item widget command.
pathName itemconfigure tag ?options?
Configure options for item specified by tag. Options may be any of the editable options accepted by the item widget command.
pathName item create tag ?options?
Create an item tag in pathName with configuration options given in option-value pairs Valid options are -category, -clientdata, -expandbutton, -help, -image, -parent, -state, -text, -type, -validatecommand, -value, -valueacceptcommand, -valuelistcommand and -visible.
pathName item delete tag
Delete the item tag.
pathName itemexists tag
Returns a value specifying whether or not item tag exists in pathName. Returns 1 if the item exists, 0 if it does not.
pathName itemlist
Returns a list of all items in pathName.
pathName registertype typeName class displayType
Registers a custom editor to be used to edit the value of an item. typeName is the name used to reference the editor. class is an editor class name. typeNameis the name used to reference the editor. class is an editor class name. displayType can be text, image, window and rect.
pathName reqheight
Return the height required to fit the contents of table. More accurate than winfo reqheight.
pathName reqwidth
Return the width required to fit the contents of table. More accurate than winfo reqwidth.
pathName setvalue tag value
Set the value of the item specified by tag.
pathName typecget type option
Returns the value of the specified option for the editor typename type. Option is either -class or -displaytype.
pathName typelist
Displays a list of available editor types.
pathName types
Displays a list of available editor types.

Example

#::hwtk::propertysheet

proc SetValue {W I V} {
    puts [info level 0]
    return 1
}

proc Validate {W I V P} {
    puts [info level 0]
    return 1
}

proc GetValueList {W I} {
    puts [info level 0]
    return [list Atlanta Boston Chicago Detroit "San Franciso"]
}

set dlg [::hwtk::dialog .#auto -title "::hwtk::propertysheet"]
set ps [::hwtk::propertysheet [$dlg recess].p]

$ps itemcreate real -text Real -type real -help "of type real" -value 1.5 -valueacceptcommand "SetValue %W %I %V" -validatecommand "Validate %%V"
$ps itemcreate int -text Integer -type int -help "of type int" -value "-12" -valueacceptcommand "SetValue %W %I %V"
$ps itemcreate uint -text "Unsigned Integer" -image [hwtk::image cache productHyperWorks-16.png] -type uint -help "of type uint" -value "12" -valueacceptcommand "SetValue %W %I %V"
$ps itemcreate combo -text Combobox -type combobox -value "Detroit" -help "of type combo" -valuelistcommand "GetValueList %W" -valueacceptcommand "SetValue %W %I %V"
$ps itemcreate str -text String -type str -expandbutton 1 -help "of type str" -valueacceptcommand "SetValue %W %I %V"
$ps itemcreate color -text "Color" -type intcolor -parent str -help "of type intcolor" -value "2" -valueacceptcommand "SetValue %W %I %V"

pack $ps -fill both -expand true
$ps fittocontent
$dlg post