#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 13 Sep 2018 10:26:31 +0200
changeset 6428 ee9bb5de3bbc
parent 6427 bee3455ad4fb
child 6429 5bc480285a06
#FEATURE by cg class: TextView changed: #openSearchBoxAndSearchWithReplaceChecked: +search at end of line only class: TextView class changed: #helpSpec #searchDialogSpec
TextView.st
--- a/TextView.st	Wed Sep 12 18:36:05 2018 +0200
+++ b/TextView.st	Thu Sep 13 10:26:31 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -364,6 +366,9 @@
 #searchAtBeginOfLineOnly
 'Search only for the string at the beginning of a line'
 
+#searchAtEndOfLineOnly
+'Search only for the string at the end of a line'
+
 #searchPattern
 'String or match-pattern to be searched'
 
@@ -388,6 +393,8 @@
 #matchWithRegex
 'Use regex pattern for search (as opposed to GLOB pattern)'
 )
+
+    "Modified: / 13-09-2018 / 10:03:15 / Claus Gittinger"
 ! !
 
 !TextView class methodsFor:'interface specs'!
@@ -408,7 +415,7 @@
     ^ 
     #(FullSpec
        name: searchDialogSpec
-       uuid: '391489e6-869a-11e8-80e0-b8f6b1108e05'
+       uuid: '218d9e60-b72e-11e8-aeef-b8f6b1108e05'
        window: 
       (WindowSpec
          label: 'String search'
@@ -416,7 +423,7 @@
          uuid: 'c93c164e-8698-11e8-80e0-b8f6b1108e05'
          min: (Point 10 10)
          max: (Point 1280 1024)
-         bounds: (Rectangle 0 0 475 376)
+         bounds: (Rectangle 0 0 551 407)
        )
        component: 
       (SpecCollection
@@ -464,7 +471,7 @@
                    tabable: true
                    model: caseSensitive
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (ViewSpec
                    name: 'MatchBox'
@@ -496,7 +503,7 @@
                       )
                     
                    )
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: 'Search Full Words'
@@ -508,7 +515,7 @@
                    tabable: true
                    model: searchFullWord
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: 'At Begin of Line Only'
@@ -519,7 +526,19 @@
                    tabable: true
                    model: searchAtBeginOfLineOnly
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
+                 )
+                (CheckBoxSpec
+                   label: 'At End of Line Only'
+                   name: 'CheckBox7'
+                   activeHelpKey: searchAtEndOfLineOnly
+                   uuid: 'c93c2ac6-8698-11e8-80e0-b8f6b1108e05'
+                   level: 0
+                   enableChannel: atEndOfLineOnlyEnabled
+                   tabable: true
+                   model: searchAtEndOfLineOnly
+                   translateLabel: true
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: 'Variable Only'
@@ -533,7 +552,7 @@
                    model: searchVariable
                    translateLabel: true
                    labelChannel: stringWithVariableUnderCursorHolder
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: 'Select Lines'
@@ -549,19 +568,19 @@
                  )
                 (CheckBoxSpec
                    label: 'Wrap at End of Text (forward only)'
-                   name: 'CheckBox7'
+                   name: 'CheckBox8'
                    activeHelpKey: searchWithWrap
                    uuid: 'c93c2e2c-8698-11e8-80e0-b8f6b1108e05'
                    level: 0
                    tabable: true
                    model: wrapAtEndOfTextHolder
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (ViewSpec
                    name: 'Box1'
                    uuid: 'c93c2f44-8698-11e8-80e0-b8f6b1108e05'
-                   extent: (Point 475 10)
+                   extent: (Point 551 10)
                  )
                 (HorizontalPanelViewSpec
                    name: 'HorizontalPanel1'
@@ -596,16 +615,16 @@
                          acceptOnReturn: true
                          acceptOnTab: true
                          acceptOnPointerLeave: true
-                         extent: (Point 344 24)
+                         extent: (Point 416 24)
                        )
                       )
                     
                    )
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: '  Replace All (to End of Text)'
-                   name: 'CheckBox8'
+                   name: 'CheckBox9'
                    activeHelpKey: replaceAll
                    uuid: 'c93c353e-8698-11e8-80e0-b8f6b1108e05'
                    level: 0
