App Class |
Namespace: VO
The App type exposes the following members.
Name | Description | |
---|---|---|
Destroy | Free memory resources allocated for a VObject object and its derived objects. (Inherited from VObject.) | |
Exec |
Start the event handling loop for the application.
| |
GetAccel | This method returns the handle for the current active Accelerator Table. | |
GetAccelWindow | This method gets the handle to the window for which accelerators must be translated. | |
GetDialogWindow | This method gets the handle active Dialog window for which Dialog keys must be handled | |
GetMdiClientWindow | This method gets the handle to the MDI Clientwindow on the active ShellWindow. | |
Handle |
Return the handle for an application.
| |
Quit |
Terminate the application by instructing the application to close itself.
| |
Run |
Invoke and execute a specified command.
| |
SetAccel | This method sets the handle for the current active Accelerator Table (belonging to the active menu). | |
SetAccelWindow | This method sets the window for which accelerators must be translated. | |
SetDialogWindow | This method sets the handle active Dialog window for which Dialog keys must be handled | |
SetMdiClientWindow | This method sets the handle to the MDI Clientwindow on the active ShellWindow. |
1DEFINE IDM_MYMENU := "MyMenu" 2DEFINE IDM_MYMENU_CLOCK_ID := 1000 3DEFINE IDM_MYMENU_GETHANDLE_ID := 1001 4DEFINE IDM_MYMENU_QUIT_ID := 1002 5FUNCTION Start as VOID 6LOCAL oApp as XApp 7oApp := XApp{} 8oApp:Start() 9RETURN 10 11CLASS XApp INHERIT APP 12METHOD Start() 13LOCAL oWin AS Window 14oWin := MyTopAppWin{SELF} 15oWin:Show() 16SELF:Exec() 17RETURN NIL 18 19END CLASS 20 21CLASS MyTopAppWin INHERIT TopAppWindow 22 23CONSTRUCTOR(oOwnerApp) 24LOCAL lRetVal AS LONG 25SUPER(oOwnerApp) 26SELF:Menu := MyMenu{SELF} 27lRetVal := oOwnerApp:Run("Clock") 28SELF:Caption := "My Top App Window Application" 29SELF:WarningMessage("The return value of running CLOCK is :" +AsString(lRetVal)) 30RETURN 31 32METHOD GetClock() 33SELF:Owner:Run("Clock") 34RETURN NIL 35 36METHOD GetHandle() 37SELF:WarningMessage("The handle of this app is :"+AsString(SELF:Handle())) 38RETURN NIL 39 40METHOD GoQuit() 41SELF:Owner:Quit() 42RETURN NIL 43END CLASS 44 45CLASS MyMenu INHERIT Menu 46CONSTRUCTOR(oOwner) 47SUPER(ResourceID{IDM_MYMENU}) 48SELF:RegisterItem(IDM_MYMENU_CLOCK_ID, HyperLabel{#GetClock,,,}) 49SELF:RegisterItem(IDM_MYMENU_GETHANDLE_ID, HyperLabel{#GetHandle,,,}) 50SELF:RegisterItem(IDM_MYMENU_QUIT_ID, HyperLabel{#GoQuit,,,}) 51END CLASS 52RESOURCE IDM_MYMENU MENU 53BEGIN 54POPUP "&Menu1" 55BEGIN 56MENUITEM "&Clock", IDM_MYMENU_CLOCK_ID 57MENUITEM "&Get App Handle", IDM_MYMENU_GETHANDLE_ID 58MENUITEM SEPARATOR 59MENUITEM "&QUIT", IDM_MYMENU_QUIT_ID 60END 61END