Browse Source

* dlg.h: Replace DLG_BACKWARD to DLG_REVERSE with a better
defined meaning. Make it default to populate dialogs from the
top. Change all calls to create_dlg().

Pavel Roskin 21 years ago
parent
commit
e14f56d71b
10 changed files with 20 additions and 16 deletions
  1. 2 2
      edit/editcmd.c
  2. 1 1
      edit/editwidget.c
  3. 4 0
      src/ChangeLog
  4. 2 2
      src/achown.c
  5. 6 6
      src/boxes.c
  6. 1 1
      src/chmod.c
  7. 1 1
      src/chown.c
  8. 1 1
      src/complete.c
  9. 1 1
      src/dlg.c
  10. 1 1
      src/dlg.h

+ 2 - 2
edit/editcmd.c

@@ -550,7 +550,7 @@ edit_raw_key_query (char *heading, char *query, int cancel)
     struct Dlg_head *raw_dlg =
 	create_dlg (0, 0, 7, w, dialog_colors, raw_callback,
 		    NULL, heading,
-		    DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB);
+		    DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB | DLG_REVERSE);
     if (cancel)
 	add_widget (raw_dlg,
 		    button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON,
@@ -2756,7 +2756,7 @@ edit_completion_dialog (WEdit *edit, int max_len, int word_len,
     compl_dlg =
 	create_dlg (start_y, start_x, compl_dlg_h, compl_dlg_w,
 		    dialog_colors, NULL, "[Completion]", NULL,
-		    DLG_COMPACT);
+		    DLG_COMPACT | DLG_REVERSE);
 
     /* create the listbox */
     compl_list =

+ 1 - 1
edit/editwidget.c

@@ -187,7 +187,7 @@ edit (const char *_file, int line)
     /* Create a new dialog and add it widgets to it */
     edit_dlg =
 	create_dlg (0, 0, LINES, COLS, NULL, edit_dialog_callback,
-		    "[Internal File Editor]", NULL, DLG_WANT_TAB);
+		    "[Internal File Editor]", NULL, DLG_WANT_TAB | DLG_REVERSE);
 
     init_widget (&(wedit->widget), 0, 0, LINES - 1, COLS,
 		 (callback_fn) edit_callback,

+ 4 - 0
src/ChangeLog

@@ -1,5 +1,9 @@
 2003-09-12  Pavel Roskin  <proski@gnu.org>
 
+	* dlg.h: Replace DLG_BACKWARD to DLG_REVERSE with a better
+	defined meaning.  Make it default to populate dialogs from the
+	top.  Change all calls to create_dlg().
+
 	* dlg.c: DLG_BACKWARD now affects how the dialog is populated by
 	widgets, not the runtime behavior.
 	(init_dlg): Don't change current widget.  This allows using

+ 2 - 2
src/achown.c

@@ -256,7 +256,7 @@ do_enter_key (Dlg_head * h, int f_pos)
 
 	chl_dlg =
 	    create_dlg (lyy, lxx, 13, 17, dialog_colors, chl_callback,
-			"[Advanced Chown]", title, DLG_COMPACT);
+			"[Advanced Chown]", title, DLG_COMPACT | DLG_REVERSE);
 
 	/* get new listboxes */
 	chl_list = listbox_new (1, 1, 15, 11, NULL);
@@ -548,7 +548,7 @@ init_chown_advanced (void)
     ch_dlg =
 	create_dlg (0, 0, 13, 74, dialog_colors, advanced_chown_callback,
 		    "[Advanced Chown]", _(" Chown advanced command "),
-		    DLG_CENTER);
+		    DLG_CENTER | DLG_REVERSE);
 
 #define XTRACT(i) BY+chown_advanced_but[i].y, BX+chown_advanced_but[i].x, \
 	chown_advanced_but[i].ret_cmd, chown_advanced_but[i].flags, \

+ 6 - 6
src/boxes.c

@@ -180,7 +180,7 @@ display_init (int radio_sel, char *init_text, int _check_status,
     }
     dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors,
 		     display_callback, "[Listing Mode...]", display_title,
