changeset 1912:d3689f044909

fl_choice does not behave like fltk::choice did
author corvid <corvid@lavabit.com>
date Fri, 25 Feb 2011 07:22:30 +0000
parents 967fa1fd93ed
children 55af06da5523 fd6dd39810d8
files src/dialog.cc src/nav.c src/uicmd.cc
diffstat 3 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialog.cc	Fri Feb 25 07:00:11 2011 +0000
+++ b/src/dialog.cc	Fri Feb 25 07:22:30 2011 +0000
@@ -38,9 +38,8 @@
 
 /*
  * Offer a three choice dialog.
- * The option string that begins with "*" is the default.
  *
- * Return: 0, 1 or 2 (esc = 2, window close = 2)
+ * Return: 0, 1 or 2 (esc = 0, window close = 0, enter = 1)
  */
 int a_Dialog_choice3(const char *msg,
                      const char *b0, const char *b1, const char *b2)
--- a/src/nav.c	Fri Feb 25 07:00:11 2011 +0000
+++ b/src/nav.c	Fri Feb 25 07:22:30 2011 +0000
@@ -489,8 +489,8 @@
       } else if (URL_FLAGS(h_url) & URL_Post) {
          /* Attempt to repost data, let's confirm... */
          choice = a_Dialog_choice3("Repost form data?",
-                                   "Yes", "*No", "Cancel");
-         confirmed = (choice == 0);  /* "Yes" */
+                                   "No", "Yes", "Cancel");
+         confirmed = (choice == 1);  /* "Yes" */
       }
 
       if (confirmed) {
--- a/src/uicmd.cc	Fri Feb 25 07:00:11 2011 +0000
+++ b/src/uicmd.cc	Fri Feb 25 07:22:30 2011 +0000
@@ -376,8 +376,8 @@
 
    if (tabs->children () > 1)
       choice = a_Dialog_choice3 ("Window contains more than one tab.",
-                                 "Close all tabs", "Cancel", NULL);
-   if (choice == 0)
+                                 "Cancel", "Close all tabs", NULL);
+   if (choice == 1)
       while (tabs->children())
          a_UIcmd_close_bw(a_UIcmd_get_bw_by_widget(tabs->child(0)));
 }
@@ -574,9 +574,9 @@
    int choice = 0;
 
    if (a_Bw_num() > 1)
-      choice = a_Dialog_choice3 ("More than one open tab or Window.",
-         "Close all tabs and windows", "Cancel", NULL);
-   if (choice == 0)
+      choice = a_Dialog_choice3 ("More than one open tab or window.",
+         "Cancel", "Close all tabs and windows", NULL);
+   if (choice == 1)
       while ((bw = a_Bw_get(0)))
          a_UIcmd_close_bw((void*)bw);
 }