SequenceView.st
author Claus Gittinger <cg@exept.de>
Fri, 24 Apr 2020 12:05:44 +0200
changeset 6847 22dc78cb5436
parent 6815 34586cf7ecbd
permissions -rw-r--r--
#FEATURE by cg class: TextView changed: #editMenu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
     1
"{ Encoding: utf8 }"
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
     2
2150
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     3
"
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     4
 COPYRIGHT (c) 1997 by eXept Software AG
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     5
              All Rights Reserved
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     6
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     7
 This software is furnished under a license and may be used
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     8
 only in accordance with the terms of that license and with the
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    10
 be provided or otherwise made available to, or used by, any
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    11
 other person.  No title to or ownership of the software is
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    12
 hereby transferred.
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    13
"
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
    14
"{ Package: 'stx:libwidg' }"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
    15
5926
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
    16
"{ NameSpace: Smalltalk }"
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
    17
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    18
ScrollableView subclass:#SequenceView
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    19
	instanceVariableNames:''
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    20
	classVariableNames:''
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    21
	poolDictionaries:''
1770
21860fc4cbde category change
Claus Gittinger <cg@exept.de>
parents: 1602
diff changeset
    22
	category:'Views-Lists'
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    23
!
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    24
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    25
!SequenceView class methodsFor:'documentation'!
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    26
2150
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    27
copyright
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    28
"
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    29
 COPYRIGHT (c) 1997 by eXept Software AG
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    30
              All Rights Reserved
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    31
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    32
 This software is furnished under a license and may be used
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    33
 only in accordance with the terms of that license and with the
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    35
 be provided or otherwise made available to, or used by, any
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    36
 other person.  No title to or ownership of the software is
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    37
 hereby transferred.
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    38
"
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    39
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    40
!
3cee520c3f91 copyrights
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
    41
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    42
documentation
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    43
"
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    44
    implements a SelectionInListView with configurable scrollbars
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    45
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    46
    ST-80 compatibility
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    47
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    48
    [see also:]
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    49
        SelectionInListView
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    50
"
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    51
!
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    52
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    53
examples
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    54
"
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    55
    same behavior as a SelectionInListView, but scrollable
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    56
                                                                        [exBegin]
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    57
    |view|
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    58
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    59
    view := self extent:100@100.
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    60
    view list:#( 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'in der Ruhe liegt die Kraft').
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    61
    view multipleSelectOk:true.
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    62
    view openAndWait.
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    63
                                                                        [exEnd]
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    64
"
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    65
! !
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    66
1592
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    67
!SequenceView class methodsFor:'defaults'!
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    68
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    69
defaultFont
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    70
    ^ SelectionInListView defaultFont
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    71
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    72
    "Created: / 20.6.1998 / 14:17:01 / cg"
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    73
! !
d545f9ba1fba fixed defaultFont.
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    74
2744
cb920467a4b4 method category rename
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    75
!SequenceView methodsFor:'Compatibility-ST80'!
1602
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    76
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    77
optimizeForText
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    78
    "dummy - ST-80 compatibility"
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    79
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    80
    "Created: / 6.7.1998 / 13:26:18 / cg"
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    81
! !
35e103b2f981 added #optimizeForText (dummy - ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
    82
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    83
!SequenceView methodsFor:'initialization'!
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    84
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    85
initialize
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    86
    "setup a ScrollableView scrolling a SelectionInList instance"
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    87
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    88
    super initialize.
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    89
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    90
    self verticalScrollable:true;     verticalMini:false.
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    91
    self horizontalScrollable:true; horizontalMini:false.
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    92
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    93
    self scrolledView:SelectionInListView new
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    94
! !
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
    95
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    96
!SequenceView methodsFor:'slave-view messages'!
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
    97
3669
4b6eff3a3ebf changed #enabled: - forward to child view
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
    98
enabled:aBoolean
4b6eff3a3ebf changed #enabled: - forward to child view
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
    99
    "senders assume that I am the listView - not a wrapper"
4b6eff3a3ebf changed #enabled: - forward to child view
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
   100
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   101
    scrolledView notNil ifTrue:[ scrolledView enabled:aBoolean ]
3669
4b6eff3a3ebf changed #enabled: - forward to child view
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
   102
!
4b6eff3a3ebf changed #enabled: - forward to child view
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
   103
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
   104
font:aFont
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
   105
    "set the font for the scrolled view"
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
   106
5926
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
   107
    |scrolledView|
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
   108
    
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
   109
    super font:aFont.
5926
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
   110
    (scrolledView := self scrolledView) notNil ifTrue:[scrolledView font:aFont].
2917
cbca85d08c88 Change categories and example
Stefan Vogel <sv@exept.de>
parents: 2744
diff changeset
   111
!
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   112
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   113
invalidate
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   114
    "senders assume that I am the listView - not a wrapper"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   115
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   116
    scrolledView notNil ifTrue:[ scrolledView invalidate ]
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   117
!
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   118
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   119
invalidate:aRectangle
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   120
    "senders assume that I am the listView - not a wrapper"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   121
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   122
    scrolledView notNil ifTrue:[ scrolledView invalidate:aRectangle ]
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   123
!
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   124
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   125
invalidate:aRectangle repairNow:doRepair
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   126
    "senders assume that I am the listView - not a wrapper"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   127
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   128
    scrolledView notNil ifTrue:[ scrolledView invalidate:aRectangle repairNow:doRepair ]
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   129
!
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   130
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   131
invalidateDeviceRectangle:aRectangle repairNow:doRepair
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   132
    "senders assume that I am the listView - not a wrapper"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   133
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   134
    scrolledView notNil ifTrue:[ scrolledView invalidateDeviceRectangle:aRectangle repairNow:doRepair ]
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   135
!
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   136
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   137
invalidateRepairNow:doRepair
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   138
    "senders assume that I am the listView - not a wrapper"
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   139
6815
34586cf7ecbd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 5926
diff changeset
   140
    scrolledView notNil ifTrue:[ scrolledView invalidateRepairNow:doRepair ]
2293
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   141
! !
edeb8b9be073 forward invalidate requests to my scrolledView
Claus Gittinger <cg@exept.de>
parents: 2150
diff changeset
   142
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
   143
!SequenceView class methodsFor:'documentation'!
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
   144
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
   145
version
5926
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
   146
    ^ '$Header$'
1238
9d002bb1ae64 intitial checkin
ca
parents:
diff changeset
   147
! !
5926
643cafe77eed #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3669
diff changeset
   148