antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright/src/arshell menubar.c


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/src/arshell menubar.c
Date: Sat, 14 Aug 2004 07:54:50 -0400

CVSROOT:        /cvsroot/antiright
Module name:    antiright
Branch:         
Changes by:     Jeffrey Bedard <address@hidden> 04/08/13 19:53:54

Modified files:
        src/arshell    : menubar.c 

Log message:
        Refactored arshell_setup_work_menubar(), extracting 
arshell_setup_editor_toolbar() and arshell_hide_sticky_note_toolbar().  The 
test for a non-NULL menubar now tests the menubar widget rather than the file 
menu widget.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/menubar.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: antiright/src/arshell/menubar.c
diff -u antiright/src/arshell/menubar.c:1.2 antiright/src/arshell/menubar.c:1.3
--- antiright/src/arshell/menubar.c:1.2 Fri Aug 13 19:32:51 2004
+++ antiright/src/arshell/menubar.c     Fri Aug 13 19:53:54 2004
@@ -108,10 +108,70 @@
 }
 
 void
+arshell_hide_sticky_note_toolbar()
+{
+  char *title;
+  ARCLARG;
+  antiright_set(XmNtitle, (XtArgVal)&title);
+  antiright_get_values(antiright.parent_widget);
+  puts(title);
+  if((title[0]=='S') & (title[1]=='t') & (title[2]=='i'))
+    {
+      XtUnmanageChild(arshell.edit.toolbar);
+    }
+  ARCLARG;
+}
+
+void
+arshell_setup_editor_toolbar()
+{
+  Widget button;
+  arshell_initialize_row_manager();
+  ARCLARG;
+  antiright_set(XmNmarginWidth, 0);
+  antiright_set(XmNmarginHeight, 0);
+  antiright_set(XmNpacking, XmPACK_TIGHT);
+  antiright_set(XmNorientation, XmHORIZONTAL);
+  antiright_set(XmNspacing, 0);
+  arshell.edit.toolbar=
+    antiright_row(arshell.gui.layout.row_manager_widget);
+
+  arshell_hide_sticky_note_toolbar();
+       
+  ARCLARG;
+  button=antiright_button(arshell.edit.toolbar, "Open", arshell_open_cb, 
+                         NULL);
+  antiright_set_tooltip(button, "Open a file.  ");
+  button=antiright_button(arshell.edit.toolbar, "Save", 
+                         arshell_save_work_area, NULL);
+  antiright_set_tooltip(button, "Save the current file.  ");
+  button=antiright_button(arshell.edit.toolbar, "Print", 
+                         arshell_print_cb, NULL);
+  antiright_set_tooltip(button, "Print the current file.  ");
+  button=antiright_button(arshell.edit.toolbar, "Cut", antiright_cut_cb, 
+                         arshell.gui.widgets.work);
+  antiright_set_tooltip(button, "Cut a selection into the clipboard.");
+  button=antiright_button(arshell.edit.toolbar, "Copy", 
+                         antiright_copy_cb, 
+                         arshell.gui.widgets.work);
+  antiright_set_tooltip(button, "Copy a selection into the clipboard");
+  button=antiright_button(arshell.edit.toolbar, "Paste", 
+                         antiright_paste_cb, 
+                         arshell.gui.widgets.work);
+  antiright_set_tooltip(button, "Paste the contents of the clipboard.");
+  button=antiright_button(arshell.edit.toolbar, "Search", 
+                         arshell_search_cb, NULL);
+  antiright_set_tooltip(button, "Search for text.");
+  button=antiright_button(arshell.edit.toolbar, "Replace", 
+                         arshell_replace_cb, NULL);
+  antiright_set_tooltip(button, "Find and replace text.");
+}
+
+void
 arshell_setup_work_menubar()
 {
   ARCLARG;
-  if(arshell.gui.menubar.file_widget != NULL)
+  if(arshell.gui.menubar.menubar_widget != NULL)
     {
       antiright_button(arshell.gui.menubar.file_widget, "Save",
                       arshell_save_work_area, NULL);
@@ -134,57 +194,6 @@
       antiright_button(arshell.gui.menubar.edit_widget, "Find at Cursor",
                       arshell_find_at_cursor_cb, NULL);
       antiright_separator(arshell.gui.menubar.view_widget);
-      {
-       Widget button;
-       arshell_initialize_row_manager();
-       ARCLARG;
-       antiright_set(XmNmarginWidth, 0);
-       antiright_set(XmNmarginHeight, 0);
-       antiright_set(XmNpacking, XmPACK_TIGHT);
-       antiright_set(XmNorientation, XmHORIZONTAL);
-       antiright_set(XmNspacing, 0);
-       arshell.edit.toolbar=
-         antiright_row(arshell.gui.layout.row_manager_widget);
-       {
-         char *title;
-         ARCLARG;
-         antiright_set(XmNtitle, (XtArgVal)&title);
-         antiright_get_values(antiright.parent_widget);
-         puts(title);
-         if((title[0]=='S') & (title[1]=='t') & (title[2]=='i'))
-           {
-             XtUnmanageChild(arshell.edit.toolbar);
-           }
-         ARCLARG;
-       }
-       
-       ARCLARG;
-       button=antiright_button(arshell.edit.toolbar, "Open", arshell_open_cb, 
-                               NULL);
-       antiright_set_tooltip(button, "Open a file.  ");
-       button=antiright_button(arshell.edit.toolbar, "Save", 
-                               arshell_save_work_area, NULL);
-       antiright_set_tooltip(button, "Save the current file.  ");
-       button=antiright_button(arshell.edit.toolbar, "Print", 
-                               arshell_print_cb, NULL);
-       antiright_set_tooltip(button, "Print the current file.  ");
-       button=antiright_button(arshell.edit.toolbar, "Cut", antiright_cut_cb, 
-                               arshell.gui.widgets.work);
-       antiright_set_tooltip(button, "Cut a selection into the clipboard.");
-       button=antiright_button(arshell.edit.toolbar, "Copy", 
-                               antiright_copy_cb, 
-                               arshell.gui.widgets.work);
-       antiright_set_tooltip(button, "Copy a selection into the clipboard");
-       button=antiright_button(arshell.edit.toolbar, "Paste", 
-                               antiright_paste_cb, 
-                               arshell.gui.widgets.work);
-       antiright_set_tooltip(button, "Paste the contents of the clipboard.");
-       button=antiright_button(arshell.edit.toolbar, "Search", 
-                               arshell_search_cb, NULL);
-       antiright_set_tooltip(button, "Search for text.");
-       button=antiright_button(arshell.edit.toolbar, "Replace", 
-                               arshell_replace_cb, NULL);
-       antiright_set_tooltip(button, "Find and replace text.");
-      }
     }
+  arshell_setup_editor_toolbar(0);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]