Win32::GUI options

-align => left/center/right

Default value: center for Button, otherwise left

Aligns the text in the control accordingly.

Applies to: Button, Label, RichEdit, Textfield

-autoplay => 0/1

Default value: 0

Starts playing the animation as soon as an AVI clip is loaded.

Applies to: Animation

-bandborders => 0/1

Default value: 0

Display a border to separate bands.

Applies to: Rebar

-buttons => 0/1

Default value: 1 for TreeView, otherwise 0

For TreeViews, enables or disables the +/- buttons to expand/collapse tree items.

For Headers, if enabled header items look like push buttons and can be clicked.

For TabStrips, if enabled items look like push buttons.

Applies to: Header, TabStrip, TreeView

-cancel => 0/1

Default value: 0

If 1, the button will correspond to the CANCEL action of a dialog, and its Click event will be fired by pressing the ESC key.

See also: "-dialogui", -cancel

Applies to: Button

-center => 0/1

Default value: 0

Centers the animation in the control area.

Applies to: Animation

-computeronly => 0/1

Default value: 0

Only enable computers to be selected.

Applies to: BrowseForFolder()

-default => 0/1

Default value: 0

Identify the item as the default one; a default Button has a black border drawn around it; a default MenuItem is printed with a bold font.

Applies to: Button, MenuItem

-directory => STRING

Specifies the initial directory.

Applies to: GetOpenFileName()

-domainonly => 0/1

Default value: 0

Only show computers in the current domain or workgroup.

Applies to: BrowseForFolder()

-driveonly => 0/1

Default value: 0

Only enable drives to be selected.

Applies to: BrowseForFolder()

-editbox => 0/1

Default value: 0

If 1, the dialog will include an edit field in which the user can type the name of an item.

Applies to: BrowseForFolder()

-file => STRING

Specifies a name that will appear on the dialog's edit field.

Applies to: GetOpenFileName()

-fill => black/gray/white/none

Default value: none

Fills the control rectangle ("black", "gray" and "white" are the window frame color, the desktop color and the window background color respectively).

Applies to: Label

-filter => ARRAY REFERENCE

[TBD]

Applies to: GetOpenFileName()

-fixedorder => 0/1

Default value: 0

Band position cannot be swapped.

Applies to: Rebar

-folderonly => 0/1

Default value: 0

Only enable folders to be selected (eg. no computers or printers).

Applies to: BrowseForFolder()

-includefiles => 0/1

Default value: 0

The list will include files as well folders.

Applies to: BrowseForFolder()

-maxsize => [X, Y]

Specifies the maximum size (width and height) in pixels; X and Y must be passed in an array reference.

Example:

$Window = new Win32::GUI::Window(
    # ...
    -maxsize => [ 200, 200 ],
);

See also: "-maxwidth", "-maxheight", -minsize

Applies to: DialogBox, Window

-minsize => [X, Y]

Specifies the minimum size (width and height) in pixels; X and Y must be passed in an array reference.

Example:

$Window = new Win32::GUI::Window(
    # ...
    -minsize => [ 100, 100 ],
);

See also: "-minwidth", "-minheight", -maxsize

Applies to: DialogBox, Window

-multiline => 0/1

Default value: 0

The control can have more than one line (note that in Textfield and RichEdit controls, newline is "\r\n", not "\n"!).

Applies to: RichEdit, TabStrip, Textfield, ToolBar

-multisel => 0/1/2

Default value: 0

Specifies the selection type:

0 single selection
1 multiple selection
2 multiple selection ehnanced (with Shift, Control, etc.)

Applies to: Listbox

-name => STRING

Defines the name for the control. The name is used to callback its events and to access its methods, so it is absolutely necessary, and each name must be unique in your application.

Example:

$Window->AddButton(
    -name => "Button1",
    # ...
);

# methods...
$Window->Button1->Hide();


# events...
sub Button1_Click {
    # ...
}

Applies to: Animation, Button, Checkbox, Class, Combobox, ComboboxEx, DateTime, DialogBox, Graphic, Groupbox, Header, Label, Listbox, ListView, NotifyIcon, ProgressBar, RadioButton, Rebar, RichEdit, Slider, Splitter, StatusBar, TabStrip, Textfield, Toolbar, TreeView, UpDown, Window

-notify => 0/1

Default value: 0

Enables the Click(), DblClick(), etc. events.

Applies to: Label

-ok => 0/1

Default value: 0

If 1, the button will correspond to the OK action of a dialog, and its Click event will be fired by pressing the ENTER key.

See also: "-dialogui", -cancel

Applies to: Button

-owner => WINDOW

[TBD]

Applies to: BrowseForFolder(), GetOpenFileName()

-password => 0/1

Default value: 0

