This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] 100473 fix



The request was to permit wrapping of text in the console widget
rather then requiring the horizontal scrollbar.  Jim Ingham had
partially implemented this, but it was left unfinished and did
not work as advertised.  The real problem was, in order to enable
wrapping, one had to first tell the scrolledtext widget not to
enable horizontal scrolling.  Once that was done, the interior
text widget would obliging wrap text as desired.  This feature
was previously only available by editing the global prefs file,
I've added a checkbutton to the global prefs page to permit a
user to enable this feature with less hassle.

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.

Index: console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.3
diff -u -r1.3 console.itb
--- console.itb	2000/04/14 14:45:37	1.3
+++ console.itb	2000/11/01 20:51:50
@@ -34,12 +34,19 @@
 }
   
 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: globalpref.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/globalpref.itb,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 globalpref.itb
--- globalpref.itb	2000/02/07 00:19:42	1.1.1.1
+++ globalpref.itb	2000/11/01 20:51:51
@@ -189,13 +189,20 @@
     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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]