From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13325 invoked by alias); 12 Feb 2002 23:20:56 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 13151 invoked from network); 12 Feb 2002 23:20:53 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 12 Feb 2002 23:20:53 -0000 Received: from localhost.localdomain (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with SMTP id PAA23289 for ; Tue, 12 Feb 2002 15:20:49 -0800 (PST) Date: Tue, 12 Feb 2002 15:20:00 -0000 From: Ian Roxborough To: insight@sources.redhat.com Subject: [RFA] Move "search in editor" entry box. Message-Id: <20020212151036.70a8328f.irox@redhat.com> Organization: Red Hat Inc. X-Mailer: Sylpheed version 0.6.5 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2002-q1/txt/msg00109.txt.bz2 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 \ + "$callback forwards \[eval %W get\]" + $Tool itembind searchbox \ + "$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}