Masks the user input (like password prompts).

See also: -passwordchar

Applies to: RichEdit, Textfield

-passwordchar => CHAR

Default value: '*'

The specified CHAR that is shown instead of the text with -password = 1>.

See also: -password

Applies to: RichEdit, Textfield

-pos => [ X, Y ]

Defines the position for the window; note that X and Y must be passed in an array reference, eg:

-pos => [ 100, 100 ],    # correct
-pos =>   100, 100,      # WRONG
-pos => @coords,         # WRONG
-pos => \@coors,         # correct

See also: "-left", "-top"

Applies to: Animation, Button, Checkbox, Combobox, ComboboxEx, DateTime, DialogBox, Graphic, Groupbox, Header, Label, Listbox, ListView, ProgressBar, RadioButton, Rebar, RichEdit, Slider, Splitter, StatusBar, TabStrip, Textfield, TreeView, UpDown, Window

-printeronly => 0/1

Default value: 0

Only enable printers to be selected

Applies to: BrowseForFolder()

-prompt => STRING or [ STRING, WIDTH ]

The -prompt option is very special; if a string is passed, a Win32::GUI::Label object (with text set to the STRING passed) is created to the left of the Textfield.

Example:

$Window->AddTextfield(
    -name   => "Username",
    -left   => 75,
    -top    => 150,
    -prompt => "Your name:",
);

Furthermore, the value to -prompt can be a reference to a list containing the string and an additional parameter, which sets the width for the Label. If WIDTH is negative, it is calculated relative to the Textfield left coordinate.

Example:

                                       (Label left)    (Textfield left)
   -left   => 75,
   -prompt => [ "Your name:", 30 ],    75              105 (75+30)

   -left   => 75,
   -prompt => [ "Your name:", -30 ],   45 (75-30)      75    

Note that the Win32::GUI::Label object is named like the Textfield, with a "_Prompt" suffix (in the example above, the Label is named "Username_Prompt").

Applies to: RichEdit, Textfield

-readonly => 0/1

Default value: 0

Text can't be changed.

Applies to: RichEdit, Textfield

-root => PATH or CONSTANT

The root directory for browsing; this can be either a path or one of the CSIDL_* constants for special folders (see the Win32::FileOp module by Jenda for a list of such constants).

Applies to: BrowseForFolder()

-size => [ X, Y ]

Defines the size for the window; note that X and Y must be passed in an array reference, eg:

-size => [ 100, 100 ],    # correct
-size =>   100, 100,      # WRONG
-size => @coords,         # WRONG
-size => \@coors,         # correct

See also: "-width", "-height"

Applies to: Animation, Button, Checkbox, Combobox, ComboboxEx, DateTime, DialogBox, Graphic, Groupbox, Header, Label, Listbox, ListView, ProgressBar, RadioButton, Rebar, RichEdit, Slider, Splitter, StatusBar, TabStrip, Textfield, TreeView, UpDown, Window

-smooth => 0/1

Default value: 0

Uses a smooth bar instead of the default segmented bar.

Applies to: ProgressBar

-sunken => 0/1

Default value: 0

Draws a half-sunken border around the control.

Applies to: Label

-text => STRING

The text that will appear in the control or item.

Applies to: Animation, Button, Checkbox, Combobox, ComboboxEx, DateTime, DialogBox, Graphic, Groupbox, Header, Label, Listbox, ListView, ProgressBar, RadioButton, Rebar, RichEdit, Slider, Splitter, StatusBar, TabStrip, Textfield, Toolbar, TreeView, UpDown, Window, InsertBand()

-tip => STRING

The text that will appear as tooltip when the mouse is on the NotifyIcon.

Applies to: NotifyIcon

-title => STRING

The title for the window or dialog box.

Applies to: DialogBox, Window, BrowseForFolder(), GetOpenFileName()

-topmost => 0/1

Default value: 0

The window "stays on top" even when deactivated.

Applies to: DialogBox, Window

-transparent => 0/1

Default value: 0

Draws the animation using a transparent background.

Applies to: Animation

-truncate => 0/1/word/path

Default value: 0

Specifies how the text is to be truncated:

       0	the text is not truncated
       1	the text is truncated at the end.
    word	the text is truncated at the end of a word.
    path	the text is truncated before the last "\" 
            (used to shorten paths).

NOTE: this style does not seem to be working.

Applies to: Label

-valign => top/center/bottom

Default value: center

Defines the vertical alignment for the text in the Button.

Applies to: Button, CheckBox, RadioButton

-wrap => 0/1

Default value: 1 for Label, 0 for UpDown

For Labels, the text wraps automatically to a new line. For UpDown controls, the counter wraps when it reaches the lower or upper limit.

Applies to: Label, UpDown