TextView.st
changeset 5734 46a234de32de
parent 5727 59553507b326
child 5735 5fbcb3739f7c
equal deleted inserted replaced
5733:e231929d9e70 5734:46a234de32de
  2236         self resetVariablesBeforeNewSearch.
  2236         self resetVariablesBeforeNewSearch.
  2237         searchBarActionBlock value:#search value:self.
  2237         searchBarActionBlock value:#search value:self.
  2238         ^ self
  2238         ^ self
  2239     ].
  2239     ].
  2240 
  2240 
  2241     modal := (UserPreferences current searchDialogIsModal).   "/ thats experimental
  2241     modal := (UserPreferences current searchDialogIsModal).   "/ that's experimental
  2242 
  2242 
       
  2243     (searchBox := self objectAttributeAt:#currentModelessSearchBox) notNil ifTrue:[
       
  2244         (modal not
       
  2245         and:[ searchBox created ]) ifTrue:[
       
  2246             "/ reuse it.
       
  2247             searchBox raiseDeiconified.
       
  2248             ^ self.
       
  2249         ].    
       
  2250         searchBox closeRequest.
       
  2251     ].
       
  2252     
  2243     ign := lastSearchIgnoredCase "? LastSearchIgnoredCase " ? true.
  2253     ign := lastSearchIgnoredCase "? LastSearchIgnoredCase " ? true.
  2244     caseHolder := ign not asValue.
  2254     caseHolder := ign not asValue.
  2245 
  2255 
  2246     match := lastSearchWasMatch ? LastSearchWasMatch ? false.
  2256     match := lastSearchWasMatch ? LastSearchWasMatch ? false.
  2247     matchHolder := match asValue.
  2257     matchHolder := match asValue.
  2340                         ].
  2350                         ].
  2341                         "/ self searchVariableWithSyntaxElement:selectedVariable forward:false
  2351                         "/ self searchVariableWithSyntaxElement:selectedVariable forward:false
  2342                     ].
  2352                     ].
  2343             ].
  2353             ].
  2344 
  2354 
  2345             replaceAction := [ self replace:replacement ].
  2355             replaceAction := [ self replace:replacement ]. "/ not implemented here, but in subclasses
  2346             replacePreserveCaseBooleanHolder value ifTrue:[
  2356             replacePreserveCaseBooleanHolder value ifTrue:[
  2347                 replaceAction := [
  2357                 replaceAction := [
  2348                     self selectionAsString isUppercaseFirst ifTrue:[
  2358                     self selectionAsString isUppercaseFirst ifTrue:[
  2349                         self replace:replacement asUppercaseFirst
  2359                         self replace:replacement asUppercaseFirst
  2350                     ] ifFalse:[
  2360                     ] ifFalse:[
  2462     modal ifTrue:[
  2472     modal ifTrue:[
  2463         searchBox := SimpleDialog new.
  2473         searchBox := SimpleDialog new.
  2464     ] ifFalse:[
  2474     ] ifFalse:[
  2465         searchBox := ApplicationModel new.
  2475         searchBox := ApplicationModel new.
  2466         searchBox createBuilder.
  2476         searchBox createBuilder.
       
  2477         bindings at:#cancel put:[ searchBox closeRequest ].
  2467     ].
  2478     ].
  2468     searchBox resources:(self resources).
  2479     searchBox resources:(self resources).
  2469 
  2480 
  2470     bldr := searchBox builder.
  2481     bldr := searchBox builder.
  2471     bldr addBindings:bindings.
  2482     bldr addBindings:bindings.
  2487                 action:[searchBox closeRequest].
  2498                 action:[searchBox closeRequest].
  2488         "/ searchBox masterApplication:self application.
  2499         "/ searchBox masterApplication:self application.
  2489         self topView beMaster.
  2500         self topView beMaster.
  2490         searchBox window
  2501         searchBox window
  2491                 beSlave;
  2502                 beSlave;
  2492                 openInGroup:(self windowGroup).
  2503                 openInGroup:(self windowGroup);
  2493 
  2504                 waitUntilVisible;
  2494         "/ searchBox window open.
  2505                 assignKeyboardFocusToFirstKeyboardConsumer.
  2495         searchBox window assignKeyboardFocusToFirstKeyboardConsumer.
  2506         "/ remember this box for me.
       
  2507         self objectAttributeAt:#currentModelessSearchBox put:searchBox.
  2496     ]
  2508     ]
  2497 
  2509 
  2498     "Modified: / 11-07-2006 / 11:18:38 / fm"
  2510     "Modified: / 11-07-2006 / 11:18:38 / fm"
  2499     "Created: / 08-03-2012 / 14:02:59 / cg"
  2511     "Created: / 08-03-2012 / 14:02:59 / cg"
  2500 !
  2512 !