This page details the options that are common to all
packages, and may be used in most object's new()
and Change()
mthods.
This document illustrates the options available when creating an object (in particular, windows and controls). Here you'll find the general options, the ones that apply to every window class; for class-specific options, refer to that package reference.
Allow the window or control to act as a drop target for files dragged from the shell.
See -pushexstyle
See -pushstyle
Defines the background color for the control. Note that not all controls support background and foreground colors.
See -text
Specifies the window class (which is different from the Perl's object class, eg. Win32::GUI::Button) for the window; all the predefined objects have hardcoded class names (eg. "BUTTON" for Win32::GUI::Button), so you shouldn't want to pick a different one unless you are familiar with window classes and you want to subclass an existing one. This technique is documented in the Microsoft Platform SDK Reference. The CLASS parameter can be either a name or a reference to a Win32::GUI::Class object.
[TBD]
Defines the default cursor for the control; must be a Win32::GUI::Cursor object, or a windows HCURSOR handle.
Sets the initial enabled state for the control; by default this option is 0 (the control is enabled). Set it to 1 to create a control which is initially disabled.
Sets the event model from the window or control. Can be one of the following
values:
"byname" - the default. Set the OEM (old event model) where events cause
callback to the subroutine named OBJECTNAME_EVENTNAME()
"byref" - Set automatically when one of the -on* event handlers is used.
Sets the NEM (new event model) where the -on* option
is used to specify the callback subroutine explicitly.
"both" - Sets both OEM and NEM. USeful if you want to handle one event with the NEM,
and another event with OEM.
[TBD]
Sets the extended style for the window. Use of this option is deprecated. Use -pushexstyle or -popexstyle (or one of their alternatives) instead.
Defines the default font for the control; must be a Win32::GUI::Font object, or a windows HFONT handle.
Defines the foreground color for the control. Note that not all controls support background and foreground colors.
[TBD]
Specifies the height of the window or control in pixels.
[TBD]
[TBD]
Specifies the left position (X coordinate) for the window, in pixels. For Windows and DialogBoxes is absolute (screen position), while for controls is relative to the client area of their parent window.
Specifies a Win32::GUI::Menu object or a Windows HMENU handle for a window menu to be associated with the window. Only top-level windows can display window menus
Defines the name for the window or control. The name is used to callback its events and to access its methods, so it is absolutely necessary when using the OEM. If not supplied, a system generated value will be used. If supplied each name must be unique in your application.
Example:
$Window->AddButton( -name => "Button1", # ... );
# methods... $Window->Button1->Hide();
# events... sub Button1_Click { # ... }
See -popexstyle
See -popstyle
See -popexstyle
See -popstyle
Sets the NEM (new event model) where the subroutine called when an event occurs is explicitly given to this option.
SUB is a subroutine name or a reference to a subroutine.
EVENT is one of the events supported by the window/control. (e.g. 'Click', 'Terminate', ...)
Setting this option prevents this control calling subroutines of the form
OBJECTNAME_EVENTNAME()
- See -eventmodel.
The first parameter passed to the subroutine is a reference to the object on which the event occured.
Eample:
... my $button = Win32::GUI::Button->new( -text = "Click me!", -onClick => sub { print "Button Clicked\n"; }, ); ...
Sets the parent window of the window/control being created. WINDOW must be a Win32::GUI Window or Control object, or a windows HWND handle.
Remove the specified extended styles from the window's extended style mask. This option can be repeated multiple times, or values can be 'or'ed together.
Remove the specified styles from the window's style mask. This option can be repeated multiple times, or values can be 'or'ed together.
Defines the position for the window or control; 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
Add the specified extended styles to the window's extended style mask. This option can be repeated multiple times, or values can be 'or'ed together.
Add the specified styles to the window's style mask. This option can be repeated multiple times, or values can be 'or'ed together.
See -popexstyle
See -popstyle
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
Sets the style for the window. Use of this option is deprecated. Use -pushstyle or -popstyle (or one of their alternatives) instead.
If 1, the control can be enabled by pressing
the TAB key to switch between controls.
Note that this functionality is available
in dialog objects only,
so the control must be child of a DialogBox
or a Window with the -dialogui
option set
for this option to be effective.
Specifies the STRING that will appear on the window's caption or in the control's body (eg. a Label text, a Button caption, a Textfield content, and so on). Its use depends of course on the control type; some controls, like ProgressBars, makes no use of it at all.
STRING specifies the text that will appear in a tooltip when the mouse hovers over the window/control. This option provides a simple, but non-flexible way to add tooltips to windows. For better flexibility see Win32::GUI::Tooltip.
See -text
Specifies the top position (Y coordinate) for the window, in pixels. For Windows and DialogBoxes is absolute (screen position), while for controls is relative to the client area of their parent window.
Sets the visibility of a window/control (and its children).
[TBD]
Specifies the width of the window or control in pixels.
Documentation for Win32::GUI v1.06 created 13 Feb 2008
This document is autogenerated by the build process. Edits made here will be lost. Edit docs/GUI/Reference/Options.pod instead.
Homepage: http://perl-win32-gui.sourceforge.net/.
For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net
) from the website
at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/.
Copyright (c) 1997..2008 Aldo Calpini. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.