Hello hakan!
Thank you for your reply.
> I don?t knpw if this helps..
Let's have a look :)
> I have used in an ooDialog program
>
>
> ::method InitDialog
>
> self~myHelpAbout
>
>
> ::Method myHelpAbout
>
> self~connectMenuItem(IDM_HELP,Help)
> self~ConnectHelp(help) -- connect to F1 (Windows Help)
> self~ConnectMenuItem(IDM_ABOUT,About)
> [...]
Well, what you suggest is a nice work around. May be I was not
clear enough, my qestion was about MessageDialog()
i) did I misunderstand the documentation, or
ii) is there a docomentation error, or
iii) is it realy broken?
As such I append here a test routine what is an ~160 lines excerpt
of a program with now about 3000 lines of code. I hope it gets not
messed up by line wrap (make-up? Zeilenumbruch). Just start it and
select About... in the system menu or in the context menu. As
"detailed help" just write a file named helptest.txt with 'This is
the Help for HelpTest.REXX' or similar as content, just as an
example. What I list in the comments as 'glitches' are just some
additonal oddities.
Thanks in advance for your time.....Mike
> /**HelpTest.REXX: Test to make the Help button in a About window act as
> desired */
> -- Error: The About dialog shows a Help button but I can't get it work
> -- ===== (This problem is the first reason for this test.)
> -- Glitches: i) 'a' is defined in main window (instead of F13) to show the
> About
> -- ======== dialog. 'a' is also defined in the menu to show About. 'm-h-a'
> -- may show two About windows, alas not 100% reproducible.
> -- ii) Requests to show the menu seem to be stacked: Right mouse
> click
> -- and an 'm' followed by ESC still shows the menu. 'm-m-m' needs
> -- three ESC to get rid of the menu. 'm-m-h-i' still shows the
> menu.
> -- iii) External applications are not modal. 'm-h-i' shows a txt file
> -- as help. Without closing this dissplay you may switch back to
> REXX
> -- and quit. Alas only the REXX window disappears but REXX is
> active
> -- until the txt file display is closed. Same with html. How to
> -- detach an external application?
> -- Documentation error: ooDialog Reference 4.2.3, Jan. 2014, p. 1549, 2nd
> phrase
> -- states 'If the message box does not have a Cancel button, then the user
> can not
> -- close the message box by using the ESC key.' This holds true for pb
> keywords
> -- ABORTRETRYIGNORE and YESNO, OK or omission of the pb argument enables
> ESC to
> -- close the message box, but returns IDOK in place of IDCANCEL.
> trace 'N'
> address command
> parse upper arg .
> signal on halt; signal on error
>
> /* show version of ooREXX and ooDialog */
> parse source . . fid; parse version . "-" vers . reldat
> say 'Running' fid 'using' vers reldat
> say 'and' .DlgUtil~version
>
> /* Part 0 - set some GLOBALVars */
> .constDir[CSM_ABOUT] = 336
> .constDir[CSM_SEPAR] = 309
> .constDir[GLV_FID] = fid
>
> /* Part 1 - the ooREXX main program: 2 statements to display a window */
> picture = .PLT~new -- create an instance "picture" of PLT
> if picture~initCode = 0 then do
> picture~execute("", 105) -- connectPosChanged() is triggered first
> end
>
> /* Part 2 - Define which library to use for this program */
> ::requires "ooDialog.cls" -- I am still not sure?
>
> /* Part 3 - Define the PLT class for... yes - for what?? */
> ::class 'PLT' subclass UserDialog -- I must re-read the manual about this
>
> /* Part 4 - INIT: what makes up the new object */
> ::method init unguarded -- auto-invoked when an instance is
> created.
> expose ppm ppsm
> say '>>> Init'
> forward class (super) continue -- I must re-read the manual about this.
> /* Next statement needs DU */
> self~initCode = \ self~create(18, 29, 99, 99,, /* resize later */
> 'Help test' , "MINIMIZEBOX")
> /* Define a menu shown with right mouse click, shift F10, or Menu key */
> ppm = .PopupMenu~new(350)
> -- insertitem(IDb, ID, designation, state, type, byPos, connect, mName)
> ppm~insertItem(355, 355, "&Quit")
> ppm~insertSeparator(356, 356)
> pphm = .PopupMenu~new(390)
> pphm~insertItem(391, 391, "&About...")
> pphm~insertItem(392, 392, "&In datail...")
> ppm~insertPopup(357, 357, pphm, "&Help")
>
> self~connectHelp(Help) -- Help will call help() ... "You pressed F1"
> say 'Init >>>'
>
> /* Part 5 - defineDialog: all elements and 'event-listener' of this dialog */
> ::method defineDialog unguarded -- invoked at some time.
> say '>>> defineDialog'
> /* button surface will serve as canvas (resize later) */
> self~createPushButton(666, 2, 2, 88, 88, "OWNER NOTAB NOTIFY")
> self~setControlColor(666, 10)
> self~connectButtonEvent(666, 'DBLCLK', 'whatsabout')
> say 'defineDialog >>>'
>
> /* Part 6 - initDialog: what needs to be set when the dialog is shown the
> first time */
> ::method initDialog unguarded
> expose ppm ppsm
> say '>>> initDialog'
> /* Modify the system menu, ooDialog Reference Version 4.2.0, pp 1155 f */
> -- Get the system menu.
> sysMenu = .SystemMenu~new(self)
> -- Modify the system menu
> sysMenu~insertSeparator(CSM_SEPAR, CSM_SEPAR)
> sysMenu~insertItem(CSM_ABOUT, CSM_ABOUT, "&About")
> sysMenu~connectCommandEvent(CSM_ABOUT, 'whatsabout')
> -- Make right mouse click on canvas only execute RMC()
> if \ .PopupMenu~connectContextMenu(self, "rmc", self~getControlHandle(666))
> then do
> say 'Error conecting context menu. SystemErrorCode:' || -
> .SystemErrorCode SysGetErrortext(.SystemErrorCode)
> end
> -- Make all menu items call MIS()
> if \ ppm~connectAllCommandEvents("mis", self) then do
> say 'Error conecting menu items. SystemErrorCode:' || -
> .SystemErrorCode SysGetErrortext(.SystemErrorCode)
> end
> -- make some keys act
> self~connectKeyPress('RMC', .VK~M ',' .VK~DIVIDE ',' .VK~F10, "NONE")
> self~connectKeyPress('MKP', .VK~MENU) /* Alt-key on its own */
> self~connectKeyPress('whatsabout', .VK~A, "NONE") /* instead of F13 */
> say 'initDialog >>>'
>
> /* Part 7 contains routines acting on messages */
>
> /* MKP: Menu Key Pressed (the Alt key on its own) */
> ::method MKP unguarded
> self~rmc('dc', 0, 0) /* dc = don't care */
>
> /* Menu Item Selected: all menu items are conected to MIS() */
> ::method MIS unguarded
>
> use arg mniID
> select
> when mniID = 355 then return self~ok -- 'Menu Quit'
> when mniID = 391 then self~whatsabout -- 'Menu Help/About...'
> when mniID = 392 then self~help -- 'Menu Help/In datail...'
> otherwise say 'Programming error in method MIS()'
> end
>
> /* RMC: Right Mouse Click on canvas */
> ::method rmc unguarded
> expose ppm pos
> use arg hwnd, x, y
> /* x = -1 and y = -1 indicate Shift-F10 or Context Menu key hit */
> /* x = 0 and y = 0 indicate purposeful misuse by connectKeyPress() */
> if x + y <= 0 then do
> dlgR = self~windowRect
> x = dlgR~left + 75 -- missing: offset = f(menu size)
> y = dlgR~top + .SM~cyCaption + 58
> end
> pos = .Point~new(x, y)
> ret = ppm~show(pos, self)
> if ret == -1 then do
> say 'Display popup menu failed SystemErrorCode:' || -
> .SystemErrorCode SysGetErrortext(.SystemErrorCode)
> end
>
> /* whatsitallabout: the about window */
> ::method whatsabout unguarded
>
> dh = self~getControlHandle(666) -- this is the "canvas", rm click only here
> dh = self~dlgHandle
> say 'Dialog handle:' dh
>
> exit MessageDialog('"HelpTest" is a test of the About dialog Help button.'
> .endOfLine,
> "I'd like it shows the help file as F1 does in main
> window.", dh,,
> "About HelpTest", , , 'HELP TOPMOST')
> /* missing: make this darned HELP button act */
>
> /* show a txt file with some help */
> ::method help unguarded
> say 'You pressed F1?'
> -- assume TXT files are linked with an editor or viewer on all users' PCs w/o
> exception
> -- could be HTML in some future, but Win32pad starts much faster
> fid = .constDir[GLV_FID]
> "" left(fid, lastpos('.', fid)) || 'txt'
> return 0
--------------------------------------------
Kostenlose E-Mail-Adresse mit unbegrenztem Speicherplatz für E-Mails, Free SMS
und OK-Drive, der Online-Festplatte.
Sicher Dir jetzt Deine Wunschadresse @ OK.de: www.ok.de
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users