ArrowButton.st
author Claus Gittinger <cg@exept.de>
Fri, 14 Jun 1996 16:16:05 +0200
changeset 765 ea6ecf2a5b30
parent 657 3215022ac50c
child 768 33056f6466ea
permissions -rw-r--r--
keep deep device image cached
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     1
"
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
     3
	      All Rights Reserved
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     4
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
3ebee08bea15 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    11
"
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    12
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    13
Button subclass:#ArrowButton
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    14
	instanceVariableNames:'arrowStyle'
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    15
	classVariableNames:'DownArrowForm UpArrowForm LeftArrowForm RightArrowForm
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    16
		CachedStyle DefaultArrowStyle DefaultBackgroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    17
		DefaultForegroundColor DefaultActiveBackgroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    18
		DefaultActiveForegroundColor DefaultEnteredBackgroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    19
		DefaultEnteredForegroundColor DefaultDisabledForegroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    20
		DefaultArrowButtonActiveLevel DefaultArrowButtonPassiveLevel
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    21
		DownArrowFormFile UpArrowFormFile LeftArrowFormFile
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    22
		RightArrowFormFile'
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    23
	poolDictionaries:''
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    24
	category:'Views-Interactors'
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    25
!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    26
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    27
!ArrowButton class methodsFor:'documentation'!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    28
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    29
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    30
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    31
 COPYRIGHT (c) 1993 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    32
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    33
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    34
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    35
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    36
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    37
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    38
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    39
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    40
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    41
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    42
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    43
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    44
"
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    45
    ArrowButtons display an arrow as their label; they are mainly
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    46
    used for scrollbars, but can be useful on their own in some applications.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    47
    Beside the contents, their default behavior is to perform their action
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    48
    when pressed - not (as is the default for normal buttons) when released.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    49
65
b33e4f3a264e *** empty log message ***
claus
parents: 62
diff changeset
    50
    Indivdual ArrowButtons can be created by sending one of:
580
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    51
            ArrowButton upIn:aView /downIn: / leftIn: or rightIn:
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    52
    passing the parent view as argument.
65
b33e4f3a264e *** empty log message ***
claus
parents: 62
diff changeset
    53
130
claus
parents: 128
diff changeset
    54
    See examples.
claus
parents: 128
diff changeset
    55
