Hello Eric,

you wrote:
> of if. Makes the code more readable and makes it easy to connect 
IMHO Edit's code is a good candidate for winning on the IOCCC ;-)

> I guess you mean DN for next and UP for prev. 
Yes, you're right.

>> I removed `static' keyword from {Next,Prev}Focus definitions and 
>> declarations in the dialbox.c... 
>
> Why? 
Because of linker errors:
Error: Undefined symbol _PREVFOCUS in library file dflat.lib in module MSGBOX
Error: Undefined symbol _NEXTFOCUS in library file dflat.lib in module MSGBOX

> Interesting. Let me know if the suggestion above fixes the rest. 
Your suggestions fixes only UP and DN keys. Left and Right arrows
are still does not work.
After placing prototypes for NextFocus and PrevFocus into msgbox.c, tcc says:

Warning msgbox.c 47: Suspicious pointer conversion in function YesNoBoxProc,

if I write NextFocus(wnd)..., and compiles w/o any warnings, if I write
NextFocus(wnd->extension). But in the last case only y / n keys works.

> it might be a bit tricky to avoid Cyrillic chars as CP866 has 
> fewer line art chars, but still... If you notice other errors 
CP866 differs from CP437 only in ranges 128..175, 224..239, and
(partially) 240..255. Line drawing chars located at the same places
in both CPs.


diff's output:

---- cut here ----
diff -ur C:\FDOS\SOURCE\EDIT\/dialbox.c ./dialbox.c
--- C:\FDOS\SOURCE\EDIT\/dialbox.c      2003-11-27 15:29:52.000000000 +0000
+++ ./dialbox.c 2007-08-09 14:29:28.000000000 +0000
@@ -6,8 +6,8 @@
 static BOOL dbShortcutKeys(DBOX *, int);
 static int ControlProc(WINDOW, MESSAGE, PARAM, PARAM);
 static void FirstFocus(DBOX *db);
-static void NextFocus(DBOX *db);
-static void PrevFocus(DBOX *db);
+void NextFocus(DBOX *db);
+void PrevFocus(DBOX *db);
 static CTLWINDOW *AssociatedControl(DBOX *, enum commands);
 
 static BOOL SysMenuOpen;
@@ -775,7 +775,7 @@
 }
 
 /* ---- change the focus to the next control --- */
-static void NextFocus(DBOX *db)
+void NextFocus(DBOX *db)
 {
     CTLWINDOW *ct = WindowControl(db, inFocus);
        int looped = 0;
@@ -794,7 +794,7 @@
 }
 
 /* ---- change the focus to the previous control --- */
-static void PrevFocus(DBOX *db)
+void PrevFocus(DBOX *db)
 {
     CTLWINDOW *ct = WindowControl(db, inFocus);
        int looped = 0;
diff -ur C:\FDOS\SOURCE\EDIT\/msgbox.c ./msgbox.c
--- C:\FDOS\SOURCE\EDIT\/msgbox.c       2006-07-24 12:17:10.000000000 +0000
+++ ./msgbox.c  2007-08-09 14:34:38.000000000 +0000
@@ -6,6 +6,9 @@
 extern DBOX InputBoxDB;
 WINDOW CancelWnd;
 
+void NextFocus(DBOX *);
+void PrevFocus(DBOX *);
+
 static int ReturnValue;
 
 int MessageBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
@@ -35,11 +38,17 @@
             ClearAttribute(wnd, CONTROLBOX);
             break;
         case KEYBOARD:    {
-            int c = tolower((int)p1);
-            if (c == 'y')
+            int c = (int)p1;
+            if (c == 'y' || c == 'Y')
                 SendMessage(wnd, COMMAND, ID_OK, 0);
-            else if (c == 'n')
+            else if (c == 'n' || c == 'N')
                 SendMessage(wnd, COMMAND, ID_CANCEL, 0);
+            else if (c == '\t')
+                NextFocus(wnd);
+            else if (c == RARROW || c == DN)
+                NextFocus(wnd);
+            else if (c == LARROW || c == UP)
+                PrevFocus(wnd);
             else {
                 beep();
                 return TRUE;
diff -ur C:\FDOS\SOURCE\EDIT\/watch.c ./watch.c
--- C:\FDOS\SOURCE\EDIT\/watch.c        2003-11-17 19:33:22.000000000 +0000
+++ ./watch.c   2007-08-09 13:58:14.000000000 +0000
@@ -9,7 +9,7 @@
     int rtn;
     /* int i; */
     static int tick = 0;
-    static char *hands[] = { " L ", " - ", " ะบ ", " - " };
+    static char *hands[] = { " \xc0 ", " \xda ", " \xbf ", " \xd9 " };
     switch (msg)
         {
         case CREATE_WINDOW:
---- cut here ----


--
Oleg O. Chukaev



-------------------------------------------------------------------------
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
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to