Window style

style = flags

The following flags are available for use with windows:

WS_INVISIBLE

Create invisible. The show command is used to make the window visible, creating it if necessary. The default is for windows to be created visible.

WS_DISABLED

Create disabled. If a window is disabled, the objects inside it are effectively disabled themselves, and no events can occur within the window. However, this is not the same as individually disabling them. When the window is re-enabled, the objects retain their own enabled/disabled status. The default is for a window to be created enabled.

WS_MAXBUTTON

Create with a maximise button. The maximise button is located at the top right of the window and toggles the window between its maximum size and viewing size. If this style or WS_MINBUTTON is assigned to a window, the window has a maximise button, a minimise button and a close button, though buttons not assigned by style flags are disabled.

WS_MINBUTTON

Create with a minimise button. The minimise button is located at the top right of the window next to the maximise button and, when selected, iconises the window.

WS_MAXIMISED

Create the window maximised. This is the default.

WS_MINIMISED

Create the window minimised.

WS_CLOSEBUTTON

Create with a close button. The event EV_CLOSE is generated when the user clicks on the button. Unless the window has the flag WS_HOTWINDOW assigned, this is only effective during a dialog.

Note that if the user presses the task window’s close button and sys.Interrupts is set to ON, the program calls the on interrupt function or subroutine if defined. If none is defined, the task window’s event function is called with the event code EV_CLOSE. If the task window has no event function defined, the program terminates.

WS_HSCROLL

Create with a horizontal scroll bar. For use with windows whose max_width differs from their min_width. Window scroll bar clauses are available to retrieve or update a scroll bar’s position.

WS_VSCROLL

Create with a vertical scroll bar. For use with windows whose max_height differs from their min_height.

WS_NORESIZE

This flag indicates that the window may not be resized by the user at run time.

WS_CAPTION

Create with a caption bar at the bottom of the window. This flag can only be used with top-level windows. If it is not set, a caption bar is created the first time it is needed; i.e. a caption command is executed in the window, or a window control help caption is displayed.

WS_OWNED

This flag is for use with windows which have a parent window (assigned by means of the parent = clause). If such a window has WS_OWNED assigned, it may, unlike other child windows, be moved outside the borders of the parent window. It does however always remain on top of its parent. An owned window does not move when its parent is moved, and its co-ordinates are relative to the screen, not to the parent. An owned window does not appear on the task bar.

If a window has no parent, this flag is ignored.

In programs compiled with scc 5.5 or later, a menu defined in a child window with style WS_OWNED appears in the child window. Previously it appeared in the parent. The command !compat childmenu is available to force the old behaviour. See also Hierarchy of windows.

In programs compiled with scc 5.6.2 RC2 or later, a modal dialog on a window (dialog window_id) excludes all child windows with the style WS_OWNED from that dialog. The command !compat owned is available to force the old behaviour.

WS_CONTAINER

This flag must be assigned to any window which is the parent of an OLE control.

WS_HOTWINDOW

If a window is assigned this flag, it can be closed by a click on its close button even if a dialog is not currently active.

WS_DROPTARGET

Indicates that objects can be dropped in the window. See Drag and drop and the clipboard.

WS_INDENT

Indented border. Gives the window a sunken appearance.

WS_PLAIN

Gives the window a plain line as a border, with no title bar (child windows only). Under character windows a plain border is the default for all windows, and the title is displayed in the top border.

WS_STANDOUT

Standout border. This is the default.


Tab control windows only

WS_TABCONTROL

Defines a window as a tab control window.

WS_FIXEDWIDTH

Makes all tabs the same width regardless of the length of the tab text.

WS_MULTILINE

Causes the tabs to be displayed on multiple lines if they do not fit on a single line.

WS_LJT

Left justifies the labels on the tabs (the default is to centre them.) This flag is ignored unless WS_FIXEDWIDTH is also specified.

WS_RJTABS

Right justifies the tabs within the control window. See Tab control windows.

Default: If the style = clause is omitted, or set to 0, no flags are set.


EXAMPLES

style = WS_CLOSEBUTTON
style = WS_MAXBUTTON | WS_MINBUTTON | WS_NORESIZE
style = WS_TABCONTROL | WS_RJTABS

RELATED TOPICS

Windows

Style flags


Illustrations of style flags

The windows illustrated below are identical except that different style flags have been used.

  1. No style flags

image0

  1. WS_MINBUTTON, WS_MAXBUTTON and WS_CLOSEBUTTON

image1

  1. WS_HSCROLL, WS_VSCROLL and WS_CLOSEBUTTON

image2

  1. WS_CAPTION and WS_CLOSEBUTTON

image3