Module: environment-deuce Synopsis: Searching Editor Frames Author: Chris Page Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Searching editor frames; search the frame's window define method can-find-in-frame? (frame :: ) => (can-find? :: ) let window = frame-window(frame); (window & can-find-in-window?(window)) & #t end method can-find-in-frame?; define method can-replace-in-frame? (frame :: ) => (can-replace? :: ) let window = frame-window(frame); (window & can-replace-in-window?(window)) & #t end method can-replace-in-frame?; //---*** cpage: 1998.08.07 This method is left over from the old // editor-specific searching protocols. Delete eventually. /// BEGIN DELETE define sealed method frame-search-string-found?-setter (found? :: false-or(), frame :: ) => (found? :: false-or()) next-method(); note-frame-searching-updated(frame); found? end method frame-search-string-found?-setter; /// END DELETE define method find-in-frame (frame :: , search-string :: , #rest keys, #key from-selection? :: , backwards? :: , wrap? :: , match-case? :: , match-word? :: , match-regexp? :: , progress-callback :: false-or()) => (object :: ) let window :: = frame-window(frame); apply(find-in-window, window, search-string, keys) end method find-in-frame; define method replace-in-frame (frame :: , search-string :: , replace-string :: , #rest keys, #key match-case? :: , match-word? :: , match-regexp? :: , progress-callback :: false-or()) => (object :: ) let window :: = frame-window(frame); apply(replace-in-window, window, search-string, replace-string, keys) end method replace-in-frame; // Reveal and select matched/replaced text //---*** cpage: 1998.07.29 Eventually this should be made more robust in the // face of user changes to text and buffers so that revealing a // match from a batch search fails gracefully and returns #f. define method frame-reveal-search-object (frame :: , object :: ) => (revealed? :: ) //--- cpage: 1998.08.20 Delete this flag eventually, as it is only // used by older searching code written before the // integration with environment-framework searching. frame-search-string-found?(frame) := frame-buffer(frame); // Note that we don't store the window with the object; we always reuse the // frame's current window. let window :: = frame-window(frame); window-reveal-search-object(window, object) end method frame-reveal-search-object;