SyncedMultiColumnTextView.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Jun 2019 09:21:50 +0200
changeset 6078 08c9e2a47dc5
parent 5808 51da0754f9d1
permissions -rw-r--r--
#OTHER by cg self class name -> self className
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
     1
"{ Encoding: utf8 }"
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
     2
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
101
85422b262e51 my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents: 92
diff changeset
     5
	      All Rights Reserved
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
2432
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
    15
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
    16
"{ NameSpace: Smalltalk }"
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
    17
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
SimpleView subclass:#SyncedMultiColumnTextView
3093
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    19
	instanceVariableNames:'textViewClass textViews scrollLock'
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    20
	classVariableNames:''
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    21
	poolDictionaries:''
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    22
	category:'Views-Text'
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!SyncedMultiColumnTextView class methodsFor:'documentation'!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 1995 by Claus Gittinger
101
85422b262e51 my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents: 92
diff changeset
    30
	      All Rights Reserved
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    abstract superclass for multi-col textviews.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Scrolling is synced, by always scrolling all views.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    This type of view is especially useful to show diff-lists,
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    code-versions, or other one-by-one viewable texts.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    Usually, it does not make much sense, to put totally different
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    or unrelated texts into this kind of view.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    51
    See concrete examples in subclasses: TwoColumnTextView, DiffTextView etc.
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    52
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    53
    [see also:]
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    54
        TwoColumnTextView DiffTextView
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    55
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    56
    [author:]
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    57
        Claus Gittinger
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
"
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    59
! !
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    60
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    61
!SyncedMultiColumnTextView class methodsFor:'defaults'!
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    62
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    63
numberOfViews
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    64
    "return the number of the synced subViews.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    65
     Usually redefined in subclasses"
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    66
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    67
    ^ 2
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    68
!
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    69
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    70
textViewClass
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    71
    "return the type of the synced subViews.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    72
     Can be redefined in subclasses"
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    73
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    74
    ^ TextView
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    75
! !
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
    76
3093
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    77
!SyncedMultiColumnTextView methodsFor:'accessing'!
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    78
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    79
textViewClass
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    80
    textViewClass isNil ifTrue:[ ^ self class textViewClass ].
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    81
    ^ textViewClass
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    82
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    83
    "Created: / 06-10-2006 / 14:28:53 / cg"
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    84
!
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    85
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    86
textViewClass:aClass
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    87
    textViewClass := aClass
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    88
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    89
    "Created: / 06-10-2006 / 14:29:04 / cg"
4125
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    90
!
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    91
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    92
textViews                    
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    93
    ^ textViews
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    94
1792b29efdea added: #textViews
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
    95
    "Created: / 08-05-2012 / 14:04:00 / cg"
3093
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    96
! !
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
    97
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    98
!SyncedMultiColumnTextView methodsFor:'change & update'!
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   100
update:something with:someArgument from:changedObject
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   101
    "/
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   102
    "/ if any of my views changes its contents,
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   103
    "/ I have logically changed my contents -> to give scrollbar
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   104
    "/ a chance to update
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   105
    "/
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   106
    something == #sizeOfContents ifTrue:[
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   107
        self changed:something
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   108
    ].
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   109
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   110
    "/
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   111
    "/ if any of my views' changes the origin its contents,
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   112
    "/ I have logically changed my origin -> give the scrollbar
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   113
    "/ a chance to update and sync my views.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   114
    "/
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   115
    something == #originOfContents ifTrue:[
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   116
        "/ beware of recursive calls
4131
c7dde0b20bfd changed:
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   117
        scrollLock ifFalse:[
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   118
            scrollLock := true.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   119
            textViews do:[:v|
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   120
                v ~~ changedObject ifTrue:[
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   121
                    v scrollTo:changedObject viewOrigin.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   122
                ].
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   123
            ].
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   124
            self changed:something.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   125
            scrollLock := false.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   126
        ].
3159
c504c98aaa49 changed #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   127
        ^ self.
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   128
    ].
3159
c504c98aaa49 changed #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   129
    super update:something with:someArgument from:changedObject
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   130
3159
c504c98aaa49 changed #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   131
    "Created: / 24-11-1995 / 11:11:22 / cg"
c504c98aaa49 changed #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   132
    "Modified: / 25-09-1997 / 11:46:32 / stefan"
4131
c7dde0b20bfd changed:
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   133
    "Modified: / 06-06-2012 / 11:04:21 / cg"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
! !
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!SyncedMultiColumnTextView methodsFor:'initialization'!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
initialize
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   139
    |n wEach org crn cls|
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
4131
c7dde0b20bfd changed:
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   141
    scrollLock := false.
c7dde0b20bfd changed:
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   142
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    super initialize.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
3093
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
   145
    cls := self textViewClass.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    n := self class numberOfViews.
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   147
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    textViews := Array new:n.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    wEach := (1 / n) asFloat.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    org := 0.0.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    1 to:n do:[:i |
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   152
        |textView|
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   154
        i == n ifTrue:[
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   155
            crn := 1.0
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   156
        ] ifFalse:[
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   157
            crn := org + wEach
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   158
        ].
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   159
        textView:= cls 
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   160
                        origin:org @ 0.0
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   161
                        corner:crn @ 1.0
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   162
                            in:self.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
168
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   164
        textView borderWidth:1.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   165
        textView level:0.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   166
        textView addDependent:self.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   167
        textViews at:i put:textView.
85378c0e7dfc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   168
        org := org + wEach
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ].
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
3093
84ec3d9dd45c allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents: 2432
diff changeset
   171
    "Created: / 20-11-1995 / 13:06:16 / cg"
