On Mar 7, 6:35 am, PeCoNe <
malj...@telfort.nl> wrote:
> thanks for the answer.
> I had planned to use OK with no input for adding a new record,
> so i must look for another option.
Rather than change your design, you should just use a dialog that does
what you want. The standard dialogs are very simplistic and not
flexible. The whole purpose of ooDialog is to allow you to create any
dialog you need.
This program catches OK with no input allowing you to add a new
record:
/* catchOk.rx */
dlg = .CatchOkDialog~new
dlg~execute("SHOWTOP", IDI_DLG_OOREXX)
::requires "ooDialog.cls"
::class 'CatchOkDialog' subclass UserDialog
::method init
forward class (super) continue
self~create(30, 30, 275, 66, "Data Entry Dialog", "CENTER")
::method defineDialog
msg = 'Enter some data. Press Ok with no ' || -
'text entered to start a new record'
self~createStaticText(IDC_STATIC, 10, 10, 255, 8, , msg)
self~createEdit(200, 10, 21, 255, 11, 'AUTOSCROLLH')
self~createPushButton(IDOK, 160, 42, 50, 14, "DEFAULT", "Ok")
self~createPushButton(IDCANCEL, 215, 42, 50, 14, , "Cancel")
::method ok unguarded
text = self~newEdit(200)~getText~strip
if text == '' then do
title = 'New Record'
msg = 'The user requested a new record'
end
else do
title = 'Data Entered'
msg = 'Data:' text
end
j = MessageDialog(msg, self~hwnd, title, 'OK')
return self~ok:super
::method cancel unguarded
title = 'Data Entry Canceled'
msg = 'The user canceled the dialog'
j = MessageDialog(msg, self~hwnd, title, 'OK')
return self~cancel:super
/* End catchOk.rx */
--
Mark Miesfeld