@@ -613,11 +632,11 @@
                    tabable: true
                    model: replaceAllBoolean
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 (CheckBoxSpec
                    label: '  Preserve Case'
-                   name: 'CheckBox9'
+                   name: 'CheckBox10'
                    activeHelpKey: replacePreserveCase
                    uuid: 'c93c366a-8698-11e8-80e0-b8f6b1108e05'
                    level: 0
@@ -625,7 +644,7 @@
                    tabable: true
                    model: replacePreserveCaseBoolean
                    translateLabel: true
-                   extent: (Point 475 24)
+                   extent: (Point 551 24)
                  )
                 )
               
@@ -633,7 +652,7 @@
            )
           (HorizontalPanelViewSpec
              name: 'horizontalPanelView'
-             layout: (LayoutFrame 20 0.0 -36 1.0 -30 1.0 0 1.0)
+             layout: (LayoutFrame 20 0.0 -38 1.0 -30 1.0 -2 1.0)
              uuid: 'c93c3908-8698-11e8-80e0-b8f6b1108e05'
              level: 0
              horizontalLayout: leftSpace
@@ -653,7 +672,7 @@
                    translateLabel: true
                    tabable: true
                    model: cancel
-                   useDefaultExtent: true
+                   extent: (Point 85 36)
                  )
                 (ViewSpec
                    name: 'Box2'
@@ -692,7 +711,8 @@
                          tabable: true
                          model: nextAction
                          isDefault: true
-                         useDefaultExtent: true
+                         defaultable: true
+                         extent: (Point 101 36)
                        )
                       (ActionButtonSpec
                          label: 'Last'
@@ -708,7 +728,7 @@
                       )
                     
                    )
-                   extent: (Point 250 36)
+                   extent: (Point 320 36)
                  )
                 )
               
@@ -2510,7 +2530,7 @@
      bindings bldr doSearch modal searchVariableHolder selectedVariable searchFullWordHolder selectLinesHolder
      replaceBooleanEnabledHolder replaceBooleanHolder replaceTextHolder
      replaceAllBooleanHolder replacePreserveCaseBooleanHolder
-     searchAtBeginOfLineOnlyHolder updateReturnKeyBehavior|
+     searchAtBeginOfLineOnlyHolder searchAtEndOfLineOnlyHolder updateReturnKeyBehavior|
 
     searchBarActionBlock notNil ifTrue:[
         self resetVariablesBeforeNewSearch.
@@ -2544,6 +2564,7 @@
     searchVariableHolder := (lastSearchWasVariableSearch ? false) asValue.
     searchFullWordHolder := replaceChecked asValue.
     searchAtBeginOfLineOnlyHolder := false asValue.
+    searchAtEndOfLineOnlyHolder := false asValue.
     selectLinesHolder := false asValue.
     replaceBooleanHolder := replaceChecked asValue.
     replaceAllBooleanHolder := replaceChecked asValue.
@@ -2619,7 +2640,8 @@
                                 fullWord: searchFullWordHolder value
                                 forward:fwd
                                 atBeginOfLineOnly:searchAtBeginOfLineOnlyHolder value
-                                wrapAtEnd:wrapAtEndHolder value).
+                                wrapAtEnd:wrapAtEndHolder value;
+                                atEndOfLineOnly:searchAtEndOfLineOnlyHolder value).
                     ]
             ]
         ].
@@ -2750,9 +2772,12 @@
     bindings at:#searchFullWord put:searchFullWordHolder.
     bindings at:#searchFullWordEnabled put:true.
     bindings at:#searchAtBeginOfLineOnly put:searchAtBeginOfLineOnlyHolder.
+    bindings at:#searchAtEndOfLineOnly put:searchAtEndOfLineOnlyHolder.
     bindings at:#wrapAtEndOfTextHolder put:wrapAtEndHolder.
     bindings at:#selectLinesHolder put:selectLinesHolder.
 
+    bindings at:#atEndOfLineOnlyEnabled put:(BlockValue forLogicalNot:matchHolder).
+
     bindings at:#replaceEnabled put:replaceBooleanEnabledHolder.
     bindings at:#replaceBoolean put:replaceBooleanHolder.
     bindings at:#replaceAllBoolean put:replaceAllBooleanHolder.
@@ -2835,7 +2860,7 @@
     ]
 
     "Created: / 22-05-2018 / 15:47:29 / Claus Gittinger"
-    "Modified: / 13-07-2018 / 14:46:29 / Claus Gittinger"
+    "Modified: / 13-09-2018 / 10:23:59 / Claus Gittinger"
 !
 
 openWebBrowserOnIt