OSDN Git Service

* library/srcbar.itcl (SrcBar::create_buttons): Added
authorirox <irox>
Tue, 26 Feb 2002 00:29:06 +0000 (00:29 +0000)
committerirox <irox>
Tue, 26 Feb 2002 00:29:06 +0000 (00:29 +0000)
"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
gdb/gdbtk/library/srcbar.itcl
gdb/gdbtk/library/srcwin.itb
gdb/gdbtk/library/srcwin.ith

index 1c0a561..bc626aa 100644 (file)
@@ -1,3 +1,15 @@
+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.
index 893e969..bfae66a 100644 (file)
@@ -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 <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
index a42522b..ca94b15 100644 (file)
@@ -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
 }
 
 # ------------------------------------------------------------------
index 0a981b2..5781787 100644 (file)
@@ -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}