OSDN Git Service

Fixed the partial implementation of the text wrapping option
authorlsmith <lsmith>
Wed, 1 Nov 2000 22:15:37 +0000 (22:15 +0000)
committerlsmith <lsmith>
Wed, 1 Nov 2000 22:15:37 +0000 (22:15 +0000)
in the console window, and added a way to select the new
option from the globalprefs.

gdb/gdbtk/library/ChangeLog
gdb/gdbtk/library/console.itb
gdb/gdbtk/library/globalpref.itb

index dd0ece6..d988ef1 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-01  Larry Smith  <lsmith@redhat.com>
+
+        * console.itb (_build_win): Added code to remove horizontal
+        scrollbar by setting -hscrollmode none, which enables the
+        console widget to wrap text properly.
+        * globalpref.itb (build_win): added checkbutton to enable
+        wrapping text in the console window.
+
 2000-10-31  Larry Smith  <lsmith@redhat.com>
 
         * targetselection.ith (run_method): Add variable for
index 51dd270..067da04 100644 (file)
@@ -34,12 +34,19 @@ body Console::destructor {} {
 }
   
 body Console::_build_win {} {
-  iwidgets::scrolledtext $itk_interior.stext -hscrollmode dynamic \
+  set wrap [pref get gdb/console/wrap]
+
+  if { $wrap } {
+    set hsm none
+  } else {
+    set hsm dynamic
+  }
+  iwidgets::scrolledtext $itk_interior.stext -hscrollmode $hsm \
     -vscrollmode dynamic -textbackground white
 
   set _twin [$itk_interior.stext component text]
 
-  if {[pref get gdb/console/wrap]} {
+  if {$wrap} {
     $_twin configure -wrap word
   } else {
     $_twin configure -wrap none
index cd61e90..a7eb809 100644 (file)
@@ -189,13 +189,20 @@ body GlobalPref::build_win {} {
     pack $frame.use_icons.cb -pady 10 -side left -fill none 
   }
 
+  # console wrap
+  frame $frame.consolewrap
+  checkbutton $frame.consolewrap.cw -text "wrap text in console window" \
+    -variable [pref varname gdb/console/wrap]
+  pack $frame.consolewrap.cw -pady 10 -side left -fill none
+
   pack $frame.icons.lab $frame.icons.cb -side left
   pack $frame.icons -side top -padx 10 -pady 10
   pack $frame.tracing -side top -fill x -expand 0 -side bottom
   pack $frame.browser -side top -fill x -expand 0 -side bottom
   if {$tcl_platform(platform) == "unix"} {
-  pack $frame.use_icons -side top -fill x -expand 0 -side bottom
+    pack $frame.use_icons -side top -fill x -expand 0 -side bottom
   }
+  pack $frame.consolewrap -side top -fill x -expand 0 -side bottom
   pack $frame.d -side top -fill both -expand yes
 
   # make buttons