4131
c7dde0b20bfd changed:
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   172
    "Modified: / 06-06-2012 / 11:04:03 / cg"
101
85422b262e51 my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents: 92
diff changeset
   173
! !
85422b262e51 my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents: 92
diff changeset
   174
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
!SyncedMultiColumnTextView methodsFor:'queries'!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
heightOfContents
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView heightOfContents)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "Created: 20.11.1995 / 13:08:25 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
innerHeight 
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView innerHeight)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
    "Created: 20.11.1995 / 13:08:42 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
innerWidth 
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView innerWidth)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "Created: 20.11.1995 / 13:08:49 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
widthOfContents 
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView widthOfContents)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    "Created: 20.11.1995 / 13:08:59 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
xOriginOfContents
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView xOriginOfContents)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    "Created: 20.11.1995 / 13:09:11 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
yOriginOfContents
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    ^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView yOriginOfContents)]
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    "Created: 20.11.1995 / 13:09:18 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
! !
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
!SyncedMultiColumnTextView methodsFor:'scrolling'!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
scrollDown:nLines
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   216
    textViews first scrollDown:nLines.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    "Created: 20.11.1995 / 13:09:40 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   219
    "Modified: 25.9.1997 / 11:39:59 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   222
scrollDownLines:nLines
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   223
    textViews first scrollDownLines:nLines.
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   224
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   225
    "Created: / 13-06-2018 / 21:56:58 / Claus Gittinger"
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   226
!
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   227
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
scrollHorizontalToPercent:p
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   229
    "since the percentage given is based on the widest text
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   230
     of my subvies, scroll the view containing the widest first,
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   231
     and take that scroll-offset for the others."
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   232
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   233
    |master max|
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   234
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   235
    max := 0.
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   236
    textViews do:[:thisView |
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   237
        |wThis|
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   239
        (wThis := thisView widthOfContents) > max ifTrue:[
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   240
            max := wThis.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   241
            master := thisView
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   242
        ]
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   243
    ].
2432
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   244
    master notNil ifTrue:[
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   245
        master scrollHorizontalToPercent:p.
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   246
    ].
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   248
    "Created: 20.11.1995 / 13:14:41 / cg"
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   249
    "Modified: 24.11.1995 / 14:22:27 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   250
    "Modified: 25.9.1997 / 11:42:46 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
scrollLeft
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   254
    textViews first scrollLeft.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    "Modified: 20.11.1995 / 13:15:45 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   258
    "Modified: 25.9.1997 / 11:41:04 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
scrollLeft:nPixels
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   262
    textViews first scrollLeft:nPixels.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
    "Modified: 20.11.1995 / 13:15:49 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   266
    "Modified: 25.9.1997 / 11:41:17 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
scrollRight
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   270
    textViews first scrollRight.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    "Modified: 20.11.1995 / 13:15:39 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   274
    "Modified: 25.9.1997 / 11:41:30 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
scrollRight:nPixels
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   278
    textViews first scrollRight:nPixels.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    "Modified: 20.11.1995 / 13:15:27 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   282
    "Modified: 25.9.1997 / 11:41:43 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
scrollToLine:lineNr
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   286
    textViews first scrollToLine:lineNr.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    "Modified: 20.11.1995 / 13:15:07 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   290
    "Modified: 25.9.1997 / 11:41:56 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
scrollUp:nLines
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   294
    textViews first scrollUp:nLines.
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    "Created: 20.11.1995 / 13:09:40 / cg"
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    "Modified: 20.11.1995 / 13:14:51 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   298
    "Modified: 25.9.1997 / 11:42:10 / stefan"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
!
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   301
scrollUpLines:nLines
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   302
    textViews first scrollUpLines:nLines.
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   303
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   304
    "Created: / 13-06-2018 / 21:58:14 / Claus Gittinger"
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   305
!
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   306
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
scrollVerticalToPercent:p
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   308
    "since the percentage given is based on the longest text
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   309
     of my subvies, scroll the view containing the longest first,
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   310
     and take that scroll-offset for the others."
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   311
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   312
    |master max|
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    max := 0.
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    textViews do:[:thisView |
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   316
        |hThis|
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   317
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   318
        (hThis := thisView heightOfContents) > max ifTrue:[
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   319
            max := hThis.
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   320
            master := thisView
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   321
        ]
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    ].
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   323
2432
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   324
    master notNil ifTrue:[
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   325
        master scrollVerticalToPercent:p.
ef8c696dd217 care for being asked to scroll, before my subviews are present.
penk
parents: 1384
diff changeset
   326
    ]
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    "Created: 20.11.1995 / 13:14:41 / cg"
102
f85d1c7ca56f fixed horizontal scrolling
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
   329
    "Modified: 24.11.1995 / 14:22:19 / cg"
537
cd6bc3d8f9f6 Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents: 168
diff changeset
   330
    "Modified: 25.9.1997 / 11:42:34 / stefan"
1384
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   331
!
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   332
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   333
verticalScrollStep    
3502
aed0073a23d5 comment
Claus Gittinger <cg@exept.de>
parents: 3159
diff changeset
   334
    "return the amount to scroll when stepping up/down (also used for mouseWheel)."
aed0073a23d5 comment
Claus Gittinger <cg@exept.de>
parents: 3159
diff changeset
   335
1384
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   336
    ^ 1.
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   337
6177a99d7246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   338
    "Created: / 21.5.1999 / 19:18:09 / cg"
92
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
! !
ca6389321c2a new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   341
!SyncedMultiColumnTextView class methodsFor:'documentation'!
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   342
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   343
version
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   344
^ '$Header$'
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   345
! !
5808
51da0754f9d1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4131
diff changeset
   346