Hi Oleg, Japheth,
some source snippets about that... EDIT makes heavy use of
the D-Flat windowing toolkit. The toolkit is written in plain
C code but features message / event driven processing and some
sort of class hierarchy / object orientation. In other words,
the source code tries to be very funky but is quite ugly ;-).
#define YesNoBox(msg) \
GenericMessage(NULL, NULL, msg, 2, YesNoBoxProc, \
Yes, No, ID_OK, ID_CANCEL, TRUE)
In msgbox.c, you can see YesNoBoxProc, which is indeed much
simpler than the handling in dial(og)box.c - but works okay.
You may want to read DialogProc and its KeyboardMsg and also the
global NormalProc to get an impression of D-FLAT. Or maybe not...
YesNoBoxProc only handles 'y' and 'n', and because classes.h says
ClassDef( MESSAGEBOX, DIALOG, NULL, ...) the call to BaseWndProc
will probably not add extra hotkeys either (default handler for the
MESSAGEBOX class is just NULL)...:
#define BaseWndProc(Class,wnd,msg,p1,p2) \
A YesNoBox also has no control box, so you have no alt-hyphen or
alt-f4, ctrl-f4 or the clickable system menu. Not needed either.
--> What you DO want to try is this: Extend YesNoBoxProc for the
--> cases LARROW, UP, \t, RARROW and DN, and make those call
--> PrevFocus(wnd->extension) or NextFocus(wnd->extension) :-).
I think the "button press" by enter (or space?) is already handled
elsewhere, maybe in "focused button receives keypress"? Whatever.
Please test and let me know if the suggested modification of the
YesNoBoxProc solves your problem. EDIT compiles with Turbo C 2.01.
Thanks for testing :-).
> >> Hmmm I cannot reproduce that problem. Both edit 0.7d and edit 0.81
> >> ("European" and "original American" branch) let me select "No" when
> >> I select either "exit" or "close" and get a dialog which asks me
> >> whether I want to save changes, either by mouse or by keyboard.
> > On my PC I cannot switch to "No" with TAB or the cursor keys
> > if edit asks to save the file. The mouse works, though.
> I have the same problem :-( But keys `y' and `n' works.
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Freedos-user mailing list