DEFINE WINDOW
Creates a Window Definition

 

 

 

Standard Syntax (xBase Style):

 

 

      DEFINE WINDOW <WindowName>

            AT <nRow> ,<nCol>

            WIDTH <nWindth>

            HEIGHT <nHeight>

            [ VIRTUAL WIDTH <nVirtualWindth> ]

            [ VIRTUAL HEIGHT <nVirtualHeight> ]

            [ TITLE <cTitle> ]

            [ ICON <cIconName> ]

            [ MAIN | CHILD | MODAL | SPLITCHILD ]

            [ NOSHOW ]

            [ TOPMOST ]

            [ NOAUTORELEASE ]

            [ NOMINIMIZE ]

            [ NOMAXIMIZE ]

            [ NOSIZE ]

            [ NOSYSMENU ]

            [ NOCAPTION ]

            [ 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> ]

            [ FONT <cFontName> SIZE <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 ] 

            [ GRIPPERTEXT <cGripperText> ]

            [ BREAK ]

            [ FOCUSED ]

            ... Control Definitions...

 

      END WINDOW

 

 

Alternate Syntax:

 

 

      DEFINE WINDOW <WindowName>

            ROW <nRow>

            COL <nCol>

            WIDTH <nWindth>

            HEIGHT <nHeight>

            WINDOWTYPE MAIN | CHILD | MODAL | SPLITCHILD | STANDARD

            [ VIRTUAL WIDTH <nVirtualWindth> ]

            [ VIRTUAL HEIGHT <nVirtualHeight> ]

            [ TITLE <cTitle> ]

            [ ICON <cIconName> ]

            [ 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

      - Col

      - Width

      - Height

      - Title

      - NotifyIcon

      - NotifyTooltip

      - FocusedControl (R)

      - Cursor (W)

      - VirtualWidth (D)

      - VirtualHeight (D)

      - Icon (R)

      - WindowType (D)

      - Visible (D)

      - AutoRelease (D)

      - MinButton (D)

      - MaxButton (D)

      - Sizable (D)

      - SysMenu (D)

      - TitleBar (D)

      - BackColor (D)

      - FontName (D)

      - FontSize (D)

      - HelpButton (D)

      - GripperText (D)

      - Break (D)

      - Focused (D)

      - Topmost (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

      - Print

      - Show

      - Hide

      - Center

      - Maximize

      - Minimize

      - Activate

      - Restore

      - Release

      - SetFocus

 

 

Window Events:

 

 

-    OnInit

-    OnRelease

-    OnInteractiveClose

-    OnMouseClick

-    OnMouseDrag

-    OnMouseMove

-    OnSize

-    OnMaximize

-    OnMinimize

-    OnPaint

-    OnNotifyClick

-    OnGotFocus

-    OnLostFocus

-    OnScrollUp

-    OnScrollDown

-    OnScrollLeft

-    OnScrollRight

-    OnHscrollBox

-    OnVscrollBox

 

 

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