From 9ede7a19f85fb4a05aeddc99f1f26253e5936793 Mon Sep 17 00:00:00 2001 From: lsmith Date: Wed, 1 Nov 2000 22:15:37 +0000 Subject: [PATCH] Fixed the partial implementation of the text wrapping option in the console window, and added a way to select the new option from the globalprefs. --- gdb/gdbtk/library/ChangeLog | 8 ++++++++ gdb/gdbtk/library/console.itb | 11 +++++++++-- gdb/gdbtk/library/globalpref.itb | 9 ++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/gdb/gdbtk/library/ChangeLog b/gdb/gdbtk/library/ChangeLog index dd0ece662e..d988ef1113 100644 --- a/gdb/gdbtk/library/ChangeLog +++ b/gdb/gdbtk/library/ChangeLog @@ -1,3 +1,11 @@ +2000-11-01 Larry Smith + + * 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 * targetselection.ith (run_method): Add variable for diff --git a/gdb/gdbtk/library/console.itb b/gdb/gdbtk/library/console.itb index 51dd270ca1..067da0460b 100644 --- a/gdb/gdbtk/library/console.itb +++ b/gdb/gdbtk/library/console.itb @@ -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 diff --git a/gdb/gdbtk/library/globalpref.itb b/gdb/gdbtk/library/globalpref.itb index cd61e90694..a7eb809864 100644 --- a/gdb/gdbtk/library/globalpref.itb +++ b/gdb/gdbtk/library/globalpref.itb @@ -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 -- 2.11.0