From c61f84b87699a1f9179676fd9bec4d2acfd14db5 Mon Sep 17 00:00:00 2001 From: irox Date: Tue, 26 Feb 2002 00:29:06 +0000 Subject: [PATCH] * library/srcbar.itcl (SrcBar::create_buttons): Added "Search in source file" entry box and label to the top row toolbar. * library/srcwin.itb (SrcWin::_build_win): Removed "Search in source file" entry box. (SrcWin::_search): Renamed to "search", add string parameter and cleaned up. * library/srcwin.ith (SrcWin): Removed private method "_search" and added public method "search". --- gdb/gdbtk/ChangeLog | 12 ++++++++++++ gdb/gdbtk/library/srcbar.itcl | 13 +++++++++++++ gdb/gdbtk/library/srcwin.itb | 19 +++---------------- gdb/gdbtk/library/srcwin.ith | 2 +- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 1c0a561421..bc626aa12d 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,15 @@ +2002-02-25 Ian Roxborough + + * library/srcbar.itcl (SrcBar::create_buttons): Added + "Search in source file" entry box and label to the top + row toolbar. + * library/srcwin.itb (SrcWin::_build_win): Removed + "Search in source file" entry box. + (SrcWin::_search): Renamed to "search", add string + parameter and cleaned up. + * library/srcwin.ith (SrcWin): Removed private + method "_search" and added public method "search". + 2002-02-17 Tom Tromey * library/tclIndex: Updated. diff --git a/gdb/gdbtk/library/srcbar.itcl b/gdb/gdbtk/library/srcbar.itcl index 893e969a19..bfae66a327 100644 --- a/gdb/gdbtk/library/srcbar.itcl +++ b/gdb/gdbtk/library/srcbar.itcl @@ -534,6 +534,19 @@ class SrcBar { $Tool add separator } + # Add find in file entry box. + $Tool add label findlabel "Find:" "" -anchor e -font src-font + $Tool add custom searchbox entry "Search in editor" \ + -bd 3 -font src-font -width 10 + + set callback [code $source search] + $Tool itembind searchbox \ + "$callback forwards \[eval %W get\]" + $Tool itembind searchbox \ + "$callback backwards \[eval %W get\]" + + $Tool add separator + $Tool toolbar_button_right_justify create_stack_buttons diff --git a/gdb/gdbtk/library/srcwin.itb b/gdb/gdbtk/library/srcwin.itb index a42522bc1d..ca94b159cf 100644 --- a/gdb/gdbtk/library/srcwin.itb +++ b/gdb/gdbtk/library/srcwin.itb @@ -111,20 +111,9 @@ body SrcWin::_build_win {} { $_statbar.mode list insert end MIXED $_statbar.mode list insert end SRC+ASM - # Search - frame $_statbar.frame - entry $_statbar.frame.search -bd 3 -font src-font -width 10 - bind_plain_key $_statbar.frame.search \ - Return [code $this _search forwards] - bind_plain_key $_statbar.frame.search \ - Shift-Return [code $this _search backwards] - - pack $_statbar.frame -side right -pady 4 -padx 10 -fill y -expand 1 -anchor e pack $_statbar.mode -side right -padx 10 -pady 4 pack $_statbar.name $_statbar.func -side left -pady 4 -padx 10 - pack $_statbar.frame.search -fill x -expand yes - # if user likes control on top... if {[pref get gdb/src/top_control]} { @@ -803,14 +792,12 @@ body SrcWin::reset {} { } # ------------------------------------------------------------------ -# PRIVATE METHOD: _search - search for text or jump to a specific line +# PUBLIC METHOD: search - search for a STRING or jump to a specific line # in source window, going in the specified DIRECTION. # ------------------------------------------------------------------ -body SrcWin::_search {direction} { - set exp [$_statbar.frame.search get] - #debug "searching $direction for \"$exp\"" +body SrcWin::search {direction string} { set_status - set_status [$twin search $exp $direction] 1 + set_status [$twin search $string $direction] 1 } # ------------------------------------------------------------------ diff --git a/gdb/gdbtk/library/srcwin.ith b/gdb/gdbtk/library/srcwin.ith index 0a981b2069..578178765f 100644 --- a/gdb/gdbtk/library/srcwin.ith +++ b/gdb/gdbtk/library/srcwin.ith @@ -51,6 +51,7 @@ class SrcWin { method clear_file {} method get_file {} method is_fixed {} + method search {direction string} proc choose_and_update {} proc choose_and_display {tag linespec} @@ -68,7 +69,6 @@ class SrcWin { method _build_win {} method _exit {} method _name {w {val ""}} - method _search {direction} method _set_name { val {found 1} } method _set_state {varname} method _update_title {name} -- 2.11.0