
=head2 Win32::GUI Common Options

L<Back to the index|gui/>

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.

=head3 List of available options

=head4 -background => COLOR

Defines the background color for the control.
Note that not all controls support background and foreground
colors.

=head4 -class => CLASS

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, and (at a lighter level) in L<guiclasses.pod>.
The CLASS parameter can be either a name or a reference
to a L<Win32::GUI::Class|Class/> object. 
As for many other options in Win32::GUI, 
its use is B<not recommended> unless 
you know what you're doing.

=head4 -disabled => 0/1

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.

=head4 -font => FONT

Defines the font for the control; must be a Win32::GUI::Font
object.

=head4 -foreground => COLOR

Defines the foreground color for the control.
Note that not all controls support background and foreground
colors.

=head4 -group => 0/1

[TBD]

=head4 -height => NUMBER

Specifies the height of the window in pixels.

=head4 -left => NUMBER

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.

=head4 -menu => MENU

[TBD]

=head4 -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 B<necessary>, and each name must be
unique in your application.

Example:

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

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

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

=head4 -style => NUMBER

[TBD]

=head4 -tabstop => 0/1

If 1, the control can be enabled by pressing
the TAB key to switch between controls.
Note that this functionality is available
in DialogBox objects only, not in Window,
so the control must be child of a DialogBox
for this option to be effective.

=head4 -text => STRING

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.

=head4 -title => STRING

A synonim for L<-text|/_text_STRING>.

=head4 -top => NUMBER

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.

=head4 -visible => 0/1

Sets the initial visibility state for the control; by default
this option is 1 (the control is visible). Set it to 0
to create a control which is initially hidden.

=head4 -width => NUMBER

Specifies the width of the window in pixels.


=cut
