DEFINE WINDOW
Creates a Window Definition
Syntax:
DEFINE WINDOW <WindowName>
ROW <nRow>
COL <nCol>
WIDTH <nWindth>
HEIGHT <nHeight>
[ VIRTUAL WIDTH <nVirtualWindth> ]
[ VIRTUAL HEIGHT <nVirtualHeight> ]
[ TITLE <cTitle> ]
[ ICON <cIconName> ]
WINDOWTYPE MAIN | CHILD | MODAL | SPLITCHILD | STANDARD
[ VISIBLE <lValue> ]
[ TOPMOST [<lValue>] ]
[ AUTORELEASE <lValue> ]
[ MINBUTTON <lvalue> ]
[ MAXBUTTON <lValue> ]
[ SIZABLE <lValue> ]
[ SYSMENU <lValue> ]
[ TITLEBAR <lValue> ]
[ CURSOR <CursorName> ]
[ ON INIT <InitProcedureName> | <bBlock> ]
[ ON RELEASE <ReleaseProcedureName> | <bBlock> ]
[ ON INTERACTIVECLOSE <InteractiveCloseProcedureName> | <bBlock> ]
[ ON MOUSECLICK <MouseClickProcedureName> | <bBlock> ]
[ ON MOUSEDRAG <MouseDragProcedureName> | <bBlock> ]
[ ON MOUSEMOVE <MouseMoveProcedureName> | <bBlock> ]
[ ON SIZE <WindowSizeProcedureName> | <bBlock> ]
[ ON MAXIMIZE <WindowMaximizeProcedureName> | <bBlock> ]
[ ON MINIMIZE <WindowMinimizeProcedureName> | <bBlock> ]
[ ON PAINT<WindowPaintProcedureName> | <bBlock> ]
[ BACKCOLOR <anBackColor> ]
[ FONTNAME <cFontName> FONTSIZE <nFontSize> ]
[ NOTIFYICON <cNotifyIconName> ]
[ NOTIFYTOOLTIP <cNotifyTooltip> ]
[ ON NOTIFYCLICK <NotifyClickProcedure> | <bBlock> ]
[ ON GOTFOCUS <ProcedureName> | <bBlock> ]
[ ON LOSTFOCUS <ProcedureName> | <bBlock> ]
[ ON SCROLLUP <ProcedureName> | <bBlock> ]
[ ON SCROLLDOWN <ProcedureName> | <bBlock> ]
[ ON SCROLLLEFT <ProcedureName> | <bBlock> ]
[ ON SCROLLRIGHT <ProcedureName> | <bBlock> ]
[ ON HSCROLLBOX <ProcedureName> | <bBlock> ]
[ ON VSCROLLBOX <ProcedureName> | <bBlock> ]
[ HELPBUTTON <lValue> ]
[ GRIPPERTEXT <cGripperText> ]
[ BREAK lValue ]
[ FOCUSED <lValue> ]
... Control Definitions...
END WINDOW
Focused, Break and GripperText properties are available only for 'SplitChild' type windows.
Topmost property is not available for modal and spltchild type windows.
Properties:
- Row (At Clause)
- Col (At Clause)
- Width
- Height
- Title
- FocusedControl (R)
- Cursor (W)
- VirtualWidth (D)
- VirtualHeight (D)
- Icon (R)
- WindowType (Main/Modal/Child/SpltChild/Standard Clauses) (D)
- Visible (NoShow Clause) (D)
- AutoRelease (NoAutoRelease Clause) (D)
- MinButton (NoMinimize Clause)(D)
- MaxButton (NoMaximize Clause) (D)
- Sizable (NoSize Clause) (D)
- SysMenu (NoSysMenu Clause) (D)
- TitleBar (NoCaption Clause) (D)
- BackColor (D)
- FontName (Font Clause) (D)
- FontSize (Size Clause) (D)
- HelpButton (HelpButton Clause) (D)
- GripperText (D)
- Break (Break Clause) (D)
- Focused (Focused Clause) (D)
- Topmost (Topmost Clause) (D)
- Name (R)
R: Read-Only (available after control definition via GetProperty function or semi-oop syntax)
W: Write-Only (available after control definition via SetProperty function or semi-oop syntax)
D: Available at definition only
Properties not tagged are available for read and write after control definition via SetProperty and GetProperty functions or semi-oop syntax.
Methods:
- Capture
- Show
- Hide
- Center
- Maximize
- Minimize
- Activate
- Restore
- Release
- SetFocus
Window Events:
- OnInit
- OnSize
- OnPaint
Tips:
- SplitChild windows can be defined as part of a splitbox only.
- Toolbar's & SplitBox's parent window can't be a 'Virtual Dimensioned'
window (use 'Virtual Dimensioned' splitchild's instead)
- NoAutoRelease Style: When this style is used, windows are hide
instead released from memory when the user clicks in the close box.
Using "Activate Window All" command at program startup will force
"NoAutoRelease" style for all windows (excepting main).
You must use "Show" and "Hide" methods to make a window visible or
invisible.
- For virtual dimensioned Windows, two predefined controls are available.
These controls are called ‘vScrollBar’ and ‘hScrollBar’.
‘Value’ property (read only) is available for these controls.
Sample:
#include "minigui.ch"
Function Main
SET AUTOSCROLL ON
DEFINE WINDOW Form_Main ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 480 ;
VIRTUAL WIDTH 1300 ;
VIRTUAL HEIGHT 800 ;
TITLE 'Virtual Dimensioned Window Demo' ;
MAIN
@ 100,10 BUTTON Button_1 ;
CAPTION 'Vert. ScrollBar Value' ;
ACTION MsgInfo( Str ( Form_Main.VScrollBar.Value ) ) ;
WIDTH 150 HEIGHT 25
@ 200,10 BUTTON Button_2 ;
CAPTION 'Horiz. ScrollBar Value' ;
ACTION MsgInfo( Str ( Form_Main.HScrollBar.Value ) ) ;
WIDTH 150 HEIGHT 25
END WINDOW
ACTIVATE WINDOW Form_Main
Return Nil