This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[RFA] Move "search in editor" entry box.
- From: Ian Roxborough <irox at redhat dot com>
- To: insight at sources dot redhat dot com
- Date: Tue, 12 Feb 2002 15:10:36 -0800
- Subject: [RFA] Move "search in editor" entry box.
- Organization: Red Hat Inc.
Hi,
this is the next step in the UI "revamp" we discussed
last year.
This patch moves the find/search entry box to the toolbar
above it (where the line number and address used to be).
It also adds a "Find:" label to it as well.
The next step is to label the comboboxes.
Some things to look into later could include
introducing a new font group called "layout fonts"
so we can choose something more pleasing to the
eye than the "source fonts" (i.e. not fixed spacing
and a slightly smaller).
I've tested it on linux and Windows NT.
Ian.
ChangeLog:
* 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".
Index: library/srcbar.itcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcbar.itcl,v
retrieving revision 1.15
diff -p -u -2 -r1.15 srcbar.itcl
--- srcbar.itcl 2002/01/15 19:52:01 1.15
+++ srcbar.itcl 2002/02/12 22:57:37
@@ -535,4 +535,17 @@ class SrcBar {
}
+ # 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
Index: library/srcwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcwin.itb,v
retrieving revision 1.21
diff -p -u -2 -r1.21 srcwin.itb
--- srcwin.itb 2002/01/15 19:52:01 1.21
+++ srcwin.itb 2002/02/12 22:57:39
@@ -112,18 +112,7 @@ body SrcWin::_build_win {} {
$_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]} {
@@ -804,12 +793,10 @@ 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
}
Index: library/srcwin.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcwin.ith,v
retrieving revision 1.9
diff -p -u -2 -r1.9 srcwin.ith
--- srcwin.ith 2002/01/18 17:41:49 1.9
+++ srcwin.ith 2002/02/12 22:57:39
@@ -52,4 +52,5 @@ class SrcWin {
method get_file {}
method is_fixed {}
+ method search {direction string}
proc choose_and_update {}
@@ -69,5 +70,4 @@ class SrcWin {
method _exit {}
method _name {w {val ""}}
- method _search {direction}
method _set_name { val {found 1} }
method _set_state {varname}