UpDownButton.st
author tz
Thu, 09 Apr 1998 15:19:05 +0200
changeset 852 89c5dd6f6809
parent 818 fbd05e92d506
child 868 0fa479aee842
permissions -rw-r--r--
wrong color accessings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
SimpleView subclass:#UpDownButton
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
     2
	instanceVariableNames:'orientation upButton downButton'
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
     3
	classVariableNames:''
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	poolDictionaries:''
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	category:'Views-Interactors'
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!UpDownButton class methodsFor:'documentation'!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
documentation
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
    an up/down button - simply two buttons in one view.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
    [author:]
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
        Claus Gittinger
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
    [see also:]
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
        ArrowButton
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
        ComboUpDownView
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
"
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
examples
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
                                                                [exBegin]
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
     |top ud|
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
     top := StandardSystemView new.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
     top extent:(300 @ 200).
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
     ud := UpDownButton in:top.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
     ud origin:(10 @ 10).
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
     ud upAction:[Transcript showCR:'up'].
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
     ud downAction:[Transcript showCR:'down'].
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
     top open.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
                                                                [exEnd]
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    38
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    39
                                                                [exBegin]
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    40
     |top ud|
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    41
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    42
     top := StandardSystemView new.
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    43
     top extent:(300 @ 200).
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    44
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    45
     ud := UpDownButton in:top.
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    46
     ud orientation:#horizontal.
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    47
     ud origin:(10 @ 10).
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    48
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    49
     ud upAction:[Transcript showCR:'up'].
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    50
     ud downAction:[Transcript showCR:'down'].
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    51
     top open.
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
    52
                                                                [exEnd]
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!UpDownButton methodsFor:'accessing-behavior'!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
818
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    59
disable
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    60
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    61
    upButton disable.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    62
    downButton disable.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    63
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    64
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
downAction:aBlock
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
    66
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    downButton action:aBlock
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
818
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    70
enable
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    71
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    72
    upButton enable.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    73
    downButton enable.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    74
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    75
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    76
showFocus:explicit 
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    77
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    78
    upButton enabled ifTrue: [super showFocus:explicit]
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    79
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    80
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
upAction:aBlock
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
    82
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    upButton action:aBlock
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
! !
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
818
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    86
!UpDownButton methodsFor:'accessing-channels'!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    87
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    88
backgroundChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    89
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    90
    upButton backgroundChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    91
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    92
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    93
backgroundChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    94
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    95
    upButton backgroundChannel: aValueHolder.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    96
    downButton backgroundChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    97
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    98
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
    99
enableChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   100
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   101
    upButton enableChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   102
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   103
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   104
enableChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   105
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   106
    upButton enableChannel: aValueHolder.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   107
    downButton enableChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   108
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   109
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   110
foregroundChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   111
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   112
    upButton foregroundChannel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   113
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   114
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   115
foregroundChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   116
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   117
    upButton foregroundChannel: aValueHolder.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   118
    downButton foregroundChannel: aValueHolder
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   119
! !
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   120
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   121
!UpDownButton methodsFor:'accessing-colors'!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   122
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   123
backgroundColor
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   124
852
89c5dd6f6809 wrong color accessings
tz
parents: 818
diff changeset
   125
    ^upButton backgroundColor
818
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   126
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   127
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   128
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   129
backgroundColor:aColor
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   130
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   131
    aColor ~~ upButton backgroundColor ifTrue:[
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   132
        upButton backgroundColor:aColor.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   133
        downButton backgroundColor:aColor.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   134
        shown ifTrue:[self invalidate]
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   135
    ]
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   136
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   137
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   138
foregroundColor
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   139
852
89c5dd6f6809 wrong color accessings
tz
parents: 818
diff changeset
   140
    ^upButton foregroundColor
818
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   141
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   142
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   143
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   144
foregroundColor:aColor
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   145
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   146
    aColor ~~ upButton foregroundColor ifTrue:[
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   147
        upButton foregroundColor:aColor.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   148
        downButton foregroundColor:aColor.
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   149
        shown ifTrue:[self invalidate]
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   150
    ]
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   151
!
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   152
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   153
model:aModel
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   154
    "ignore models"
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   155
! !
fbd05e92d506 revised for the docu
tz
parents: 788
diff changeset
   156
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
!UpDownButton methodsFor:'accessing-components'!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
downButton
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   160
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    ^ downButton
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
upButton
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   165
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    ^ upButton
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
! !
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   169
!UpDownButton methodsFor:'accessing-look'!
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   170
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   171
orientation
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   172
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   173
    ^ orientation
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   174
!
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   175
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   176
orientation:aSymbol
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   177
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   178
    orientation := aSymbol.
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   179
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   180
    self initializeButtonDimensions.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   181
    self initializeButtonForms
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   182
! !
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   183
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   184
!UpDownButton methodsFor:'change & update'!
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   185
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   186
sizeChanged:how
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   187
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   188
    super sizeChanged:how.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   189
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   190
    self initializeButtonDimensions
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   191
! !
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   192
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!UpDownButton methodsFor:'initialization'!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
initialize
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   196
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   197
    orientation := #vertical.
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   198
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    super initialize.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    self initializeButtons
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   201
!
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   202
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   203
initializeButtonDimensions
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   204
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   205
    orientation == #vertical ifTrue:[
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   206
        upButton   origin: 0@0.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   207
        upButton   corner: (self extent x - 1)@(self extent y//2).
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   208
        downButton origin: 0@(self extent y//2 + 1).
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   209
        downButton corner: (self extent x - 1)@(self extent y - 1)
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   210
    ] ifFalse:[
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   211
        upButton   origin:0@0.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   212
        upButton   corner: (self extent x//2)@(self extent y - 1).
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   213
        downButton origin: (self extent x//2 + 1)@0.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   214
        downButton corner: (self extent x - 1)@(self extent y - 1)
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   215
    ]
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   216
!
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   217
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   218
initializeButtonForms
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   219
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   220
    orientation == #vertical ifTrue:[
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   221
        upButton label:ArrowButton UpArrowForm.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   222
        downButton label:ArrowButton DownArrowForm.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   223
    ] ifFalse:[
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   224
        upButton label:ArrowButton LeftArrowForm.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   225
        downButton label:ArrowButton RightArrowForm.
340
c02e5db9b6f5 added left-right orientation.
Claus Gittinger <cg@exept.de>
parents: 338
diff changeset
   226
    ].
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
initializeButtons
779
0abab228a8fd do not define callbacks in action blocks which do not exist
tz
parents: 651
diff changeset
   230
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    upButton := ArrowButton upIn:self.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    upButton autoRepeat:true.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    downButton := ArrowButton downIn:self.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    downButton autoRepeat:true.
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
788
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   237
    self initializeButtonDimensions.
826f9374823b take forms from the ArrowButton + resizing behavior added
tz
parents: 779
diff changeset
   238
    self initializeButtonForms
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
! !
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
!UpDownButton class methodsFor:'documentation'!
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
version
852
89c5dd6f6809 wrong color accessings
tz
parents: 818
diff changeset
   244
    ^ '$Header: /cvs/stx/stx/libwidg2/UpDownButton.st,v 1.8 1998-04-09 13:19:05 tz Exp $'
338
d779aad63356 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
! !