-		     DLG_CENTER);
+		     DLG_CENTER | DLG_REVERSE);
 
     add_widget (dd,
 		button_new (4, button_start, B_CANCEL, NORMAL_BUTTON,
@@ -324,7 +324,7 @@ sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
 	}
 
     dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, NULL,
-		     "[Sort Order...]", sort_title, DLG_CENTER);
+		     "[Sort Order...]", sort_title, DLG_CENTER | DLG_REVERSE);
 
     add_widget (dd,
 		button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON,
@@ -571,7 +571,7 @@ init_disp_bits_box (void)
 
     dbits_dlg =
 	create_dlg (0, 0, DISPY, DISPX, dialog_colors, NULL,
-		    "[Display bits]", _(" Display bits "), DLG_CENTER);
+		    "[Display bits]", _(" Display bits "), DLG_CENTER | DLG_REVERSE);
 
     add_widget (dbits_dlg,
 		label_new (3, 4, _("Input / display codepage:")));
@@ -666,7 +666,7 @@ tree_box (char *current_dir)
 
     /* Create the components */
     dlg = create_dlg (0, 0, TREE_Y, TREE_X, dialog_colors,
-		      tree_callback, "[Directory Tree]", NULL, DLG_CENTER);
+		      tree_callback, "[Directory Tree]", NULL, DLG_CENTER | DLG_REVERSE);
     mytree = tree_new (0, 2, 2, TREE_Y - 6, TREE_X - 5);
     add_widget (dlg, mytree);
     bar = buttonbar_new(1);
@@ -978,7 +978,7 @@ jobs_cmd (void)
 
     jobs_dlg = create_dlg (0, 0, JOBS_Y, JOBS_X, dialog_colors, NULL,
 			   "[Background jobs]", _("Background Jobs"),
-			   DLG_CENTER);
+			   DLG_CENTER | DLG_REVERSE);
 
     bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, 0);
     add_widget (jobs_dlg, bg_list);
@@ -1062,7 +1062,7 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain,
     title = g_strdup_printf (_("Password for \\\\%s\\%s"), host, share);
 
     auth_dlg = create_dlg (0, 0, dialog_y, dialog_x, dialog_colors, NULL,
-			   "[Smb Authinfo]", title, DLG_CENTER);
+			   "[Smb Authinfo]", title, DLG_CENTER | DLG_REVERSE);
 
     g_free (title);
 

+ 1 - 1
src/chmod.c

@@ -195,7 +195,7 @@ init_chmod (void)
     ch_dlg =
 	create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
 		    chmod_callback, "[Chmod]", _("Chmod command"),
-		    DLG_CENTER);
+		    DLG_CENTER | DLG_REVERSE);
 
     for (i = 0; i < BUTTONS; i++) {
 	if (i == 2 && single_set)

+ 1 - 1
src/chown.c

@@ -157,7 +157,7 @@ init_chown (void)
 
     ch_dlg =
 	create_dlg (0, 0, 18, 74, dialog_colors, chown_callback, "[Chown]",
-		    _(" Chown command "), DLG_CENTER);
+		    _(" Chown command "), DLG_CENTER | DLG_REVERSE);
 
     for (i = 0; i < BUTTONS - single_set; i++)
 	add_widget (ch_dlg,

+ 1 - 1
src/complete.c

@@ -977,7 +977,7 @@ complete_engine (WInput *in, int what_to_do)
 	    query_width  = w;
     	    query_dlg = create_dlg (y, x, query_height, query_width,
 				    dialog_colors, query_callback,
-				    "[Completion]", NULL, DLG_COMPACT);
+				    "[Completion]", NULL, DLG_COMPACT | DLG_REVERSE);
     	    query_list = listbox_new (1, 1, w - 2, h - 2, NULL);
     	    add_widget (query_dlg, query_list);
     	    for (p = in->completions + 1; *p; p++)

+ 1 - 1
src/dlg.c

@@ -262,7 +262,7 @@ add_widget (Dlg_head *h, void *w)
 	h->first = new_item;
     }
 
-    if (!(h->flags & DLG_BACKWARD) || !h->current)
+    if ((h->flags & DLG_REVERSE) || !h->current)
 	h->current = new_item;
 
     return new_item->dlg_id;

+ 1 - 1
src/dlg.h

@@ -135,7 +135,7 @@ Dlg_head *create_dlg (int y1, int x1, int lines, int cols,
 
 /* The flags: */
 #define DLG_WANT_IDLE   64	/* Dialog wants idle events */
-#define DLG_BACKWARD    32	/* Tab order is reverse to the index order */
+#define DLG_REVERSE     32	/* Tab order is opposite to the add order */
 #define DLG_WANT_TAB    16	/* Should the tab key be sent to the dialog? */
 #define DLG_HAS_MENUBAR  8	/* GrossHack: Send events on row 1 to a menubar? */
 #define DLG_COMPACT      4	/* Suppress spaces around the frame */

Some files were not shown because too many files changed in this diff