Created
June 7, 2017 12:52
-
-
Save MarkGoldberg/26ffa811a9e9ba52030cafd5e985f5a1 to your computer and use it in GitHub Desktop.
Centering Application Modal Window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM | |
MAP | |
MAIN() | |
BrahnModal() | |
NonMDIChild() | |
END | |
glo:Frame &Window | |
INCLUDE('debuger.inc'),ONCE | |
dbg Debuger | |
CODE | |
dbg.mg_init('Center') | |
MAIN() | |
!====================================== | |
Main PROCEDURE() | |
AppFrame APPLICATION('Application'),AT(,,600,400),CENTER,MASK,SYSTEM,MAX,ICON('WAFRAME.ICO'),STATUS(-1,80,120,45),FONT('Microsoft Sans Serif',8,,FONT:regular),RESIZE | |
MENUBAR,USE(?Menubar) | |
ITEM('NonMDI Child'),USE(?NonMDIChild) | |
ITEM('BrahnModal'),USE(?BrahnModal) | |
MENU('&File'),USE(?FileMenu) | |
ITEM('&Print Setup ...'),USE(?PrintSetup),MSG('Setup printer'),STD(STD:PrintSetup) | |
ITEM(''),SEPARATOR,USE(?SEPARATOR1) | |
ITEM('E&xit'),USE(?Exit),MSG('Exit this application'),STD(STD:Close) | |
END | |
MENU('&Edit'),USE(?EditMenu) | |
ITEM('Cu&t'),USE(?Cut),MSG('Remove item to Windows Clipboard'),STD(STD:Cut) | |
ITEM('&Copy'),USE(?Copy),MSG('Copy item to Windows Clipboard'),STD(STD:Copy) | |
ITEM('&Paste'),USE(?Paste),MSG('Paste contents of Windows Clipboard'),STD(STD:Paste) | |
END | |
MENU('&Window'),USE(?WindowMenu),STD(STD:WindowList) | |
ITEM('T&ile'),USE(?Tile),MSG('Make all open windows visible'),STD(STD:TileWindow) | |
ITEM('&Cascade'),USE(?Cascade),MSG('Stack all open windows'),STD(STD:CascadeWindow) | |
ITEM('&Arrange Icons'),USE(?Arrange),MSG('Align all window icons'),STD(STD:ArrangeIcons) | |
END | |
MENU('&Help'),USE(?HelpMenu) | |
ITEM('&Contents'),USE(?Helpindex),MSG('View the contents of the help file'),STD(STD:HelpIndex) | |
ITEM('&Search for Help On...'),USE(?HelpSearch),MSG('Search for help on a subject'),STD(STD:HelpSearch) | |
ITEM('&How to Use Help'),USE(?HelpOnHelp),MSG('How to use Windows Help'),STD(STD:HelpOnHelp) | |
END | |
END | |
END | |
CODE | |
OPEN(AppFrame) | |
glo:Frame &= AppFrame | |
ACCEPT | |
CASE ACCEPTED() | |
OF ?NonMDIChild ; START(NonMDIChild) | |
!NonMDIChild | |
OF ?BrahnModal ; START(BrahnModal) | |
END | |
END | |
!====================================== | |
BrahnModal PROCEDURE() | |
Window WINDOW('Brahn Modal Hidden MDI Child'),AT(,,200,100),GRAY,FONT('Microsoft Sans Serif',8,,FONT:regular),MDI | |
BUTTON('Launch NonMDI'),AT(13,7,141,14),USE(?LaunchNonMDI),DEFAULT | |
END | |
CODE | |
OPEN(Window) | |
Window{PROP:Hide} = TRUE | |
POST(EVENT:Accepted, ?LaunchNonMDI) | |
ACCEPT | |
CASE ACCEPTED() | |
OF ?LaunchNonMDI; NonMDIChild() | |
END | |
END | |
!====================================== | |
NonMDIChild PROCEDURE() | |
Window WINDOW('Non MDI Child'),AT(,,200,100),GRAY,FONT('Microsoft Sans Serif',8,,FONT:regular),SYSTEM | |
BUTTON('Center Rel to Frame'),AT(13,7,141,14),USE(?CenterRelToFrame),DEFAULT | |
END | |
CODE | |
OPEN(Window) | |
ACCEPT | |
CASE EVENT() | |
OF EVENT:OpenWindow; 0{PROP:Center} = TRUE | |
END | |
CASE ACCEPTED() | |
OF ?CenterRelToFrame; 0{PROP:Center} = TRUE | |
END | |
END | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment