public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Move "search in editor" entry box.
@ 2002-02-12 15:20 Ian Roxborough
  2002-02-12 15:23 ` Keith Seitz
  2002-02-25 12:31 ` Keith Seitz
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Roxborough @ 2002-02-12 15:20 UTC (permalink / raw)
  To: insight


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}



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [RFA] Move "search in editor" entry box.
@ 2002-02-18 15:36 Ian Roxborough
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Roxborough @ 2002-02-18 15:36 UTC (permalink / raw)
  To: insight


Assuming this is still open for discussion....

On Tue, 12 Feb 2002 15:33:12 -0800 (PST) Ian Roxborough wrote:
>On Tue, 12 Feb 2002 15:23:26 -0800 (PST) Keith Seitz wrote:
> 
>> I thought we were going to move it to a dialog which would allow you to
>> search for text, regexp, match case, goto a line number, etc?
>
> Yeah, that would be it's intended and prefered destination.

I'll retract that statement.  I don't think moving it into a
dialog would improve Insight.  I do think that there is room
for both a search box on the toolbar and a pop search dialog
with extended features. 

I think removing the search box from toolbar will only add
extra hoops for users to jump through to perform a simple
search. (If you had the choise, which would you use for a
simple string search.)

Anyway I would still like to check this patch in, once I've
moved the find box, I can submit the patch to label the
comboboxes.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-25 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-12 15:20 [RFA] Move "search in editor" entry box Ian Roxborough
2002-02-12 15:23 ` Keith Seitz
2002-02-12 15:43   ` Ian Roxborough
2002-02-25 12:31 ` Keith Seitz
2002-02-18 15:36 Ian Roxborough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).