580
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    56
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    57
    [styleSheet parameters:]
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    58
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    59
        arrowButtonStyle            <Symbol>        the style of the button;
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    60
                                                    #motif, #st80 or nil (default)
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    61
        arrowButtonForegroundColor  <nil | Color>   foregroundColor 
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    62
        arrowButtonBackgroundColor  <nil | Color>   backgroundColor 
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    63
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    64
        arrowButtonActiveForegroundColor            foregroundColor when pressed
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    65
        arrowButtonActiveBackgroundColor            backgroundColor when pressed
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    66
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    67
        arrowButtonEnteredForegroundColor           foregroundColor when mouse pointer entered
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    68
        arrowButtonEnteredBackgroundColor           backgroundColor when mouse pointer entered
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    69
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 580
diff changeset
    70
    [author:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 580
diff changeset
    71
        Claus Gittinger
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 580
diff changeset
    72
580
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    73
    [See also:]
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    74
         Button  Toggle CheckToggle CheckBox
a31ba5bcc4c0 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
    75
         ScrollBar
130
claus
parents: 128
diff changeset
    76
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
    77
"
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
    78
!
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
    79
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
    80
examples 
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
    81
"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    82
    example1:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    83
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    84
        |v p b1 b2 b3 b4|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    85
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    86
        v := StandardSystemView extent:200@200.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    87
        p := HorizontalPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    88
        b1 := ArrowButton upIn:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    89
        b2 := ArrowButton downIn:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    90
        b3 := ArrowButton leftIn:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    91
        b4 := ArrowButton rightIn:p.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    92
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    93
        b1 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    94
        b2 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    95
        b3 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    96
        b4 action:['whatEver you like here ...'].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    97
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    98
        v open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    99
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   100
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   101
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   102
    example2:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   103
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   104
        |v p b1 b2 b3 b4|
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   105
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   106
        v := StandardSystemView extent:200@200.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   107
        p := HorizontalPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   108
        b1 := (ArrowButton upIn:p) extent:30@30.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   109
        b2 := (ArrowButton downIn:p) extent:30@30.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   110
        b3 := (ArrowButton leftIn:p) extent:30@30.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   111
        b4 := (ArrowButton rightIn:p) extent:30@30.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   112
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   113
        b1 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   114
        b2 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   115
        b3 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   116
        b4 action:['whatEver you like here ...'].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   117
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   118
        v open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   119
                                                                        [exEnd]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   120
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   121
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   122
    example3:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   123
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   124
        |v p b1 b2 b3 b4|
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   125
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   126
        v := StandardSystemView extent:200@200.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   127
        p := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   128
        b1 := (ArrowButton upIn:p) origin:(0.33 @ 0.0) corner:(0.67 @ 0.33).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   129
        b3 := (ArrowButton leftIn:p) origin:(0.0 @ 0.33) corner:(0.33 @ 0.67).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   130
        b4 := (ArrowButton rightIn:p) origin:(0.67 @ 0.33) corner:(1.0 @ 0.67).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   131
        b2 := (ArrowButton downIn:p) origin:(0.33 @ 0.67) corner:(0.67 @ 1.0).
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   132
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   133
        b1 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   134
        b2 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   135
        b3 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   136
        b4 action:['whatEver you like here ...'].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   137
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   138
        v open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   139
                                                                        [exEnd]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   140
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   141
65
b33e4f3a264e *** empty log message ***
claus
parents: 62
diff changeset
   142
    example4 (not good coding style, to explicitely use a particular style,
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   143
              just a demonstration how it looks ..):
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   144
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   145
        |v p b1 b2 b3 b4 oldStyle|
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   146
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   147
        oldStyle := View defaultStyle.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   148
        View defaultStyle:#motif.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   149
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   150
        v := StandardSystemView extent:100@100.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   151
        p := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   152
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   153
        b1 := (ArrowButton upIn:p) origin:(0.33 @ 0.0) corner:(0.67 @ 0.33).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   154
        b3 := (ArrowButton leftIn:p) origin:(0.0 @ 0.33) corner:(0.33 @ 0.67).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   155
        b4 := (ArrowButton rightIn:p) origin:(0.67 @ 0.33) corner:(1.0 @ 0.67).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   156
        b2 := (ArrowButton downIn:p) origin:(0.33 @ 0.67) corner:(0.67 @ 1.0).
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   157
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   158
        b1 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   159
        b2 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   160
        b3 action:['whatEver you like here ...'].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   161
        b4 action:['whatEver you like here ...'].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   162
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   163
        View defaultStyle:oldStyle.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   164
        v open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   165
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   166
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   167
! !
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   168
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   169
!ArrowButton class methodsFor:'instance creation'!
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   170
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   171
downIn:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   172
    ^ (super in:aView) direction:#down
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   173
!
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   174
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   175
leftIn:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   176
    ^ (super in:aView) direction:#left
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   177
!
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   178
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   179
rightIn:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   180
    ^ (super in:aView) direction:#right
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   181
!
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   182
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   183
upIn:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   184
    ^ (super in:aView) direction:#up
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   185
! !
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   186
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   187
!ArrowButton class methodsFor:'defaults'!
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   188
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   189
downArrowButtonForm:style on:aDevice
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   190
    "retun the form used for the scrollDown Button"
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   191
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   192
    |form|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   193
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   194
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   195
     use cached form, if device is appropriate
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   196
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   197
    CachedStyle ~~ style ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   198
        UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   199
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   200
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   201
    ((aDevice == Display) and:[DownArrowForm notNil]) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   202
        ^ DownArrowForm
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   203
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   204
154
claus
parents: 153
diff changeset
   205
    DownArrowForm := StyleSheet at:'arrowButtonDownForm' default:nil.
claus
parents: 153
diff changeset
   206
    DownArrowForm notNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   207
        ^ DownArrowForm
154
claus
parents: 153
diff changeset
   208
    ].
