RCSConflictEditTextView.st
changeset 1749 044c5af08830
child 1750 1e7547bc0724
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RCSConflictEditTextView.st	Mon Jul 27 12:36:03 1998 +0200
@@ -0,0 +1,138 @@
+EditTextView subclass:#RCSConflictEditTextView
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Views-Text'
+!
+
+!RCSConflictEditTextView class methodsFor:'documentation'!
+
+history
+
+    "Created: / 27.7.1998 / 12:19:24 / cg"
+    "Created: #initialize / 27.7.1998 / 12:19:45 / cg"
+    "Modified: #initialize / 27.7.1998 / 12:22:31 / cg"
+    "Created: #moveToPreviousChanged / 27.7.1998 / 12:25:34 / cg"
+    "Created: #moveToNextChanged / 27.7.1998 / 12:26:24 / cg"
+    "Modified: #moveToNextChanged / 27.7.1998 / 12:26:43 / cg"
+    "Modified: #moveToPreviousChanged / 27.7.1998 / 12:26:48 / cg"
+    "Modified: #moveToPreviousChanged / 27.7.1998 / 12:27:17 / cg"
+    "Modified: #moveToNextChanged / 27.7.1998 / 12:27:21 / cg"
+    "Modified: #moveToNextChanged / 27.7.1998 / 12:29:24 / cg"
+    "Modified: #moveToPreviousChanged / 27.7.1998 / 12:29:31 / cg"
+    "Modified: #moveToPreviousChanged / 27.7.1998 / 12:30:54 / cg"
+    "Modified: #moveToPreviousChanged / 27.7.1998 / 12:31:26 / cg"
+! !
+
+!RCSConflictEditTextView methodsFor:'actions'!
+
+moveToNextChanged
+    "somewhat of a kludge - simply search for the next text-item"
+
+    |start end lnNr max list|
+
+    start := self lastLineShown + 1.
+
+    list := self list.
+    max  := list size.
+    lnNr := start.
+
+    [(lnNr > max or:[(list at:lnNr) isText])
+    ] whileFalse:[
+        lnNr := lnNr + 1
+    ].
+
+    (lnNr <= max) ifTrue:[
+        (end isNil or:[lnNr < end]) ifTrue:[
+            end := lnNr.
+        ]
+    ].
+
+    end notNil ifTrue:[
+        self scrollToLine:end
+    ] ifFalse:[
+        self beep
+    ].
+
+    "Modified: / 27.7.1998 / 12:29:24 / cg"
+!
+
+moveToPreviousChanged
+    "somewhat of a kludge - simply search for the previous text-item"
+
+    |start end found lnNr list|
+
+    start := firstLineShown - 1.
+    end   := 1.
+    found := false.
+
+    start > 1 ifTrue:[
+        list := self list.
+        lnNr := list size.
+
+        lnNr >= start ifTrue:[
+            lnNr := start
+        ].
+
+        [(lnNr == end or:[(list at:lnNr) isText])
+        ] whileFalse:[
+            lnNr := lnNr - 1
+        ].
+        (list at:lnNr) isText ifTrue:[
+            end   := lnNr.
+            found := true.
+            "/ skip multiple text-lines
+            [end > 1 and:[(list at:(end-1)) isText]] whileTrue:[
+                end := end - 1
+            ].
+        ]
+    ].
+    found ifTrue:[
+        self scrollToLine:end
+    ] ifFalse:[
+        self beep
+    ]
+
+    "Created: / 27.7.1998 / 12:25:34 / cg"
+    "Modified: / 27.7.1998 / 12:31:26 / cg"
+! !
+
+!RCSConflictEditTextView methodsFor:'initialization'!
+
+initialize
+    |panel buttonPrev buttonNext|
+
+    super initialize.
+
+"set up-down buttons"
+
+    panel := VerticalPanelView in:self.
+
+    buttonPrev := Button label:'-' in:panel.
+    buttonNext := Button label:'+' in:panel.
+    buttonPrev extent:15@22.
+    buttonNext extent:15@22.
+    panel origin:0.0 @ 1.0 corner:(15 + SimpleView viewSpacing) @ 1.0.
+    panel topInset:(2 * (buttonPrev preferredExtent y)) negated.
+
+"set actions"
+
+    buttonPrev pressAction:[
+        buttonPrev turnOff.
+        self moveToPreviousChanged
+    ].
+
+    buttonNext pressAction:[
+        buttonNext turnOff.
+        self moveToNextChanged
+    ].
+    self moveToNextChanged.
+
+    "Modified: / 27.7.1998 / 12:22:31 / cg"
+! !
+
+!RCSConflictEditTextView class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libtool/RCSConflictEditTextView.st,v 1.1 1998-07-27 10:36:03 cg Exp $'
+! !