Navigation: Language Reference > 6 - Windows >====== APPLICATION (declare an MDI frame window) ====== | |
label | APPLICATION('title') | [,AT( )] [,CENTER] [,SYSTEM] [,MAX] [,ICON( )] [,STATUS( )] [,HLP( )] | |||||||||
[,CURSOR( )] [,TIMER( )] [,ALRT( )] [,ICONIZE] [,MAXIMIZE] [,MASK] | |||||||||||
[,FONT( )] [,MSG( )] [,IMM] [,AUTO] [,PALETTE()] [,LAYOUT( )] | |||||||||||
[,WALLPAPER( )] | [, | TILED | ] | [, | HSCROLL | ] | [, | DOUBLE | ] | ||
CENTERED | VSCROLL | NOFRAME | |||||||||
HVSCROLL | RESIZE |
[ MENUBAR | |
multiple menu and/or item declarations | |
END ] | |
[ TOOLBAR | |
multiple control field declarations | |
END ] | |
END |
APPLICATION | Declares a Multiple Document Interface (MDI) frame. |
Label | A valid Clarion label (required). |
Title | Specifies the title text for the application window (PROP:Text). |
AT | Specifies the initial size and location of the application window (PROP:AT). If omitted, default values are selected by the runtime library. |
CENTER | Specifies that the window's initial position is centered in the screen by default (PROP:CENTER). This attribute takes effect only if at least one parameter of the AT attribute is omitted. |
SYSTEM | Specifies the presence of a system menu (PROP:SYSTEM). |
MAX | Specifies the presence of a maximize control (PROP:MAX). |
ICON | Specifies the presence of a minimize control, and names a file or standard icon identifier for the icon displayed when the window is minimized (PROP:ICON). |
STATUS | Specifies the presence of a status bar at the base of the application window (PROP:STATUS). |
HLP | Specifies the “Help ID” associated with the APPLICATION window and provides the default for any child windows (PROP:HLP). |
CURSOR | Specifies a mouse cursor to be displayed when the mouse is positioned over the APPLICATION window (PROP:CURSOR). If omitted, the Windows default cursor is used. |
TIMER | Specifies periodic timed event generation (PROP:TIMER). |
ALRT | Specifies “hot” keys active for the APPLICATION (PROP:ALRT). |
ICONIZE | Specifies the APPLICATION is opened as an icon (PROP:ICONIZE). |
MAXIMIZE | Specifies the APPLICATION is maximized when opened (PROP:MAXIMIZE). |
MASK | Specifies pattern input editing mode of all ENTRY controls in the TOOLBAR (PROP:MASK). |
FONT | Specifies the default font for all controls in the toolbar (PROP:FONT). |
MSG | Specifies a string constant containing the default text to display in the status bar for all controls in the APPLICATION (PROP:MSG). |
IMM | Specifies the window generates events whenever it is moved or resized (PROP:IMM). |
AUTO | Specifies all toolbar controls' USE variables re-display on screen each time through the ACCEPT loop (PROP:AUTO). |
PALETTE | Specifies the number of hardware colors used for graphics in the window (PROP:PALETTE). |
LAYOUT | Indicates the orientation of window controls and field sequence. A style of (1) essentially “flips” the window controls' display as a mirror image of the layout specified in the Window Formatter. Default field navigation moves from right to left. |
WALLPAPER | Specifies the background image to display in the window's client area (PROP:WALLPAPER). The image stretches to fill the entire client area of the window unless the TILED or CENTERED attribute is also present. |
TILED | Specifies the WALLPAPER image displays at its default size and is tiled to fill the entire client area of the window (PROP:TILED). |
CENTERED | Specifies the WALLPAPER image displays at its default size and is centered in the entire client area of the window (PROP:CENTERED). |
HSCROLL | Specifies a horizontal scroll bar is automatically added to the application frame when any portion of a child window lies horizontally outside the visible area (PROP:FSCROLL). |
VSCROLL | Specifies a vertical scroll bar is automatically added to the application frame when any portion of a child window lies vertically outside the visible area (PROP:VSCROLL). |
HVSCROLL | Specifies both vertical and horizontal scroll bars are automatically added to the application frame when any portion of a child window lies outside the visible area. |
DOUBLE | Specifies a double-width frame around the window (PROP:DOUBLE). |
NOFRAME | Specifies a window with no frame (PROP:NOFRAME). |
RESIZE | Specifies a thick frame around the window which does allow window resizing (PROP:RESIZE). |
MENUBAR | Defines the menu structure (optional). The menu specified in an APPLICATION is the “Global menu.” |
TOOLBAR | Defines a toolbar structure (optional). The toolbar specified in an APPLICATION is the “Global toolbar.” |
APPLICATION declares a Multiple Document Interface (MDI) frame window. MDI is a part of the standard Windows interface, and is used by Windows applications to present several “views” in different windows. This is a way of organizing and grouping these. The MDI frame window (APPLICATION structure) acts as a “parent” for all the MDI “child” windows (WINDOW structures with the MDI attribute). These MDI “child” windows are clipped to the APPLICATION frame and automatically moved when the frame is moved, and can be totally concealed by minimizing the parent.
There may be only one APPLICATION window open at any time in a Clarion Windows program, and it must be opened before any MDI “child” windows may be opened. However, non-MDI windows may be opened before or after the APPLICATION is opened, and may be on the same execution thread as the APPLICATION.
An MDI “child” window must not be on the same execution thread as the APPLICATION. Therefore, any MDI “child” window called directly from the APPLICATION must be in a separate procedure so the START procedure can be used to begin a new execution thread. Once started, multiple MDI “child” windows may be called in the new thread.
A “conventional” APPLICATION window would have the ICON, MAX, STATUS, RESIZE, and SYSTEM attributes. This creates an application frame window with minimize and maximize buttons, a status bar, a resizable frame, and a system menu. It would also have a MENUBAR structure containing the global menu items, and may have a TOOLBAR with “shortcuts” to global menu items. These attributes create a standard Windows look and feel for the application frame.
An APPLICATION window may not contain controls except within its MENUBAR and TOOLBAR structures, and cannot be used for any output. For output, document windows or dialog boxes are required (defined using the WINDOW structure).
When the APPLICATION window is first opened, it remains hidden until the first DISPLAY statement or ACCEPT loop is encountered. This enables any changes to be made to the appearance before it is displayed. Events for the APPLICATION window are processed by the first ACCEPT loop encountered after the APPLICATION window is first opened.
Events Generated:
EVENT:PreAlertKey | The user pressed an ALRT attribute hot key. |
EVENT:AlertKey | The user pressed an ALRT attribute hot key. |
EVENT:CloseWindow | The window is closing. |
EVENT:CloseDown | The application is closing. |
EVENT:OpenWindow | The window is opening. |
EVENT:LoseFocus | The window is losing focus to another thread. |
EVENT:GainFocus | The window is gaining focus from another thread. |
EVENT:Timer | The TIMER attribute has triggered. |
EVENT:Move | The user is moving the window. CYCLE aborts the move. |
EVENT:Moved | The user has moved the window. |
EVENT:Size | The user is resizing the window. CYCLE aborts the resize. |
EVENT:Sized | The user has resized the window. |
EVENT:Restore | The user is restoring the window's previous size. CYCLE aborts the resize. |
EVENT:Restored | The user has restored the window's previous size. |
EVENT:Maximize | The user is maximizing the window. CYCLE aborts the resize. |
EVENT:Maximized | The user has maximized the window. |
EVENT:Iconize | The user is minimizing the window. CYCLE aborts the resize. |
EVENT:Iconized | The user has minimized the window. |
EVENT:Completed | AcceptAll (non-stop) mode has finished processing all the window's controls. |
EVENT:DDErequest | A client has requested a data item from this Clarion DDE server application. |
EVENT:DDEadvise | A client has requested continuous updates of a data item from this Clarion DDE server application. |
EVENT:DDEexecute | A client has executed a DDEEXECUTE statement to this Clarion DDE server application. |
EVENT:DDEpoke | A client has sent unsolicited data to this Clarion DDE server application. |
EVENT:DDEdata | A DDE server has supplied an updated data item to this Clarion client application. |
EVENT:DDEclosed | A DDE server has terminated the DDE link to this Clarion client application. |
Related Procedures:
ACCEPT, ALERT, EVENT, POST, REGISTER, UNREGISTER, YIELD, ACCEPTED, CHANGE, CHOICE, CLOSE, CONTENTS, CREATE, DESTROY, DISABLE, DISPLAY, ENABLE, ERASE, FIELD, FIRSTFIELD, FOCUS, GETFONT, GETPOSITION, HELP, HIDE, INCOMPLETE, LASTFIELD, MESSAGE, MOUSEX, MOUSEY, OPEN, POPUP, SELECT, SELECTED, SET3DLOOK, SETCURSOR, SETFONT, SETPOSITION, SETTARGET, UNHIDE, UPDATE
Example:
!An MDI application frame window with system menu, minimize and maximize
! buttons, a status bar, scroll bars, and a resizable frame, containing the
! main menu and toolbar for the application:
MainWin APPLICATION('My Application'),SYSTEM,MAX,ICON('MyIcon.ICO'),STATUS |
,HVSCROLL,RESIZE
MENUBAR
MENU('&File'),USE(?FileMenu)
ITEM('&Open…'),USE(?OpenFile)
ITEM('&Close'),USE(?CloseFile),DISABLE
ITEM('E&xit'),USE(?MainExit)
END
MENU('&Edit'),USE(?EditMenu)
ITEM('Cu&t'),USE(?CutText),KEY(CtrlX),STD(STD:Cut),DISABLE
ITEM('&Copy'),USE(?CopyText),KEY(CtrlC),STD(STD:Copy),DISABLE
ITEM('&Paste'),USE(?PasteText),KEY(CtrlV),STD(STD:Paste),DISABLE
END
MENU('&Window'),STD(STD:WindowList),LAST
ITEM('&Tile'),STD(STD:TileWindow)
ITEM('&Cascade'),STD(STD:CascadeWindow)
ITEM('&Arrange Icons'),STD(STD:ArrangeIcons)
END
MENU('&Help'),USE(?HelpMenu)
ITEM('&Contents'),USE(?HelpContents),STD(STD:HelpIndex)
ITEM('&Search…'),USE(?HelpSearch),STD(STD:HelpSearch)
ITEM('&How to Use Help'),USE(?HelpOnHelp),STD(STD:HelpOnHelp)
ITEM('&About MyApp…'),USE(?HelpAbout)
END
END
TOOLBAR
BUTTON('E&xit'),USE(?MainExitButton)
BUTTON('&Open'),USE(?OpenButton),ICON(ICON:Open)
END
END
CODE
OPEN(MainWin) !Open APPLICATION
ACCEPT !Display APPLICATION and accept user input
CASE ACCEPTED() !Which control was chosen?
OF ?OpenFile !Open… menu selection
OROF ?OpenButton !Open button on toolbar
START(OpenFileProc) !Start new execution thread
OF ?MainExit !Exit menu selection
OROF ?MainExitButton !Exit button on toolbar
BREAK !Break ACCEPT loop
OF ?HelpAbout !About… menu selection
HelpAboutProc !Call application information procedure
END
END
CLOSE(MainWin) !Close APPLICATION
See Also: