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