WINDOW Mnemonic - Create a SYSGUI Window

Syntax

'WINDOW'(x,y,w,h,title,flags{,eventmask})

Description

For BBj-specific information, see the WINDOW Mnemonic - Create SYSGUI Window BBj.

The 'WINDOW' mnemonic creates a SYSGUI window.

Parameter

Description

x

Horizontal position of the upper-left corner of the window in current units.

y

Vertical position of the upper-left corner of the window in current units. This value does not take into account the space taken by menus or title bars. If a window is defined with a menu and a title bar and its y parameter is set to zero, the menu and title bar will not be visible when a VPRO/5 program displays the window. The y parameter should be adjusted by 20 pixels to account for a menu and 20 pixels for a title bar. For example, if a window has a menu and a title bar and the y parameter is set to 60, the top of the title bar will appear 20 pixels from the top of the screen when a VPRO/5 program displays the window.

w

Width of the window in current units.

h

Height of the window in current units.

title

Window title. This is the initial title and can be changed at any time with the 'TITLE' mnemonic.

flags

Window flags, as follows:

 

Flag

Description

 

$00000001$

Allows the window to be resized.

 

$00000002$

Enables the close box on the window frame. On some platforms, the close box may not appear on the frame if this option is not set

 

$00000004$

Causes a horizontal scroll bar to appear whenever the window is resized to be smaller than its initial size and 'TRACK'(0) is specified.

 

$00000008$

Causes a vertical scroll bar to appear whenever the window is resized to be smaller than its initial size and 'TRACK'(0) is specified.

 

$00000010$

Sets the window to be initially invisible.

 

$00000020$

Sets the window to be initially disabled.

 

$00000080$

Allows the window to be maximized or minimized.

 

$00000100$

Sets the window to be initially minimized.

 

$00000800$

Include menu bar. Creates a menu bar.

 

$00001000$

Sets the window to be initially maximized.

 

$00002000$

Prevents the separator line between the menu and client area of a window from being drawn.

 

$00010000$

Activates keyboard navigation in the window.

 

$00020000$

Always positions the window on top of other windows.

 

$00040000$

Creates a border around the dialog.

 

$00080000$

Sets the window to behave as a dialog.

 

$00100000$

Automatically arranges all controls and child windows placed in the window to fit.

 

$00400000$

Allows use of a custom color palette. This provides a more accurate display of colors in bitmapped images.

 

$00800000$

Sets the Enter key to behave as a Tab key.

 

$01000000$

Creates the window without a title bar.

 

$04000000$

Sets the window to automatically manage SYSCOLOR events.

 

$20000000$

Causes Visual PRO/5 to report the mouse's right button down event.

eventmask

Event masks to be applied to the window:

 

$80000000$

User changed system colors

 

$40000000$

Window activation

 

$20000000$

Right mouse button down

 

$02000000$

Check or uncheck or check box or radio button.

 

$01000000$

Click or double click on list item. 

 

None – Always sent

Close box operated.

 

$00400000$

Edit or list edit modified.

 

$00800000$

Edit, list edit, or text edit focus change.

 

$00000400$

Key pressed.

 

None – Always sent

Menu selection made.

 

$00000200$

Mouse button double click.

 

 

 

 

$00000040$

Mouse button down.

 

$00000080$

Mouse button up.

 

$00000100$

Mouse moved.

 

None – Always sent

Push button operated.

 

$00100000$

Scroll bar position changed.

 

None – Always sent

Tool button operated.

 

$00000008$

Window resized.

 

$00000004$

Window focus change.

 

None – Always sent

Popup Menu Selection.

 

Event

Code

Activation

A

Push Button

B

Check/Uncheck

c

Control Focus Gained/Lost

f

Edit Control Modify

e

Keypress

t

List Item Click

l (lower case L)

Menu Selection

C

Mouse Enter/Exit

E

Mouse Scroll Wheel

w

Mouse Button Down

d

Mouse Button Up

u

Mouse Double-Click

2

Mouse Move

m

Notify

N

Right Mouse Button Down

R

Scrollbar Move

p

System Color Change

s

Tool Button Push

b

Window Close Box

X

Window Focus Gained/Lost

F

Window Resize

S

The x,y,w,h bounding rectangle of a window describes the location of the inside (the usable drawing area or client area) of the window. Note that if a window is placed at (0,0), the title bar will not be visible.

Any window can be moved or resized with the 'MOVE' and 'SIZE' mnemonics. The user can also move any window at any time. The current location is always available with the CTRL() function. If the "user-sizeable" flag is used, the user can also change the size of the window at any time. This can have other side effects, such as adding scroll bars or rescaling a drawing.

Note that by using certain flags, 'WINDOW' can also create a dialog box.

Not all combinations of these flags are valid, but most are acceptable. "Modal dialog style border" precludes all window attributes except scroll bars. This means that the "User sizeable," "Has a close box," "Minimizable/Maximizable," "Initially minimized," "Has menu bar," and "Initially maximized" flags do not work with the "Modal dialog style border" flag.

Historical Color Palette

Under Visual PRO/5 Revision 1.0, all SYSGUI windows automatically received a custom "color cube" palette to accurately display colors in bitmapped images. However, this leads to two problems:

  • Microsoft's WIN32s products, Windows and Windows for Workgroups, can stop responding if focus is repeatedly shifted between windows, forcing many rapid palette changes.
  • Colors in controls, which are always rendered in the stock system palette, often do not exactly match the colors in the window. For example, an attempt to create a light gray "3-D look" dialog box could create mismatched colors on some systems.

As a result, the custom "color cube" palette is now optional, and by default is not used. In Visual PRO/5 Revision 1.01, SYSGUI windows normally inherit the stock system palette. If you display photographic bitmaps and would like to use the custom "color cube" palette as before for better color accuracy, you must use the window creation flag $00400000$.

Whenever a SYSGUI window with a custom palette gains focus and the display has 256 colors or fewer, some color "flashing" may occur as focus shifts between windows. This is normal and can occur with other applications that require accurate color displays. If flashing becomes a problem, use a display mode that permits more than 256 colors (usually 65,536 colors or 16M colors), a simple wallpaper, or no wallpaper.

See Also

Mnemonics - Alphabetical Listing

Mnemonics - Group Listing