claus
parents: 153
diff changeset
   209
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   210
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   211
     special treatment for st80 arrows 
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   212
     - they do not really fit into the general (bitmap) scheme ...
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   213
     (i.e. they are computed instead of drawn from a bitmap)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   214
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   215
    style ~~ #st80 ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   216
        DownArrowFormFile notNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   217
            form := Form fromFile:DownArrowFormFile resolution:100 on:aDevice.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   218
            form isNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   219
                'ARRBUTTON: no bitmapFile: ' infoPrint. DownArrowFormFile infoPrintCR.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   220
            ]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   221
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   222
    ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   223
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   224
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   225
     form to use as a fallback, if no bitmap file is present
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   226
     (actually not really needed - just to show something useful, in
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   227
      case of a bad installation)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   228
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   229
    form isNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   230
        style == #st80 ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   231
            form := Form width:9 height:9 depth:1 on:Display.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   232
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   233
            form clear.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   234
            form lineWidth:2.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   235
            form capStyle:#round.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   236
            form paint:(Color colorId:1).
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   237
            form displayLineFromX:0 y:2 toX:4 y:6.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   238
            form displayLineFromX:4 y:6 toX:8 y:2 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   239
        ] ifFalse:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   240
            form  := Form width:16 height:16 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   241
                          fromArray:#[2r00000000 2r00000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   242
                                      2r00001111 2r11110000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   243
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   244
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   245
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   246
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   247
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   248
                                      2r01111000 2r00011110
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   249
                                      2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   250
                                      2r00100000 2r00000100
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   251
                                      2r00010000 2r00001000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   252
                                      2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   253
                                      2r00000100 2r00100000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   254
                                      2r00000010 2r01000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   255
                                      2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   256
                                      2r00000000 2r00000000]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   257
                         on:aDevice.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   258
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   259
        ].
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   260
    ].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   261
    form := form on:aDevice.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   262
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   263
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   264
     remember form for next use
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   265
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   266
    (aDevice == Display) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   267
        CachedStyle := style.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   268
        DownArrowForm := form
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   269
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   270
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   271
    ^ form
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   272
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   273
    "Modified: 20.5.1996 / 10:31:05 / cg"
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   274
!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   275
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   276
leftArrowButtonForm:style on:aDevice
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   277
    "retun the form used for the scrollLeft Button"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   278
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   279
    |form|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   280
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   281
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   282
     use cached form, if device is appropriate
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   283
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   284
    CachedStyle ~~ style ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   285
        UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   286
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   287
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   288
    ((aDevice == Display) and:[LeftArrowForm notNil]) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   289
        ^ LeftArrowForm
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   290
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   291
154
claus
parents: 153
diff changeset
   292
    LeftArrowForm := StyleSheet at:'arrowButtonLeftForm' default:nil.
claus
parents: 153
diff changeset
   293
    LeftArrowForm notNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   294
        ^ LeftArrowForm
154
claus
parents: 153
diff changeset
   295
    ].
