* 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/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...
#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.
}
# ------------------------------------------------------------------
- # 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.
#
# 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
}
# ------------------------------------------------------------------
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.
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
####################################################################
#
}
}
- 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
####################################################################