OSDN Git Service

* library/tracedlg.tcl (build_win): Use libgui's
authorKeith Seitz <keiths@redhat.com>
Wed, 29 Aug 2001 00:14:08 +0000 (00:14 +0000)
committerKeith Seitz <keiths@redhat.com>
Wed, 29 Aug 2001 00:14:08 +0000 (00:14 +0000)
Labelledframe instead of tixLabelFrame.
Use iwidgets::scrolledlistbox instead of tixScrolledListbox.
(edit): Check if there is a selection in the listbox
before proceeding.
Escape method callbacks before passing to ActionDlg.

* library/actiondlg.tcl (constructor): Use "gdb_reginfo"

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/actiondlg.tcl
gdb/gdbtk/library/tracedlg.tcl

index 5adef54..e931177 100644 (file)
@@ -1,5 +1,16 @@
 2001-08-28  Keith Seitz  <keiths@redhat.com>
 
+       * library/tracedlg.tcl (build_win): Use libgui's
+       Labelledframe instead of tixLabelFrame.
+       Use iwidgets::scrolledlistbox instead of tixScrolledListbox.
+       (edit): Check if there is a selection in the listbox
+       before proceeding.
+       Escape method callbacks before passing to ActionDlg.
+
+       * library/actiondlg.tcl (constructor): Use "gdb_reginfo"
+
+2001-08-28  Keith Seitz  <keiths@redhat.com>
+
        * library/tdump.tcl (class TdumpWin): Inherit from GDBWin
        and ManagedWin.
        (constructor): Remove old itcl2 handling code and name the
index 1f64984..cffcae8 100644 (file)
@@ -23,7 +23,7 @@ class ActionDlg {
 
     eval itk_initialize $args
 
-    set Registers [gdb_regnames]
+    set Registers [gdb_reginfo name]
     if {$Line != ""} {
       set Locals  [gdb_get_locals "$File:$Line"]
       set Args    [gdb_get_args "$File:$Line"]
index a3124ab..ec35328 100644 (file)
@@ -178,10 +178,10 @@ class TraceDlg {
 
     # The three frames of this dialog
     set bbox [frame $f.bbox];               # for holding OK,CANCEL DELETE buttons
-    tixLabelFrame $f.exp -label "Experiment"
-    set exp [$f.exp subwidget frame];       # the "Experiment" frame
-    tixLabelFrame $f.act -label "Actions"
-    set act [$f.act subwidget frame];       # the "Actions" frame
+    Labelledframe $f.exp -text "Experiment"
+    set exp [$f.exp get_frame];             # the "Experiment" frame
+    Labelledframe $f.act -text "Actions"
+    set act [$f.act get_frame];             # the "Actions" frame
 
     # Setup the button box
     button $bbox.ok     -text OK -command "$this ok" -width 6
@@ -301,14 +301,17 @@ class TraceDlg {
     pack $pass_frame.ent -side right -padx 10 -pady 5
 
     # Actions
-    tixScrolledListBox $act_frame.lb -scrollbar auto 
-    set ActionLB [$act_frame.lb subwidget listbox]
-    $ActionLB configure -selectmode multiple -exportselection 0
+    #tixScrolledListBox $act_frame.lb -scrollbar auto 
+    set ActionLB $act_frame.lb
+    iwidgets::scrolledlistbox $act_frame.lb -hscrollmode dynamic \
+      -vscrollmode dynamic -selectmode multiple -exportselection 0 \
+      -dblclickcommand [code $this edit] \
+      -selectioncommand [code $this set_delete_action_state $ActionLB $new_frame.del_but] \
+      -background [pref get gdb/font/normal_bg]
+    [$ActionLB component listbox] configure -background [pref get gdb/font/normal_bg]
     label $act_frame.lbl -text {Actions}
     pack $act_frame.lbl -side top
     pack $act_frame.lb -side bottom -fill both -expand 1 -padx 5 -pady 5
-    $act_frame.lb configure -command "$this edit" \
-      -browsecmd "$this set_delete_action_state $ActionLB $new_frame.del_but"
 
     # New actions
     combobox::combobox $new_frame.combo -maxheight 15 -editable 0 -font src-font \
@@ -621,49 +624,51 @@ class TraceDlg {
   method edit {} {
     
     set Selection [$ActionLB curselection]
-    set action [$ActionLB get $Selection]
-    if [regexp "collect" $action] {
-      scan $action "collect: %s" data
-      set steps 0
-      set whilestepping 0
-    } elseif [regexp "while-stepping" $action] {
-      scan $action "while-stepping (%d): %s" steps data
-      set whilestepping 1
-    } else {
-      debug "unknown action: $action"
-      return
-    }
+    if {$Selection != ""} {
+      set action [$ActionLB get $Selection]
+      if [regexp "collect" $action] {
+       scan $action "collect: %s" data
+       set steps 0
+       set whilestepping 0
+      } elseif [regexp "while-stepping" $action] {
+       scan $action "while-stepping (%d): %s" steps data
+       set whilestepping 1
+      } else {
+       debug "unknown action: $action"
+       return
+      }
     
-    set data [split $data ,] 
-    set len [llength $data]
-    set real_data {}
-    set special 0
-    for {set i 0} {$i < $len} {incr i} {
-      set a [lindex $data $i]
-      if {[string range $a 0 1] == "\$("} {
-       set special 1
-       set b $a
-      } elseif {$special} {
-       lappend b $a
-       if {[string index $a [expr {[string length $a]-1}]] == ")"} {
-         lappend real_data [join $b ,]
-         set special 0
+      set data [split $data ,] 
+      set len [llength $data]
+      set real_data {}
+      set special 0
+      for {set i 0} {$i < $len} {incr i} {
+       set a [lindex $data $i]
+       if {[string range $a 0 1] == "\$("} {
+         set special 1
+         set b $a
+       } elseif {$special} {
+         lappend b $a
+         if {[string index $a [expr {[string length $a]-1}]] == ")"} {
+           lappend real_data [join $b ,]
+           set special 0
+         }
+       } else {
+         lappend real_data $a
        }
+      }
+
+      # !! lindex $Lines 0 -- better way?
+      if {$Lines != {}} {
+       ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
+         -WhileStepping $whilestepping -Number [lindex $Number 0] \
+         -Callback [list [code $this done]] -Data $real_data -Steps $steps
       } else {
-       lappend real_data $a
+       ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
+         -WhileStepping $whilestepping -Number [lindex $Number 0] \
+         -Callback [list [code $this done]] -Data $real_data -Steps $steps
       }
     }
-    
-    # !! lindex $Lines 0 -- better way?
-    if {$Lines != {}} {
-      ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
-       -WhileStepping $whilestepping -Number [lindex $Number 0] \
-       -Callback "$this done" -Data $real_data -Steps $steps
-    } else {
-      ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
-       -WhileStepping $whilestepping -Number [lindex $Number 0] \
-       -Callback "$this done" -Data $real_data -Steps $steps
-    }
   }
 
   method get_selection {} {