claus
parents: 153
diff changeset
   296
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   297
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   298
     special treatment for st80 arrows 
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   299
     - they do not really fit into the general (bitmap) scheme ...
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   300
     (i.e. they are computed instead of drawn from a bitmap)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   301
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   302
    style ~~ #st80 ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   303
        LeftArrowFormFile notNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   304
            form := Form fromFile:LeftArrowFormFile resolution:100 on:aDevice.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   305
            form isNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   306
                'ARRBUTTON: no bitmapFile: ' infoPrint. LeftArrowFormFile infoPrintCR.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   307
            ]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   308
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   309
    ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   310
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   311
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   312
     form to use as a fallback, if no bitmap file is present
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   313
     (actually not really needed - just to show something useful, in
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   314
      case of a bad installation)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   315
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   316
    form isNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   317
        style == #st80 ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   318
            form := Form width:9 height:9 depth:1 on:Display.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   319
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   320
            form clear.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   321
            form lineWidth:2.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   322
            form capStyle:#round.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   323
            form paint:(Color colorId:1).
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   324
            form displayLineFromX:6 y:0 toX:2 y:4.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   325
            form displayLineFromX:2 y:4 toX:6 y:8.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   326
        ] ifFalse:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   327
            form := Form width:16 height:16 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   328
                         fromArray:#[2r00000000 2r00000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   329
                                     2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   330
                                     2r00000010 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   331
                                     2r00000100 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   332
                                     2r00001000 2r11111110
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   333
                                     2r00010000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   334
                                     2r00100000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   335
                                     2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   336
                                     2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   337
                                     2r00100000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   338
                                     2r00010000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   339
                                     2r00001000 2r11111110
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   340
                                     2r00000100 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   341
                                     2r00000010 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   342
                                     2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   343
                                     2r00000000 2r00000000]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   344
                         on:aDevice.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   345
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   346
        ].
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   347
    ].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   348
    form := form on:aDevice.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   349
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   350
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   351
     remember form for next use
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   352
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   353
    (aDevice == Display) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   354
        CachedStyle := style.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   355
        LeftArrowForm := form
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   356
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   357
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   358
    ^ form
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   359
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   360
    "Modified: 20.5.1996 / 10:31:07 / cg"
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   361
!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   362
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   363
rightArrowButtonForm:style on:aDevice
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   364
    "retun the form used for the scrollRight Button"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   365
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   366
    |form|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   367
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   368
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   369
     use cached form, if device is appropriate
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   370
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   371
    CachedStyle ~~ style ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   372
        UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   373
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   374
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   375
    ((aDevice == Display) and:[RightArrowForm notNil]) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   376
        ^ RightArrowForm
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   377
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   378
154
claus
parents: 153
diff changeset
   379
    RightArrowForm := StyleSheet at:'arrowButtonRightForm' default:nil.
claus
parents: 153
diff changeset
   380
    RightArrowForm notNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   381
        ^ RightArrowForm
154
claus
parents: 153
diff changeset
   382
    ].
