OSDN Git Service

added instance variable and control logic so the "Run Program" and
authorlsmith <lsmith>
Tue, 31 Oct 2000 20:21:48 +0000 (20:21 +0000)
committerlsmith <lsmith>
Tue, 31 Oct 2000 20:21:48 +0000 (20:21 +0000)
"Continue..." buttons are disabled when the "Exec" target is selected
and nicely framed and labelled separate from other controls.

gdb/gdbtk/library/ChangeLog
gdb/gdbtk/library/targetselection.itb
gdb/gdbtk/library/targetselection.ith

index 83f9324..dd0ece6 100644 (file)
@@ -1,6 +1,17 @@
+2000-10-31  Larry Smith  <lsmith@redhat.com>
+
+        * targetselection.ith (run_method): Add variable for
+        "Run Program" and "Continue..." buttons
+        * targetselection.itb (build_win): put "Run Program" and
+        "Continue From..." buttons into a frame and save them in new
+        run_method variable.
+        * change targetselection.itb (change_target) disables "Run
+        Program" and "Continue..." buttons when the target is "exec",
+        enables them for all others.
+
 2000-10-26  Larry Smith  <lsmith@redhat.com>
 
-        * change targetselection.itb: Run Program and Continue From Last Stop
+        * targetselection.itb: Run Program and Continue From Last Stop
         are now radio buttons rather than checkbuttons
 
 2000-10-26  Mo DeJong  <mdejong@redhat.com>
index 8e876f8..8f51c36 100644 (file)
@@ -487,21 +487,33 @@ body TargetSelection::build_win {} {
   set var [pref varname gdb/src/run_load]
   checkbutton $frame.load -text {Download Program} -variable $var
 
+  set rm_frame [iwidgets::labeledframe $frame.run_method -labelpos nw -labeltext "Run Method" ]
+  set RunMethod [ $rm_frame childsite ]
+
+  set rm_label [label $frame.label -text "Run Method:"]
   set var [pref varname gdb/src/run_cont]
-  radiobutton $frame.cont -text {Continue from Last Stop} -value 1 -variable $var \
+  radiobutton $RunMethod.cont -text {Continue from Last Stop} -value 1 -variable $var \
     -command [code $this set_run run]
   
   set var [pref varname gdb/src/run_run]
-  radiobutton $frame.run -text {Run Program} -value 1 -variable $var \
+  radiobutton $RunMethod.run -text {Run Program} -value 1 -variable $var \
     -command [code $this set_run cont]
 
   # The after attaching command entry
   set _after_entry [entry $frame.aftere]
   label $frame.afterl -text {Command to issue after attaching:}
-  grid $frame.attach $frame.run -sticky w
-  grid $frame.load   $frame.cont -sticky w
-  grid $frame.afterl -sticky we -columnspan 2
-  grid $frame.aftere -sticky we -columnspan 2
+
+  grid $frame.label -column 1 -row 0 -sticky w
+  grid $frame.attach -column 0 -row 1 -ipady 2
+  grid $frame.load -column 0 -row 2 -ipady 2
+
+  grid $RunMethod.run -column 0 -row 1 -sticky w -ipady 2
+  grid $RunMethod.cont -column 0 -row 2 -sticky w -ipady 2
+  
+  grid $rm_frame -column 1 -row 1 -rowspan 2 -sticky nsew -ipady 2
+
+  grid $frame.afterl -row 4 -sticky we -columnspan 2 -ipady 2
+  grid $frame.aftere -sticky we -columnspan 2 -ipady 2
   grid columnconfigure $frame 0 -weight 1
   grid columnconfigure $frame 1 -weight 1
 
@@ -722,6 +734,15 @@ body TargetSelection::config_dialog {t} {
 body TargetSelection::change_target {w {name ""}} {
   if {$name == ""} {return}
   set target [get_target $name]
+
+  if { "$target" == "exec" } {
+    $RunMethod.run configure -state disabled -value 1
+    $RunMethod.cont configure -state disabled
+  } else {
+    $RunMethod.run configure -state normal
+    $RunMethod.cont configure -state normal
+  }
+
   debug "$target"
   set defbaud $gdb_target($target,defbaud)
   pref define gdb/load/$target-baud $defbaud
index cc1f5be..7304dd3 100644 (file)
@@ -55,6 +55,8 @@ class TargetSelection {
     variable MoreButton
     variable MoreFrame
     variable MoreLabel
+
+    variable RunMethod
     
     proc _init_prefs {}
     proc default_port {}