Unlucky in using self~constDir[SYMBOLIC_ID] = numericID I changed
all Symbolic IDs in the example within paragraph 23.2.3.2
'SystemMenu Command Event Handler' on page 1155f of 'ooDialog
Reference Version 4.2.0' to numeric IDs from 301 up to 309 (hoping
not to step over some predefined constants - BTW, how may I figure
out what numeric IDs are not yet in use?).
The addition to the system menu is shown as expected, alas only
selecting the menu entry 'Cut' brings the expected result, 'Copy'
and 'Paste' just make the menu disappear but nothing more. When I
quit the dialog the cmd window shows two lines:
In uninit() of PopupMenu
In UNINIT() of Menu class cMenu=01782EA0
where the value of cManu changes for every run: 01CD2E48,
01CD2EA0, 02012EA0, 01D62EA0, 01D62EA0, 01782EA0. Looks like a
damaged error message.
What did I overlook this time? As a beginner within ooREXX and
ooDialog I allow me to append what I tried.
Best,
M.
-----
/* Simple Dialog with an edit control and system menu */
dlg = .SimpleDialog~new
dlg~execute("SHOWTOP")
::requires "ooDialog.cls"
::class 'SimpleDialog' subclass UserDialog
::method init
forward class (super) continue
self~create(30, 30, 257, 123, "Simple Dialog", "CENTER")
::method defineDialog
self~createEdit(100, 7, 7, 243, 85, "MULTILINE VSCROLL NOBORDER",
"NOTAB READONLY")
self~createPushButton(110, 7, 99, 50, 14, , "Write", onWrite)
self~createPushButton(IDCANCEL, 197, 99, 50, 14, , "Quit")
::method initDialog
expose sysMenu /* why is sysMenu exposed? It is only used here */
self~setControlSysColor(100, 7, 4)
hFont = self~createFontEx("Courier New", 9)
self~setControlFont(100, hFont, .false)
/* Modify the system menu, taken from
ooDialog Reference Version 4.2.0, pp 1155 f */
-- Get the system menu.
sysMenu = .SystemMenu~new(self)
-- Modify the system menu by inserting an "Edit" menu into it
popup = .PopupMenu~new(301)
popup~insertItem(302, 302, "Paste")
popup~insertItem(302, 303, "Copy")
popup~insertItem(302, 304, "Cut")
sysMenu~insertPopup(SC_MOVE, 301, popup, "Edit")
sysMenu~insertSeparator(SC_MOVE, 305)
itemIDs = .set~of(303, 304, 302)
sysMenu~connectSomeCommandEvents(itemIDs)
::method onWrite unguarded
expose editControl charcount /* remember until next time */
line = 'It is now' date() time()
if editControl~defaultName = 'a String' then do
editControl = self~newEdit(100)
charcount = 1 /* first cursor pos */
end
else line = .endOfLine || line /* insert a CRLF */
editControl~select(charcount, charcount)
charcount = charcount + length(line)
editControl~replaceSelText(line)
::method copy
use arg id, x, y
say 'In SystemMenu->Edit->Copy, ID:' id 'x:' x 'y:' y
return .true
::method cut
use arg id, x, y
say 'In SystemMenu->Edit->Cut, ID:' id 'x:' x 'y:' y
return .true
::method paste
use arg id, x, y
say 'In SystemMenu->Edit->Paste, ID:' id 'x:' x 'y:' y
return .true
--------------------------------------------
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
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users