claus
parents: 153
diff changeset
   383
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   384
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   385
     special treatment for st80 arrows 
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   386
     - they do not really fit into the general (bitmap) scheme ...
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   387
     (i.e. they are computed instead of drawn from a bitmap)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   388
    "
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   389
    style ~~ #st80 ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   390
        RightArrowFormFile notNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   391
            form := Form fromFile:RightArrowFormFile resolution:100 on:aDevice.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   392
            form isNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   393
                'ARRBUTTON: no bitmapFile: ' infoPrint. RightArrowFormFile infoPrintCR.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   394
            ]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   395
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   396
    ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   397
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   398
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   399
     form to use as a fallback, if no bitmap file is present
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   400
     (actually not really needed - just to show something useful, in
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   401
      case of a bad installation)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   402
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   403
    form isNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   404
        style == #st80 ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   405
            form := Form width:9 height:9 depth:1 on:Display.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   406
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   407
            form clear.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   408
            form lineWidth:2.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   409
            form capStyle:#round.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   410
            form paint:(Color colorId:1).
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   411
            form displayLineFromX:2 y:0 toX:6 y:4.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   412
            form displayLineFromX:6 y:4 toX:2 y:8 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   413
        ] ifFalse:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   414
            form := Form width:16 height:16 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   415
                         fromArray:#[2r00000000 2r00000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   416
                                     2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   417
                                     2r00000001 2r01000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   418
                                     2r00000001 2r00100000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   419
                                     2r01111111 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   420
                                     2r01000000 2r00001000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   421
                                     2r01000000 2r00000100
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   422
                                     2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   423
                                     2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   424
                                     2r01000000 2r00000100
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   425
                                     2r01000000 2r00001000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   426
                                     2r01111111 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   427
                                     2r00000001 2r00100000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   428
                                     2r00000001 2r01000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   429
                                     2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   430
                                     2r00000000 2r00000000]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   431
                         on:aDevice.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   432
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   433
        ].
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   434
    ].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   435
    form := form on:aDevice.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   436
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   437
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   438
     remember form for next use
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   439
    "
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   440
    (aDevice == Display) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   441
        CachedStyle := style.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   442
        RightArrowForm := form
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   443
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   444
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   445
    ^ form
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   446
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   447
    "Modified: 20.5.1996 / 10:31:10 / cg"
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   448
!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   449
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   450
upArrowButtonForm:style on:aDevice
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   451
    "return the form used for the scrollUp Button"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
    |form|
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   454
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   455
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   456
     use cached form, if device is appropriate
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   457
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
    CachedStyle ~~ style ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   459
        UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   460
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   462
    ((aDevice == Display) and:[UpArrowForm notNil]) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   463
        ^ UpArrowForm
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   464
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   465
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   466
    UpArrowForm := StyleSheet at:'arrowButtonUpForm' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   467
    UpArrowForm notNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   468
        ^ UpArrowForm
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   469
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   470
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   471
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   472
     special treatment for st80 arrows 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   473
     - they do not really fit into the general (bitmap) scheme ...
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   474
     (i.e. they are computed instead of drawn from a bitmap)
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
    style ~~ #st80 ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   477
        UpArrowFormFile notNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   478
            form := Form fromFile:UpArrowFormFile resolution:100 on:aDevice.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   479
            form isNil ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   480
                'ARRBUTTON: no bitmapFile: ' infoPrint. UpArrowFormFile infoPrintCR.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   481
            ]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   482
        ]
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   484
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   485
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   486
     form to use as a fallback, if no bitmap file is present
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   487
     (actually not really needed - just to show something useful, in
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   488
      case of a bad installation)
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   489
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   490
    form isNil ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   491
        style == #st80 ifTrue:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   492
            form := Form width:9 height:9 depth:1 on:aDevice.
