Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/cdk Fix a problem in these widgets where they unconditi...



details:   https://anonhg.NetBSD.org/src/rev/bc6816fa4d76
branches:  trunk
changeset: 501945:bc6816fa4d76
user:      garbled <garbled%NetBSD.org@localhost>
date:      Tue Jan 09 18:41:53 2001 +0000

description:
Fix a problem in these widgets where they uncondititonally set the
exitType to either vEARLY_EXIT, or vESCAPE_HIT when returning from a bound
function.  This had the unfortunate effect that when you hit F2 to refresh
the screen in sushi, it would exit out immediately after refreshing the
screen.

This modification allows the programmer to still create an exit-causing
bound function, by simply setting the exitType in the function, as was likely
intended by the author.  Many thanks to Charles Hannum for helping me figure
this out.

This should fix problems noted by itojun on tech-userlevel with the function
keys.

diffstat:

 dist/cdk/buttonbox.c |  7 +++----
 dist/cdk/calendar.c  |  5 ++---
 dist/cdk/dialog.c    |  5 ++---
 dist/cdk/itemlist.c  |  5 ++---
 dist/cdk/matrix.c    |  5 ++---
 dist/cdk/mentry.c    |  8 +++++---
 dist/cdk/menu.c      |  5 ++---
 dist/cdk/radio.c     |  5 ++---
 dist/cdk/scale.c     |  5 ++---
 dist/cdk/scroll.c    |  5 ++---
 dist/cdk/selection.c |  5 ++---
 dist/cdk/slider.c    |  5 ++---
 dist/cdk/swindow.c   |  8 +++++---
 dist/cdk/template.c  |  5 ++---
 14 files changed, 35 insertions(+), 43 deletions(-)

diffs (truncated from 330 to 300 lines):

diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/buttonbox.c
--- a/dist/cdk/buttonbox.c      Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/buttonbox.c      Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:29 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 DeclareCDKObjects(my_funcs,Buttonbox);
@@ -261,8 +261,7 @@
       /* Check for a key binding. */
       if (checkCDKObjectBind (vBUTTONBOX, buttonbox, input) != 0)
       {
-        buttonbox->exitType = vESCAPE_HIT;
-        return -1;
+         return -1;
       }
       else
       {
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/calendar.c
--- a/dist/cdk/calendar.c       Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/calendar.c       Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -259,7 +259,6 @@
       /* Check a predefined binding. */
       if (checkCDKObjectBind (vCALENDAR, calendar, input) != 0)
       {
-        calendar->exitType = vEARLY_EXIT;
         return 0;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/dialog.c
--- a/dist/cdk/dialog.c Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/dialog.c Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 DeclareCDKObjects(my_funcs,Dialog);
@@ -212,7 +212,6 @@
       /* Check for a key binding. */
       if (checkCDKObjectBind (vDIALOG, dialog, input) != 0)
       {
-        dialog->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/itemlist.c
--- a/dist/cdk/itemlist.c       Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/itemlist.c       Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 DeclareCDKObjects(my_funcs,Itemlist);
@@ -265,7 +265,6 @@
       /* Check a predefined binding. */
       if (checkCDKObjectBind (vITEMLIST, itemlist, input) != 0)
       {
-        itemlist->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/matrix.c
--- a/dist/cdk/matrix.c Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/matrix.c Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -389,7 +389,6 @@
       /* Check the key bindings. */
       if (checkCDKObjectBind (vMATRIX, matrix, input) != 0)
       {
-        matrix->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/mentry.c
--- a/dist/cdk/mentry.c Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/mentry.c Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -267,6 +267,9 @@
    int x, infoLength, fieldCharacters;
    char holder;
 
+   /* set the exit type */
+   mentry->exitType = vEARLY_EXIT;
+
    /* Check if there is a pre-process function to be called. */
    if (mentry->preProcessFunction != 0)
    {
@@ -280,7 +283,6 @@
       /* Check for a key binding... */
       if (checkCDKObjectBind (vMENTRY, mentry, input) != 0)
       {
-        mentry->exitType = vESCAPE_HIT;
         return 0;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/menu.c
--- a/dist/cdk/menu.c   Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/menu.c   Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:30 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -198,7 +198,6 @@
       /* Check for key bindings. */
       if (checkCDKObjectBind (vMENU, menu, input) != 0)
       {
-        menu->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/radio.c
--- a/dist/cdk/radio.c  Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/radio.c  Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -292,7 +292,6 @@
       /* Check for a predefined key binding. */
       if (checkCDKObjectBind (vRADIO, radio, input) != 0)
       {
-        radio->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/scale.c
--- a/dist/cdk/scale.c  Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/scale.c  Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:53 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -255,7 +255,6 @@
       /* Check for a key binding. */
       if (checkCDKObjectBind(vSCALE, scale, input) != 0)
       {
-        scale->exitType = vESCAPE_HIT;
         return 0;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/scroll.c
--- a/dist/cdk/scroll.c Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/scroll.c Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:54 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -290,7 +290,6 @@
       /* Check for a predefined key binding. */
       if (checkCDKObjectBind (vSCROLL, scrollp, input) != 0)
       {
-        scrollp->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/selection.c
--- a/dist/cdk/selection.c      Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/selection.c      Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:54 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -299,7 +299,6 @@
       /* Check for a predefined binding. */
       if (checkCDKObjectBind (vSELECTION, selection, input) != 0)
       {
-        selection->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/slider.c
--- a/dist/cdk/slider.c Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/slider.c Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:54 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -264,7 +264,6 @@
       /* Check for a key binding. */
       if (checkCDKObjectBind(vSLIDER, slider, input) != 0)
       {
-        slider->exitType = vESCAPE_HIT;
         return -1;
       }
       else
diff -r beeb5e7d8a41 -r bc6816fa4d76 dist/cdk/swindow.c
--- a/dist/cdk/swindow.c        Tue Jan 09 17:35:45 2001 +0000
+++ b/dist/cdk/swindow.c        Tue Jan 09 18:41:53 2001 +0000
@@ -2,8 +2,8 @@
 
 /*
  * $Author: garbled $
- * $Date: 2001/01/04 20:15:31 $
- * $Revision: 1.2 $
+ * $Date: 2001/01/09 18:41:54 $
+ * $Revision: 1.3 $
  */
 
 /*
@@ -463,6 +463,9 @@
    /* Declare local variables. */
    int ppReturn = 1;
 
+   /* Set the exit type */
+   swindow->exitType = vEARLY_EXIT;
+
    /* Draw the window.... */
    drawCDKSwindow (swindow, ObjOf(swindow)->box);
 



Home | Main Index | Thread Index | Old Index