+2002-02-25 Ian Roxborough <irox@redhat.com>
+
+ * 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 <tromey@redhat.com>
* library/tclIndex: Updated.
$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 <Return> \
+ "$callback forwards \[eval %W get\]"
+ $Tool itembind searchbox <Shift-Return> \
+ "$callback backwards \[eval %W get\]"
+
+ $Tool add separator
+
$Tool toolbar_button_right_justify
create_stack_buttons
$_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]} {
}
# ------------------------------------------------------------------
-# 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
}
# ------------------------------------------------------------------
method clear_file {}
method get_file {}
method is_fixed {}
+ method search {direction string}
proc choose_and_update {}
proc choose_and_display {tag linespec}
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}