270
aa6a36e199e7 be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   493
            form isNil ifTrue:[^ nil].
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   494
            form clear.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   495
            form lineWidth:2.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   496
            form capStyle:#round.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   497
            form paint:(Color colorId:1).
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   498
            form displayLineFromX:0 y:6 toX:4 y:2.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   499
            form displayLineFromX:4 y:2 toX:8 y:6.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   500
        ] ifFalse:[
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   501
            form := Form width:16 height:16 
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   502
                         fromArray:#[2r00000000 2r00000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   503
                                     2r00000001 2r10000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   504
                                     2r00000010 2r01000000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   505
                                     2r00000100 2r00100000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   506
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   507
                                     2r00010000 2r00001000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   508
                                     2r00100000 2r00000100
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   509
                                     2r01000000 2r00000010
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   510
                                     2r01111000 2r00011110
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   511
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   512
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   513
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   514
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   515
                                     2r00001000 2r00010000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   516
                                     2r00001111 2r11110000
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   517
                                     2r00000000 2r00000000]
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   518
                         on:aDevice.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   519
            form isNil ifTrue:[^ nil].
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   520
        ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   521
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   522
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   523
    form := form on:aDevice.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   524
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   525
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   526
     remember form for next use
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   527
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   528
    (aDevice == Display) ifTrue:[
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   529
        CachedStyle := style.
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   530
        UpArrowForm := form
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   531
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   532
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   533
    ^ form
657
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   534
3215022ac50c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   535
    "Modified: 20.5.1996 / 10:31:13 / cg"
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   536
!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   537
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   538
updateStyleCache
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   539
    "extract values from the styleSheet and cache them in class variables"
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   540
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   541
    <resource: #style (#arrowButtonStyle 
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   542
                       #arrowButtonActiveLevel #arrowButtonPassiveLevel
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   543
                       #arrowButtonBackgroundColor #arrowButtonForegroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   544
                       #arrowButtonActiveBackgroundColor #arrowButtonActiveForegroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   545
                       #arrowButtonEnteredBackgroundColor #arrowButtonEnteredForegroundColor
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   546
                       #arrowButtonDisabledForegroundColor 
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   547
                       #arrowButtonDownForm #arrowButtonUpForm
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   548
                       #arrowButtonLeftForm #arrowButtonRightForm
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   549
                       #arrowButtonDownFormFile #arrowButtonUpFormFile
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   550
                       #arrowButtonLeftFormFile #arrowButtonRightFormFile)>
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   551
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   552
    DefaultArrowStyle := StyleSheet at:'arrowButtonStyle' default:StyleSheet name.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   553
    DefaultArrowStyle := DefaultArrowStyle asSymbol.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   554
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   555
    DefaultArrowButtonActiveLevel := StyleSheet at:'arrowButtonActiveLevel' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   556
    DefaultArrowButtonPassiveLevel := StyleSheet at:'arrowButtonPassiveLevel' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   557
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   558
    DefaultBackgroundColor := StyleSheet colorAt:'arrowButtonBackgroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   559
    DefaultForegroundColor := StyleSheet colorAt:'arrowButtonForegroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   560
    DefaultActiveBackgroundColor := StyleSheet colorAt:'arrowButtonActiveBackgroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   561
    DefaultActiveForegroundColor := StyleSheet colorAt:'arrowButtonActiveForegroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   562
    DefaultEnteredBackgroundColor := StyleSheet colorAt:'arrowButtonEnteredBackgroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   563
    DefaultEnteredForegroundColor := StyleSheet colorAt:'arrowButtonEnteredForegroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   564
    DefaultDisabledForegroundColor := StyleSheet colorAt:'arrowButtonDisabledForegroundColor'.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   565
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   566
    DownArrowForm := StyleSheet at:'arrowButtonDownForm' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   567
    UpArrowForm := StyleSheet at:'arrowButtonUpForm' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   568
    LeftArrowForm := StyleSheet at:'arrowButtonLeftForm' default:nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   569
    RightArrowForm := StyleSheet at:'arrowButtonRightForm' default:nil.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   570
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   571
    UpArrowFormFile := DownArrowFormFile := LeftArrowFormFile := RightArrowFormFile := nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   572
    UpArrowForm isNil ifTrue:[
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   573
        UpArrowFormFile := StyleSheet at:'arrowButtonUpFormFile' default:'ScrollUp.xbm'.
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   574
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   575
    DownArrowForm isNil ifTrue:[
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   576
        DownArrowFormFile := StyleSheet at:'arrowButtonDownFormFile' default:'ScrollDn.xbm'.
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   577
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   578
    LeftArrowForm isNil ifTrue:[
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   579
        LeftArrowFormFile := StyleSheet at:'arrowButtonLeftFormFile' default:'ScrollLt.xbm'.
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   580
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   581
    RightArrowForm isNil ifTrue:[
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   582
        RightArrowFormFile := StyleSheet at:'arrowButtonRightFormFile' default:'ScrollRt.xbm'.
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   583
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   584
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   585
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   586
     self updateStyleCache
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   587
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   588
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   589
    "Modified: 31.8.1995 / 03:01:14 / claus"
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   590
    "Modified: 1.3.1996 / 13:45:57 / cg"
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   591
! !
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   592
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   593
!ArrowButton methodsFor:'accessing'!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   594
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   595
direction:aDirectionSymbol
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   596
    |form|
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   597
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   598
    aDirectionSymbol == #up ifTrue:[
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   599
	form := (self class upArrowButtonForm:arrowStyle on:device).
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   600
	name := 'upButton'.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   601
    ].
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   602
    aDirectionSymbol == #down ifTrue:[
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   603
	form := (self class downArrowButtonForm:arrowStyle on:device).
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   604
	name := 'downButton'.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   605
    ].
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   606
    aDirectionSymbol == #left ifTrue:[
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   607
	form := (self class leftArrowButtonForm:arrowStyle on:device).
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   608
	name := 'leftButton'.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   609
    ].
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   610
    aDirectionSymbol == #right ifTrue:[
62
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   611
	form := (self class rightArrowButtonForm:arrowStyle on:device).
7cc1e330da47 *** empty log message ***
claus
parents: 60
diff changeset
   612
	name := 'rightButton'.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   613
    ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   614
    self form:form
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   615
! !
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   616
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   617
!ArrowButton methodsFor:'initialization'!
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   618
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   619
initStyle
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   620
    super initStyle.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   621
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   622
    DefaultBackgroundColor notNil ifTrue:[
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   623
	bgColor := DefaultBackgroundColor on:device
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   624
    ].
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   625
    DefaultForegroundColor notNil ifTrue:[
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   626
	fgColor := DefaultForegroundColor on:device
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   627
    ].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   628
    DefaultActiveForegroundColor notNil ifTrue:[
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   629
	activeFgColor := DefaultActiveForegroundColor on:device
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   630
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   631
    DefaultActiveBackgroundColor notNil ifTrue:[
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   632
	activeBgColor := DefaultActiveBackgroundColor on:device
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   633
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   634
    DefaultEnteredForegroundColor notNil ifTrue:[
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   635
	enteredFgColor := DefaultEnteredForegroundColor on:device
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   636
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   637
    DefaultEnteredBackgroundColor notNil ifTrue:[
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   638
	enteredBgColor := DefaultEnteredBackgroundColor on:device
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   639
    ].
153
claus
parents: 139
diff changeset
   640
    DefaultDisabledForegroundColor notNil ifTrue:[
claus
parents: 139
diff changeset
   641
	disabledFgColor := DefaultDisabledForegroundColor on:device
claus
parents: 139
diff changeset
   642
    ].
claus
parents: 139
diff changeset
   643
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   644
    arrowStyle := DefaultArrowStyle.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   645
128
claus
parents: 77
diff changeset
   646
    DefaultArrowButtonActiveLevel notNil ifTrue:[onLevel := DefaultArrowButtonActiveLevel].
claus
parents: 77
diff changeset
   647
    DefaultArrowButtonPassiveLevel notNil ifTrue:[offLevel := DefaultArrowButtonPassiveLevel].
claus
parents: 77
diff changeset
   648
    offLevel ~~ level ifTrue:[self level:offLevel].
claus
parents: 77
diff changeset
   649
claus
parents: 77
diff changeset
   650
"/    "
claus
parents: 77
diff changeset
   651
"/     special treatment for motif arrows 
claus
parents: 77
diff changeset
   652
"/     - they do not really fit into the general (bitmap) scheme ...
claus
parents: 77
diff changeset
   653
"/    "
claus
parents: 77
diff changeset
   654
"/    arrowStyle == #motif ifTrue:[
claus
parents: 77
diff changeset
   655
"/        onLevel := 0.
claus
parents: 77
diff changeset
   656
"/        offLevel := 0.
claus
parents: 77
diff changeset
   657
"/        self level:0.
claus
parents: 77
diff changeset
   658
"/    ]
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   659
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   660
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   661
initialize
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   662
    super initialize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   663
    controller beTriggerOnDown.
1
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   664
! !
3ebee08bea15 Initial revision
claus
parents:
diff changeset
   665
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   666
!ArrowButton methodsFor:'redrawing'!
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   667
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   668
drawWith:fg and:bg
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   669
    "this is a q&d hack for motif ..."
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   670
155
claus
parents: 154
diff changeset
   671
    |topLeft botRight noColor allColor isString orgX orgY r|
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   672
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   673
    arrowStyle ~~ #motif ifTrue:[
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   674
        ^ super drawWith:fg and:bg.
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   675
    ].
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   676
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   677
    "
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   678
     the code below does a lot of bitmap drawing, but allows
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   679
     to 3D-ify any logo (it draws it displaced by some pixels
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   680
     to the upper left in one-color and displaced to the 
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   681
     lower right in the other color). It should be rewritten to
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   682
     cache the result for later drawing operations.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   683
    "
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   684
    logo notNil ifTrue:[
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   685
        self paint:bg.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   686
        self fillRectangleX:0 y:0 width:width height:height.
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   687
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   688
        shadowColor := shadowColor on:device.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   689
        lightColor := lightColor on:device.
153
claus
parents: 139
diff changeset
   690
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   691
        controller pressed ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   692
            topLeft := shadowColor.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   693
            botRight := lightColor
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   694
        ] ifFalse:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   695
            topLeft := lightColor.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   696
            botRight := shadowColor
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   697
        ].
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   698
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   699
        isString := logo isString.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   700
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   701
        isString ifFalse:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   702
            logo depth ~~ 1 ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   703
                "/ allow for deep logos (for motif)
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   704
                "/ one catch: if the view background is a complex pixmap
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   705
                "/ we cannot use this as colorMap entry.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   706
                "/ therefore, compute their average colors and take these
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   707
                "/ (this looks ok for buttons ...)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   708
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   709
                logo device ~~ device ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   710
'deep logo: ' print. logo depth printCR.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   711
                    r := (0@0 corner:10@10).
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   712
                    logo colorMap:(Array with:(bg averageColorIn:r)
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   713
                                         with:(topLeft averageColorIn:r)
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   714
                                         with:(botRight averageColorIn:r)
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   715
                                         with:(fg averageColorIn:r)).
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   716
                    logo photometric:#palette.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   717
                    logo := logo on:device.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   718
                ].
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   719
                self displayForm:logo x:labelOriginX  y:labelOriginY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   720
                ^ self
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   721
            ]
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   722
        ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   723
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   724
        noColor := Color noColor.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   725
        allColor := Color allColor.
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   726
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   727
        isString ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   728
            orgY := height - font height // 2 + font ascent.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   729
            orgX := width - labelOriginX // 4 - 1.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   730
        ].
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   731
        self paint:topLeft.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   732
        #(-1 0 -1) with:#(-1 -1 0) do:[:dX :dY |
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   733
            isString ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   734
                self displayString:logo x:orgX+dX  y:orgY+dY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   735
            ] ifFalse:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   736
                self displayForm:logo x:labelOriginX+dX  y:labelOriginY+dY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   737
            ]    
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   738
        ].
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   739
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   740
        self paint:botRight.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   741
        #(1 1 0) with:#(0 1 1) do:[:dX :dY |
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   742
            isString ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   743
                self displayString:logo x:orgX+dX  y:orgY+dY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   744
            ] ifFalse:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   745
                self displayForm:logo x:labelOriginX+dX  y:labelOriginY+dY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   746
            ]    
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   747
        ].
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   748
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   749
        "
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   750
         finally, the form itself
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   751
        "
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   752
        self paint:fg.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   753
        isString ifTrue:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   754
            self displayString:logo x:orgX y:orgY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   755
        ] ifFalse:[
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   756
            self displayForm:logo x:labelOriginX  y:labelOriginY.
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   757
        ]    
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   758
    ]
153
claus
parents: 139
diff changeset
   759
claus
parents: 139
diff changeset
   760
    "Modified: 31.8.1995 / 03:03:12 / claus"
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   761
    "Modified: 14.6.1996 / 15:48:11 / cg"
6
fd1b68b48422 *** empty log message ***
claus
parents: 1
diff changeset
   762
! !
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   763
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   764
!ArrowButton class methodsFor:'documentation'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   765
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   766
version
765
ea6ecf2a5b30 keep deep device image cached
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   767
    ^ '$Header: /cvs/stx/stx/libwidg/ArrowButton.st,v 1.26 1996-06-14 14:16:05 cg Exp $'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   768
! !