Window Styles

From WxPerl wiki

Jump to: navigation, search

Window Styles are constants, exported by Wx.pm, that can be passed to the Wx::Frame constructor to control various aspects of the new window's appearance and behavior.

Importing

These symbols are exported by Wx.pm; thus you must ask Wx.pm to import them into your namespace when you use the Wx module. For example:

use Wx qw(wxMAXIMIZE_BOX wxCLOSE_BOX);

As a convenience, at the expense of startup time and memory, you can import all symbols at once:

use Wx qw(:everything);

Note that this imports many more symbols besides the Window Style symbols, and also all modules in the Wx namespace.

Constants

The following Window Style constants are available. To combine more than one style, join them together with the Perl binary-or operator ( | ).

  • wxDEFAULT_FRAME_STYLE -- Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN.
  • wxICONIZE -- Display the frame iconized (minimized). Windows only.
  • wxCAPTION -- Puts a caption on the frame.
  • wxMINIMIZE -- Identical to wxICONIZE. Windows only.
  • wxMINIMIZE_BOX -- Displays a minimize box on the frame.
  • wxMAXIMIZE -- Displays the frame maximized. Windows only.
  • wxMAXIMIZE_BOX -- Displays a maximize box on the frame.
  • wxCLOSE_BOX -- Displays a close box on the frame.
  • wxSTAY_ON_TOP -- Stay on top of all other windows, see also wxFRAME_FLOAT_ON_PARENT.
  • wxSYSTEM_MENU -- Displays a system menu.
  • wxRESIZE_BORDER -- Displays a resizeable border around the window.
  • wxFRAME_TOOL_WINDOW -- Causes a frame with a small titlebar to be created; the frame does not appear in the taskbar under Windows or GTK+.
  • wxFRAME_NO_TASKBAR -- Creates an otherwise normal frame but it does not appear in the taskbar under Windows or GTK+ (note that it will minimize to the desktop window under Windows which may seem strange to the users and thus it might be better to use this style only without wxMINIMIZE_BOX style). In wxGTK, the flag is respected only if GTK+ is at least version 2.2 and the window manager supports _NET_WM_STATE_SKIP_TASKBAR hint. Has no effect under other platforms.
  • wxFRAME_FLOAT_ON_PARENT -- The frame will always be on top of its parent (unlike wxSTAY_ON_TOP). A frame created with this style must have a non-NULL parent.
  • wxFRAME_EX_CONTEXTHELP -- Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send a wxEVT_HELP event if the user clicked on an application window. Note that this is an extended style and must be set by calling SetExtraStyle before Create is called (two-step construction). You cannot use this style together with wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so you should use wxDEFAULT_FRAME_STYLE & ~ (wxMINIMIZE_BOX | wxMAXIMIZE_BOX) for the frames having this style (the dialogs don't have a minimize or a maximize box by default)
  • wxFRAME_SHAPED -- Windows with this style are allowed to have their shape changed with the SetShape method.
  • wxFRAME_EX_METAL -- On Mac OS X, frames with this style will be shown with a metallic look. This is an extra style.

See Also

Wx

C++-oriented documentation

Personal tools
Google AdSense