OSDN Git Service

2001-01-04 Fernando Nasser <fnasser@totem.toronto.redhat.com>
authorfnasser <fnasser>
Thu, 4 Jan 2001 17:27:02 +0000 (17:27 +0000)
committerfnasser <fnasser>
Thu, 4 Jan 2001 17:27:02 +0000 (17:27 +0000)
* library/gdbmenubar.itcl (set_class_state): New public method.
Standard method to control state by class.
(menubar_menu_class_find): Delete public accessor method.
(menubar_change_menu_state): Change the state of a menu item
not of a whole class list.
* library/srcmenubar.itcl (enable_ui): Use set_class_state instead
of prying into base class internal data.
        * library/gdbtoolbar.itcl (set_class_state): New public method.
        Standard method to control state by class.
        (toolbar_button_class_find): Delete public accessor method.
* library/srctoolbar.itcl (enable_ui): Use set_class_state instead
of prying into base class internal data.

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/gdbmenubar.itcl
gdb/gdbtk/library/gdbtoolbar.itcl
gdb/gdbtk/library/srctoolbar.itcl

index d540563..c731479 100644 (file)
@@ -1,5 +1,20 @@
 2001-01-04  Fernando Nasser  <fnasser@totem.toronto.redhat.com>
 
+       * library/gdbmenubar.itcl (set_class_state): New public method.
+       Standard method to control state by class.
+       (menubar_menu_class_find): Delete public accessor method.
+       (menubar_change_menu_state): Change the state of a menu item
+       not of a whole class list.
+       * library/srcmenubar.itcl (enable_ui): Use set_class_state instead
+       of prying into base class internal data.
+        * library/gdbtoolbar.itcl (set_class_state): New public method.
+        Standard method to control state by class.
+        (toolbar_button_class_find): Delete public accessor method.
+       * library/srctoolbar.itcl (enable_ui): Use set_class_state instead
+       of prying into base class internal data.
+
+2001-01-04  Fernando Nasser  <fnasser@totem.toronto.redhat.com>
+
        * library/interface.tcl (gdbtk_connect): New proc. Connects to ai
         remote target (code previously at library/gdbmenubar.itcl).
        (disconnect): Rename to...
index fc6b69c..0e6bd7d 100644 (file)
@@ -51,6 +51,27 @@ class GDBMenuBar {
 
     #destroy $this
   }
+
+  # ------------------------------------------------------------------
+  #  METHOD:  set_class_state - standard method to control state by class
+  # ------------------------------------------------------------------
+  public method set_class_state {enable_list} {
+    debug "Enable list is: $enable_list"
+
+    foreach {type state} $enable_list {
+      dbug W $type
+      if {[info exists menu_classes($type)]} {
+        set class_list $menu_classes($type)
+        if {[llength $class_list]} {
+          dbug W "$type $state \{$class_list\}"
+          foreach menu $class_list {
+            dbug W "$type $menu $state"
+            menubar_change_menu_state $menu $state
+          }
+        }
+      }
+    }
+  }
 \f
   ####################################################################
   # Methods that deal with menus.
@@ -106,22 +127,6 @@ class GDBMenuBar {
   }
 
   # ------------------------------------------------------------------
-  #  METHOD:  menubar_menu_class_find - Find a menu class and returns
-  #                   its members.
-  # 
-  #  type - the token for the menu class sought
-  #
-  #  RETURNS: class members (list) if the class exists, {} otherwise.
-  # ------------------------------------------------------------------
-  method menubar_menu_class_find {type} {
-    if {[info exists menu_classes($type)]} {
-      return $menu_classes($type)
-    } else {
-      return {}
-    }
-  }
-
-  # ------------------------------------------------------------------
   #  METHOD:  menubar_clear_menu - Deletes the items from one of the
   #                   main menu cascade menus. Also makes this menu
   #                   the target menu.
@@ -185,11 +190,9 @@ class GDBMenuBar {
   #
   # INPUT:  Pass normal or disabled for the state.
   # ------------------------------------------------------------------
-  method menubar_change_menu_state {state menuList} {
+  method menubar_change_menu_state {menu state} {
 
-    foreach elem $menuList {
-      [lindex $elem 0] entryconfigure [lindex $elem 1] -state $state
-    }  
+    [lindex $menu 0] entryconfigure [lindex $menu 1] -state $state
   }
 
   # ------------------------------------------------------------------
index 6e06ffe..eb58d4f 100644 (file)
@@ -62,6 +62,27 @@ class GDBToolBar {
       eval standard_toolbar $ButtonFrame $button_list
     }
   }
+
+  # ------------------------------------------------------------------
+  #  METHOD:  set_class_state - standard method to control state by class
+  # ------------------------------------------------------------------
+  public method set_class_state {enable_list} {
+    debug "Enable list is: $enable_list"
+
+    foreach {type state} $enable_list {
+      dbug W $type
+      if {[info exists button_classes($type)]} {
+        set class_list $button_classes($type)
+        if {[llength $class_list]} {
+          dbug W "$type $state \{$class_list\}"
+         foreach button $class_list {
+            dbug W "$type $button $state"
+           toolbar_configure_button $button -state $state
+         }
+        }
+      }
+    }
+  }
 \f
   ####################################################################
   # Methods that deal with buttons.
@@ -286,22 +307,6 @@ class GDBToolBar {
       debug "Button $first_out is not in button list"
     }
   }
-
-  # ------------------------------------------------------------------
-  #  METHOD:  toolbar_button_class_find - Find a button class and returns
-  #                   its members.
-  # 
-  #  type - the token for the button class sought
-  #
-  #  RETURNS: class members (list) if the class exists, {} otherwise.
-  # ------------------------------------------------------------------
-  method toolbar_button_class_find {type} {
-    if {[info exists button_classes($type)]} {
-      return $button_classes($type)
-    } else {
-      return {}
-    }
-  }
 \f
   ####################################################################
   #
index abd23aa..1345938 100644 (file)
@@ -549,22 +549,7 @@ Do you want to continue?" \
       }
     }
 
-    debug "Enable list is: $enable_list"
-    foreach {type state} $enable_list {
-      dbug W $type
-      set class_list [toolbar_button_class_find $type]
-      if {[llength $class_list]} {
-        dbug W "$type $state \{$class_list\}"
-       foreach button $class_list {
-          dbug W "$type $button $state"
-         toolbar_configure_button $button -state $state
-       }
-      }
-#      if {[info exists menu_classes($type)]} {
-#      change_menu_state $menu_classes($type) $state
-#      }
-    }
-
+    set_class_state $enable_list
   }
 \f
   ####################################################################