VariablePanel.st
author Claus Gittinger <cg@exept.de>
Tue, 19 May 1998 16:21:49 +0200
changeset 1529 509edab0a08b
parent 1416 b915d4f7709c
child 1550 f0297a144983
permissions -rw-r--r--
allow handleImage to be specified in styleSheet
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
SimpleView subclass:#VariablePanel
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    14
	instanceVariableNames:'barHeight barWidth separatingLine shadowForm lightForm showHandle
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
		handlePosition handleColor handleStyle handleLevel noColor
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
    16
		trackLine redrawLocked orientation handleLabels knobHeight'
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    17
	classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
		DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    19
		DefaultHandleLevel DefaultVCursor DefaultHCursor
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    20
		DefaultHandleImage'
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    21
	poolDictionaries:''
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    22
	category:'Views-Layout'
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
    25
!VariablePanel class methodsFor:'documentation'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 1991 by Claus Gittinger
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	      All Rights Reserved
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    a View to separate its subviews vertically by a movable bar;
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    the size-ratios of the subviews can be changed by moving this bar.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    In order to correctly setup this kind of view, the subviews must
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    be created with a relative origin & relative corner.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    The panel does not verify the relative subview bounds; 
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    therefore, it is your responsibility to set those relative sizes to fit
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    according the orientation (see bad example below).
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    The bar-handle is either an exposed knob (style == #motif)
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    or the form defined in Scroller (style ~~ #motif)
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    or nothing.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    Typically creation is done as:
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    58
        p := VariablePanel in:superView.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    59
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    61
        v1 := <someViewClass> origin:0.0 @ 0.0
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    62
                              corner:1.0 @ 0.5
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    63
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    64
        v2 := <someViewClass> origin:0.0 @ 0.5 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    65
                              corner:1.0 @ 0.8 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    66
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    67
        v3 := <someViewClass> origin:0.0 @ 0.8 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    68
                              corner:1.0 @ 1.0
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    69
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    70
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    71
    The two subclasses VariableHorizontalPanel and VariableVerticalPanel
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    72
    preset the orientation. They are a kept for backward compatibility
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    73
    (in previous versions, there used to be no common VariablePanel (super-) class).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    Notice: if it is required to insert a fixed-size view in the panel,
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    use an extra view & insets, and place the subview into that extra view.
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
    77
    See examples.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    78
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
    79
    [instance Variables:]
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    80
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    81
        barHeight               <Integer>       the height of the bar (for verticalPanels)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    82
        barWidth                <Integer>       the width of the bar  (for horizontalPanels)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    83
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    84
        separatingLine          <Boolean>       show a separating line (as in motif style)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    85
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    86
        shadowForm              <Image/Form>    form (shadow part) drawn as handle - if nonNil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    87
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    88
        lightForm               <Image/Form>    form (light part) drawn as handle - if nonNil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    89
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    90
        showHandle              <Boolean>       if false, no handle is drawn
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    91
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    92
        handlePosition          <Symbol>        where is the handle - one of #left, #center, #right
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    93
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    94
        handleColor             <Color>         inside color of handle - defaults to viewBackground
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    95
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    96
        handleStyle             <Symbol>        type of handle; one of #next, #motif or nil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    97
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    98
        handleLevel             <Integer>       3D level of handle (only valid if no form is given)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    99
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   100
        trackLine               <Boolean>       if true, an inverted line is drawn for tracking;
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   101
                                                otherwise, the whole bar is inverted.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   102
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   103
        redrawLocked                            internal - locks redraws while tracking
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   104
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   105
        orientation             <Symbol>        one of #horizontal / #vertical
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   106
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   107
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   108
    [styleSheet values:]
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   109
        variablePanel.showHandle        true/false - should a handle be shown (default:true)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   110
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   111
        variablePanel.handleStyle       #next / #motif / #iris / #full / nil (special handles)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   112
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   113
        variablePanel.handlePosition    #left / #center / #right (default:#right)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   114
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   115
        variablePanel.handleLevel       3D level of heandle (default:2)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   116
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   117
        variablePanel.trackingLine      when moved, track an inverted line (as in motif)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   118
                                        as opposed to tracking the whole bar (default:false)
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   119
                                        (obsoleted by trackingStyle)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   120
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   121
        variablePanel.trackingStyle     #solidRectangle / #solidLine / #dashedLine
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   122
                                        detailed control over how to draw tracking
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   123
                                        (obsoletes trackingLine above)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   124
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   125
        variablePanel.separatingLine    draw a separating line in the bar as in motif (default:false)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   126
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   127
        variablePanel.handleColor       color of the handle. (default:Black)
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   128
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   129
        variablePanel.handleEnteredColor 
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   130
                                        color of the handle when the pointer is in the bar (default:nil)
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   131
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   132
    [see also:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   133
        PanelView
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   134
        
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   135
    [author:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   136
        Claus Gittinger
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
examples
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
"
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   142
   example (notice that the subviews MUST have relative bounds):
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   143
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   144
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   146
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   147
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   149
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   150
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   151
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   152
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   153
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   155
        v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   156
        v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   157
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   159
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   160
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   161
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   163
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   164
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   168
   change the handles level:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   169
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   170
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   172
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   173
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   175
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   176
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   177
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   178
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   179
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   180
        p handleLevel:-1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   182
        v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   183
        v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   184
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   186
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   187
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   188
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   190
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   191
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   195
   change the handles style to nil makes it invisible:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   196
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   197
        |top p v1 v2 v3|
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   198
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   199
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   200
        top extent:300@300.
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   201
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   202
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   203
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   204
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   205
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   206
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   207
        p handleStyle:nil.
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   208
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   209
        v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   210
        v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   211
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   212
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   213
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   214
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   215
        v3 viewBackground:(Color yellow).
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   216
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   217
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   218
                                                                        [exEnd]
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   219
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   220
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   221
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   222
   define your own handle (-bitmap):
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   223
                                                                        [exBegin]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   224
        |top p v1 v2 v3|
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   225
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   226
        top := StandardSystemView new.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   227
        top extent:300@300.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   228
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   229
        p := VariablePanel 
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   230
                 origin:0.0 @ 0.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   231
                 corner:1.0 @ 1.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   232
                 in:top.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   233
        p orientation:#vertical.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   234
        p handleImage:(Image fromFile:'bitmaps/ScrollLt.8.xbm').
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   235
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   236
        v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   237
        v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   238
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   239
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   240
        v1 viewBackground:(Color red).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   241
        v2 viewBackground:(Color green).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   242
        v3 viewBackground:(Color yellow).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   243
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   244
        top open
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   245
                                                                        [exEnd]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   246
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   247
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   248
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   249
   another handle-bitmap:
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   250
                                                                        [exBegin]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   251
        |top p v1 v2 v3|
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   252
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   253
        top := StandardSystemView new.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   254
        top extent:300@300.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   255
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   256
        p := VariablePanel 
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   257
                 origin:0.0 @ 0.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   258
                 corner:1.0 @ 1.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   259
                 in:top.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   260
        p orientation:#vertical.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   261
        p handleImage:(Form width:9
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   262
                            height:11
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   263
                            fromArray:#(
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   264
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   265
                                        2r00001000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   266
                                        2r00011100 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   267
                                        2r00111110 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   268
                                        2r01111111 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   269
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   270
                                        2r01111111 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   271
                                        2r00111110 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   272
                                        2r00011100 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   273
                                        2r00001000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   274
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   275
                                       )
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   276
                      ).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   277
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   278
        v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   279
        v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   280
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   281
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   282
        v1 viewBackground:(Color red).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   283
        v2 viewBackground:(Color green).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   284
        v3 viewBackground:(Color yellow).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   285
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   286
        top open
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   287
                                                                        [exEnd]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   288
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   289
    placing scrolled and unscrolled views into a variablePanel:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   290
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   291
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   293
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   294
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   296
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   297
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   298
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   299
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   300
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   302
        v1 := ScrollableView for:SelectionInListView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   303
        v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   304
        v1 list:(FileDirectory directoryNamed:'/etc') contents.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   305
        v1 action:[:selNr |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   306
                |fullName stream text|
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   307
                fullName := '/etc/' , v1 selectionValue.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   308
                stream := fullName asFilename readStream.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   309
                stream notNil ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   310
                    text := stream contents.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   311
                    v2 contents:text.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   312
                    v3 contents:text
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   313
                ]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   314
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   316
        v2 := TextView origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   318
        v3 := ScrollableView for:TextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   319
        v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   320
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   321
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   324
    dynamically adding/removing views:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   325
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   326
        |top p v1 v2 b|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   328
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   329
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   331
        b := Toggle label:'show' in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   332
        b showLamp:false.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   333
        b origin:0.0 @ 0.0 corner:(1.0 @ 40).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   334
        b action:[:state |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   335
                state ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   336
                    b label:'hide'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   337
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   338
                    v2 := ScrollableView for:EditTextView.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   339
                    v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   340
                    v2 contents:'another text'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   341
                    p addSubView:v2.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   342
                    v2 realize.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   343
                ] ifFalse:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   344
                    b label:'show'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   345
                    v2 destroy.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   346
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   347
                ]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   348
            ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   350
        p := VariablePanel
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   351
                origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   352
                corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   353
                in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   354
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   355
        p topInset:50.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   357
        v1 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   358
        v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   359
        v1 contents:'some text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   361
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   362
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   365
    dynamically flipping orientation:
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
    Notice: you have to change the relative bounds of the subviews first.
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   367
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   368
        |top p v1 v2 b|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   370
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   371
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   373
        b := Toggle label:'flip' in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   374
        b showLamp:false.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   375
        b origin:0.0 @ 0.0 corner:(1.0 @ 40).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   376
        b action:[:state |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   377
                state ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   378
                    v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   379
                    v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   380
                    p orientation:#horizontal.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   381
                ] ifFalse:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   382
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   383
                    v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   384
                    p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   385
                ].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   386
            ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   388
        p := VariablePanel
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   389
                origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   390
                corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   391
                in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   392
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   393
        p topInset:50.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   395
        v1 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   396
        v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   397
        v1 contents:'some text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   399
        v2 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   400
        v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   401
        v2 contents:'another text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   403
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   404
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   407
   combining fix-size with variable size:
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
   (need 3 extra frame-views to place the extra labels into)
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   409
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   410
        |top p v1 l1 v2 l2 v3 l3 f1 f2 f3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   412
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   413
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   415
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   416
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   417
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   418
                 in:top.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   420
        p orientation:#vertical.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   421
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   422
        f1 := View origin:0.0@0.0 corner:1.0@0.3 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   423
        f2 := View origin:0.0@0.3 corner:1.0@0.6 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   424
        f3 := View origin:0.0@0.6 corner:1.0@1.0 in:p.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   426
        v1 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   427
        v2 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f2.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   428
        v3 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f3.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   430
        l1 := Label label:'sub1' in:f1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   431
        l2 := Label label:'sub2' in:f2.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   432
        l3 := Label label:'sub3' in:f3.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   434
        l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   435
           bottomInset:(l1 preferredExtent y negated).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   436
        l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   437
           bottomInset:(l2 preferredExtent y negated).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   438
        l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   439
           bottomInset:(l3 preferredExtent y negated).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   441
        v1 topInset:(l1 preferredExtent y); level:-1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   442
        v2 topInset:(l2 preferredExtent y); level:-1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   443
        v3 topInset:(l3 preferredExtent y); level:-1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   445
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   446
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   447
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   449
        top open
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   450
                                                                        [exEnd]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   451
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   452
   VerticalPansels allow a label to be associated with the
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   453
   handles; this looks much like the above, but is slightly
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   454
   more compact. Notice, no label can be placed above the first 
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   455
   view - it has no handle.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   456
                                                                        [exBegin]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   457
        |top p v1 v2 v3|
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   458
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   459
        top := StandardSystemView new.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   460
        top extent:300@300.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   461
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   462
        p := VariablePanel 
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   463
                 origin:0.0 @ 0.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   464
                 corner:1.0 @ 1.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   465
                 in:top.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   466
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   467
        p orientation:#vertical.
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   468
        p handleLabels:#('ignored' 'sub2' 'sub3').
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   469
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   470
        v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   471
        v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   472
        v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   473
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   474
        v1 viewBackground:(Color red).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   475
        v2 viewBackground:(Color green).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   476
        v3 viewBackground:(Color yellow).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   477
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   478
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   479
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   481
   handle labels can be more than strings ....
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   482
   (however, they should have about the same height, since
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   483
    the largest defines heights of all bars;
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   484
    retry the example below with a larger bitmap image ...)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   485
                                                                        [exBegin]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   486
        |top e p v1 v2 v3|
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   487
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   488
        top := StandardSystemView new.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   489
        top extent:300@300.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   490
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   491
        p := VariablePanel 
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   492
                 origin:0.0 @ 0.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   493
                 corner:1.0 @ 1.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   494
                 in:top.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   495
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   496
        p orientation:#vertical.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   497
        e := Array with:#bold
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   498
                   with:#color->Color red.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   499
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   500
        p handleLabels:(Array with:nil
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   501
                              with:('bold and red' asText emphasizeAllWith:e)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   502
                              with:(Image fromFile:'ScrollRt.xbm')).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   503
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   504
        v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   505
        v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   506
        v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   507
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   508
        v1 viewBackground:(Color red).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   509
        v2 viewBackground:(Color green).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   510
        v3 viewBackground:(Color yellow).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   511
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   512
        top open
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   513
                                                                        [exEnd]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   514
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   515
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
   BAD EXAMPLE (wrong relative sizes - repaired on handle move):
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   518
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   519
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   521
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   522
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   524
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   525
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   526
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   527
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   528
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   530
        v1 := View origin:0.0 @ 0.0   corner:1.0 @ (1/4) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   531
        v2 := View origin:0.0 @ (1/2) corner:1.0 @ (3/4) in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   532
        v3 := View origin:0.0 @ (3/4) corner:1.0 @ 1.0   in:p.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   534
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   535
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   536
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   538
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   539
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   543
!VariablePanel class methodsFor:'defaults'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   545
cursorForOrientation:orientation
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   546
    "return an appropriate cursor"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   547
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   548
    |cursor|
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   549
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   550
    orientation == #vertical ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   551
        DefaultVCursor notNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   552
            cursor := DefaultVCursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   553
        ] ifFalse:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   554
            cursor := Cursor 
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   555
                        sourceForm:(Image fromFile:'bitmaps/VVPanel.xbm')
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   556
                        maskForm:(Image fromFile:'bitmaps/VVPanel_m.xbm')
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   557
                        hotX:8
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   558
                        hotY:8.
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   559
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   560
             if bitmaps are not available, use a standard cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   561
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   562
            cursor isNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   563
                "which one looks better ?"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   564
                cursor := Cursor upDownArrow
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   565
                "cursor := Cursor upLimitArrow"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   566
            ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   567
            DefaultVCursor := cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   568
        ]
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   569
    ] ifFalse:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   570
        DefaultHCursor notNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   571
            cursor := DefaultHCursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   572
        ] ifFalse:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   573
            cursor := Cursor 
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   574
                        sourceForm:(Image fromFile:'bitmaps/VHPanel.xbm')
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   575
                        maskForm:(Image fromFile:'bitmaps/VHPanel_m.xbm')
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   576
                        hotX:8
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   577
                        hotY:8.
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   578
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   579
             if bitmaps are not available, use a standard cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   580
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   581
            cursor isNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   582
                "which one looks better ?"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   583
                cursor := Cursor leftRightArrow
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   584
                "cursor := Cursor leftLimitArrow"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   585
            ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   586
            DefaultHCursor := cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   587
        ]
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   588
    ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   589
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   590
    ^ cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   591
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   592
    "Created: 28.3.1997 / 13:40:01 / cg"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   593
    "Modified: 28.3.1997 / 14:45:29 / cg"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   594
!
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   595
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
lightFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
    "use same handle as Scroller"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
    ^ Scroller handleLightFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
shadowFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    "use same handle as Scroller"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
    ^ Scroller handleShadowFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
updateStyleCache
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   609
    "extract values from the styleSheet and cache them in class variables"
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   610
1388
ac52d9b7c8dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   611
    <resource: #style (#'variablePanel.showHandle' 
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   612
                       #'variablePanel.handleStyle'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   613
                       #'variablePanel.handleImage'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   614
                       #'variablePanel.handlePosition' 
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   615
                       #'variablePanel.handleLevel'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   616
                       #'variablePanel.trackingLine'   
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   617
                       #'variablePanel.trackingStyle'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   618
                       #'variablePanel.separatingLine' 
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   619
                       #'variablePanel.handleColor')>
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   620
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   621
    |lineModeBoolean|
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   622
1350
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   623
    DefaultShowHandle := StyleSheet at:'variablePanel.showHandle' default:true.
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   624
    DefaultHandleStyle := StyleSheet at:'variablePanel.handleStyle'.
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   625
    DefaultHandlePosition := StyleSheet at:'variablePanel.handlePosition' "default:#right".
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   626
    DefaultHandlePosition isNil ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   627
        DefaultHandlePosition := ScrollableView defaultScrollBarPosition.
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   628
    ].
1350
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   629
    DefaultHandleLevel := StyleSheet at:'variablePanel.handleLevel' default:2.
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   630
    DefaultTrackingLine := StyleSheet at:'variablePanel.trackingStyle'.
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   631
    DefaultTrackingLine isNil ifTrue:[
1350
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   632
        lineModeBoolean := StyleSheet at:'variablePanel.trackingLine' default:false.
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   633
        lineModeBoolean ifTrue:[
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   634
            DefaultTrackingLine := #solidLine
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   635
        ] ifFalse:[
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   636
            DefaultTrackingLine := #solidRectangle
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   637
        ]
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   638
    ].
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   639
1350
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   640
    DefaultSeparatingLine := StyleSheet at:'variablePanel.separatingLine' default:false.
a25b2a5f3c7c new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   641
    DefaultHandleColor := StyleSheet colorAt:'variablePanel.handleColor' default:Black.
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   642
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   643
    DefaultHandleImage := StyleSheet at:'variablePanel.handleImage'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   644
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   645
    "
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   646
     VariablePanel updateStyleCache
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   647
    "
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   648
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   649
    "Modified: / 19.5.1998 / 16:08:54 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
!VariablePanel methodsFor:'accessing'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
addSubView:aView
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   655
    "a view is added; adjust other subviews sizes"
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   656
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
    super addSubView:aView.
1043
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   658
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   659
"/    (aView relativeOrigin isNil 
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   660
"/    or:[aView relativeExtent isNil and:[aView relativeCorner isNil]]) ifTrue:[
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   661
"/        aView geometryLayout:nil.
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   662
"/        aView origin:0.0@0.0.
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   663
"/        aView extent:1.0@0.5.
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   664
"/        self setupSubviews
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   665
"/    ].
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   666
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
    realized ifTrue:[
1043
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   668
        self resizeSubviews.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
    ]
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
    "Created: 17.1.1996 / 22:41:00 / cg"
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   672
    "Modified: 24.2.1996 / 19:05:05 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
orientation
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   676
    "return my orientation; either #horizontal or #vertical"
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   677
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
    ^ orientation
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   679
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   680
    "Modified: 6.3.1996 / 18:08:45 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
orientation:aSymbol
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   684
    "change  my orientation; aSymbol must be one of #horizontal or #vertical.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   685
     Changing implies a resize of my subViews."
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   686
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   687
    aSymbol ~~ orientation ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   688
        orientation := aSymbol.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   689
        self initCursor.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   690
        self anyNonRelativeSubviews ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   691
            self setupSubviews
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   692
        ].
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   693
        shown ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   694
            self cursor:cursor.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   695
            self sizeChanged:nil.
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   696
            self invalidate.
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   697
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
    ]
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   699
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   700
    "Modified: 29.5.1996 / 16:22:35 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   703
removeSubView:aView
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   704
    "a view is removed; adjust other subviews sizes"
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   705
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   706
    super removeSubView:aView.
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   707
    shown ifTrue:[
1043
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   708
        (superView isNil or:[superView shown]) ifTrue:[
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   709
            self setupSubviews.
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   710
            self resizeSubviews.
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
   711
        ]
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   712
    ]
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   713
! !
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   714
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   715
!VariablePanel methodsFor:'accessing-look'!
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   716
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
barHeight
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
    "return the height of the separating bar"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   720
    ^ barHeight
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   721
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
barHeight:nPixel
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
    "set the height of the separating bar"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
    barHeight := nPixel.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
1207
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   728
    "make certain bar is visible and catchable"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
    (barHeight < 4) ifTrue:[
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   730
        barHeight := 4
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   733
    "make it even, so spacing is equally spreadable among subviews"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
    barHeight odd ifTrue:[
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   735
        barHeight := barHeight + 1
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
    ]
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   737
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   738
    "Modified: 7.11.1996 / 20:07:11 / cg"
1207
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   739
    "Modified: 28.4.1997 / 14:30:33 / dq"
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   740
!
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   741
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   742
handleImage:aBitmapOrImage
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   743
    "define the handles image"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   744
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   745
    shadowForm := aBitmapOrImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   746
    lightForm := nil.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   747
    self computeBarHeight.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   748
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   749
    "Created: 7.11.1996 / 20:21:10 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   750
    "Modified: 7.11.1996 / 20:27:22 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   753
handleLabels:aCollectionOfLabels
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   754
    orientation == #horizontal ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   755
        self error:'not allowed for horizontal panels'
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   756
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   757
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   758
    handleLabels := aCollectionOfLabels.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   759
    self computeBarHeight.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   760
    self resizeSubviews.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   761
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   762
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   763
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
handleLevel:aNumber
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
    "define the 3D level of the handle (only with some styles).
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
     Normally, this is defined via styleSheet files, but this entry allows
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
     individual views to be manipulated."
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
    handleLevel := aNumber
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   770
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
handlePosition
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
    "return the position of the handle"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
    ^ handlePosition
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
handlePosition:aSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
    "define the position of the handle; the argument aSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
     may be one of #left, #right or #center"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
    handlePosition := aSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   785
handleShadowImage:shadowImage lightImage:lightImage
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   786
    "define the handles image; both shadow and light parts"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   787
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   788
    shadowForm := shadowImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   789
    lightForm := lightImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   790
    self computeBarHeight.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   791
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   792
    "Created: 7.11.1996 / 20:21:51 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   793
    "Modified: 7.11.1996 / 20:27:26 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   794
!
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   795
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   796
handleStyle:styleSymbol
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   797
    "define the style of the handle;
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   798
     styleSymbol may be #motif to draw a little knob or
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   799
     anything else to draw scrollBars handleForm.
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   800
     Normally, this is defined via styleSheet files, but this entry allows
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   801
     individual views to be manipulated."
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   803
    (styleSymbol ~~ handleStyle) ifTrue:[
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   804
        handleStyle := styleSymbol.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   805
        handleStyle == #next ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   806
            shadowForm := self class shadowFormOn:device.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   807
            lightForm := self class lightFormOn:device.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   808
        ] ifFalse:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   809
            shadowForm := lightForm := nil
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   810
        ].
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   811
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   812
        shadowForm notNil ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   813
            (self is3D and:[handleStyle ~~ #motif]) ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   814
                self barHeight:(shadowForm height + 2).
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   815
                barWidth := shadowForm width
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   816
            ]
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   817
        ].
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   818
        shown ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   819
            self resizeSubviews.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   820
            self invalidate
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   821
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
    ]
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   823
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   824
    "Created: 24.2.1996 / 19:04:07 / cg"
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   825
    "Modified: 29.5.1996 / 16:22:24 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
style:styleSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    "define the style of the handle;
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
     styleSymbol may be #motif to draw a little knob or
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
     anything else to draw scrollBars handleForm.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
     Normally, this is defined via styleSheet files, but this entry allows
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
     individual views to be manipulated."
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   835
    self handleStyle:styleSymbol
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   837
    "Modified: 24.2.1996 / 19:04:19 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
!VariablePanel methodsFor:'drawing'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   842
drawHandle:hIndex atX:hx y:hy
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
    "draw a single handle at hx/hy"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   845
    |h w x y m lbl maxKnob
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   846
     mar           "{ Class: SmallInteger }"
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   847
     barWidthInt   "{ Class: SmallInteger }"
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   848
     barHeightInt  "{ Class: SmallInteger }" |
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
   850
    (handleStyle isNil 
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
   851
    or:[handleStyle == #none]) ifTrue:[^ self].
396
973d4a9fa32c setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents: 395
diff changeset
   852
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   853
    mar := margin.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   854
    barHeightInt := barHeight.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   855
    barWidthInt := barWidth.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   856
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   857
    shadowForm notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   858
        h := shadowForm height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   859
        w := shadowForm width .
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   860
        maxKnob := h min:barHeightInt.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
    ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   862
        maxKnob := knobHeight min: barHeightInt.
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   863
        maxKnob := maxKnob max:4.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   864
        w := h := maxKnob - 4.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
    self paint:viewBackground.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
   868
    self lineStyle:#solid.
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
   869
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
    orientation == #vertical ifTrue:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   871
        self fillRectangleX:mar y:hy 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   872
                      width:(width - mar - mar) 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   873
                     height:barHeightInt.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   874
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   875
        (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   876
            m := (maxKnob - h) // 2.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   877
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   878
            shadowForm isNil ifTrue:[
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   879
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   880
                y := hy + (barHeightInt // 2).   "/ center of the bar
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   882
                separatingLine ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   883
                    self paint:shadowColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   884
                    self displayLineFromX:mar y:y toX:(width - mar) y:y.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   885
                    y := y + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   886
                    self paint:lightColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   887
                    self displayLineFromX:mar y:y toX:(width - mar) y:y.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   888
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   889
                self paint:viewBackground.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   890
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   891
                self fillRectangleX:(hx - barWidthInt) y:hy 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   892
                             width:(barWidthInt + barWidthInt) 
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   893
                             height:h.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   895
                handleStyle == #line ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   896
                    self paint:handleColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   897
                    self displayLineFromX:hx - barWidthInt y:y toX:hx + barWidthInt y:y
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   898
                ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   899
                    y := hy.   
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   900
                    handleStyle == #st80 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   901
                        y := y - 1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   902
                    ].
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   903
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   904
                    handleStyle == #full ifTrue:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   905
                        self drawEdgesForX:0-handleLevel
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   906
                                         y:(y + m)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   907
                                     width:width+handleLevel+handleLevel
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   908
                                    height:h 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   909
                                     level:handleLevel.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   910
                    ] ifFalse:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   911
                        self drawEdgesForX:(hx - barWidthInt)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   912
                                         y:(y + m)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   913
                                     width:(barWidthInt + barWidthInt)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   914
                                    height:h 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   915
                                     level:handleLevel.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   917
                        handleStyle == #iris ifTrue:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   918
                            self paint:handleColor.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   919
                            self fillDeviceRectangleX:(hx - barWidthInt + 2)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   920
                                                    y:(y + m + 2)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   921
                                                width:(barWidthInt + barWidthInt - 4)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   922
                                               height:h - 4
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   923
                        ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   924
                    ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   925
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   926
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   927
                y := hy.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   928
                self drawHandleFormAtX:hx y:(y + m)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   929
            ].
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   930
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   931
            handleStyle == #st80 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   932
                y := hy - 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   933
                self paint:lightColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   934
                self displayLineFromX:mar y:y toX:(width - mar - mar - 1) y:y.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   935
                self displayLineFromX:0 y:hy toX:0 y:(hy + knobHeight - 1).
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   936
                y := hy + knobHeight - 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   937
                self paint:shadowColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   938
                self displayLineFromX:mar y:y toX:(width - mar) y:y.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   939
                    "uncomment the -1 if you dont like the notch at the right end"
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   940
                    "                            VVV"
1119
3f872db73136 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   941
                self displayLineFromX:width-1 y:hy" "-1" " toX:width-1 y:(hy + knobHeight - 1 - 1).
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   942
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   943
        ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   944
            y := hy + barHeightInt - 1.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   945
            self paint:handleColor.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   946
            separatingLine ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   947
                self displayLineFromX:0 y:hy+1 toX:width y:hy+1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   948
                self displayLineFromX:0 y:y toX:width y:y.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   949
            ].
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   950
            self fillRectangleX:hx y:hy width:barWidthInt height:barHeightInt
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   951
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   953
        lbl := self handleLabelAt:hIndex.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   954
        lbl notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   955
            hIndex ~~ 1 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   956
                self paint:Color black.
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   957
                lbl isImageOrForm ifTrue:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   958
                    lbl displayOn:self x:mar y:hy
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   959
                ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   960
                    lbl displayOn:self x:mar y:hy + font ascent + 1
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   961
                ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   962
            ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   963
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   964
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   966
        self fillRectangleX:hx y:mar 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   967
                      width:barHeightInt
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   968
                     height:(height - mar - mar).
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   969
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   970
        (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   971
             m := (barHeightInt - w) // 2.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   972
             shadowForm isNil ifTrue:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   973
                x := hx + (barHeightInt // 2).
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   974
                separatingLine ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   975
                    self paint:shadowColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   976
                    self displayLineFromX:x y:mar toX:x y:(height - mar).
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   977
                    x := x + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   978
                    self paint:lightColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   979
                    self displayLineFromX:x y:mar toX:x y:(height - mar).
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   980
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   981
                self paint:viewBackground.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   982
                self fillRectangleX:hx y:(hy - barWidthInt) 
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   983
                              width:w 
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   984
                             height:(barWidthInt + barWidthInt).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   986
                handleStyle == #line ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   987
                    self paint:handleColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   988
                    self displayLineFromX:x y:hy - barWidthInt toX:x y:hy + barWidthInt.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   989
                ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   990
                    x := hx.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   991
                    handleStyle == #st80 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   992
                        x := x - 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   993
                    ].
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   994
                    handleStyle == #full ifTrue:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   995
                        self drawEdgesForX:(x + m)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   996
                                         y:0-handleLevel
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   997
                                     width:w
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   998
                                    height:height+handleLevel+handleLevel 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   999
                                     level:handleLevel.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1000
                    ] ifFalse:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1001
                        self drawEdgesForX:(x + m)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1002
                                         y:(hy - barWidthInt)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1003
                                     width:w 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1004
                                    height:(barWidthInt + barWidthInt)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1005
                                     level:handleLevel.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1006
                        handleStyle == #iris ifTrue:[
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1007
                            self paint:handleColor.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1008
                            self fillDeviceRectangleX:(x + m + 2)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1009
                                                    y:(hy - barWidthInt + 2)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1010
                                                width:w - 4
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1011
                                               height:(barWidthInt + barWidthInt - 4)
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1012
                        ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1013
                    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1014
                ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1015
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1016
                x := hx.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1017
                self drawHandleFormAtX:(x + m) y:hy
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1018
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1019
            handleStyle == #st80 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1020
                x := hx - 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1021
                self paint:lightColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1022
                self displayLineFromX:x y:mar toX:x y:(height - mar).
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1023
                self displayLineFromX:hx y:0 toX:(hx + barHeightInt - 1) y:0.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1024
                x := hx + barHeightInt - 2.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1025
                self paint:shadowColor.
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1026
                self displayLineFromX:x y:mar toX:x y:(height - mar).
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1027
                    "uncomment the -1 if you dont like the notch at the bottom end"
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1028
                    "                   VVV"
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1029
                self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeightInt - 1) y:height-1.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1030
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1031
        ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1032
            x := hx + barHeightInt - 1.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1033
            self paint:handleColor.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1034
            separatingLine ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1035
                self displayLineFromX:hx+1 y:0 toX:hx+1 y:height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1036
                self displayLineFromX:x y:0 toX:x y:height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1037
            ].
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1038
            self fillRectangleX:hx y:hy width:barHeightInt height:barWidthInt
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1039
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1042
    "Modified: / 1.11.1997 / 11:55:05 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
drawHandleFormAtX:hx y:hy
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
    "draw a handles bitmap at hx/hy"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1047
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1048
    shadowForm notNil ifTrue:[
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1049
        self paint:shadowColor.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1050
        self displayForm:shadowForm x:hx y:hy.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1051
    ].
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1052
    lightForm notNil ifTrue:[
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1053
        self paint:lightColor.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1054
        self displayForm:lightForm x:hx y:hy.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1055
    ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
    self paint:viewBackground
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1057
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1058
    "Modified: 7.11.1996 / 20:25:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
invertHandleBarAtX:hx y:hy
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1062
    trackLine == #dashedLine ifTrue:[
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1063
        self lineStyle:#dashed.
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1064
    ].
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1065
1220
9bc6add9aa54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  1066
    self clippedByChildren:false.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1067
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
    self xoring:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1069
        |yL xL halfHeight|
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1070
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1071
        halfHeight := barHeight // 2.
1207
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
  1072
        yL := hy + halfHeight - 1.
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
  1073
        xL := hx + halfHeight - 1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1074
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1075
        orientation == #vertical ifTrue:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1076
            (trackLine == #solidLine 
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1077
            or:[trackLine == #dashedLine]) ifTrue:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1078
                self displayLineFromX:0 y:yL toX:width y:yL.
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1079
            ] ifFalse:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1080
                self fillRectangleX:0 y:hy width:width height:barHeight
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1081
            ]
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1082
        ] ifFalse:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1083
            (trackLine == #solidLine 
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1084
            or:[trackLine == #dashedLine]) ifTrue:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1085
                self displayLineFromX:xL y:0 toX:xL y:height.
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1086
            ] ifFalse:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1087
                self fillRectangleX:hx y:0 width:barHeight height:height
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1088
            ]
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1089
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
    ].
1220
9bc6add9aa54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  1091
    self clippedByChildren:true.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1092
    trackLine == #dashedLine ifTrue:[
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1093
        self lineStyle:#solid.
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1094
    ].
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1095
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1096
    "Modified: 19.3.1997 / 11:18:54 / cg"
1207
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
  1097
    "Modified: 28.4.1997 / 14:56:26 / dq"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
lockRedraw
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
    redrawLocked := true
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
redraw
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    "redraw all of the handles"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
    redrawLocked ~~ true ifTrue:[
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1108
        self redrawHandlesFrom:1 to:(self subViews size)
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1110
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1111
    "Modified: 28.1.1997 / 17:54:15 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
redrawHandlesFrom:start to:stop
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
    "redraw some handles"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1117
    (self subViews size > 0) ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1118
        showHandle ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1119
            self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex |
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1120
                self drawHandle:hIndex atX:(hPoint x) y:(hPoint y)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1121
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1122
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1124
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1125
    "Modified: 28.1.1997 / 17:54:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
unlockRedraw
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1129
    redrawLocked := false
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1130
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1131
1159
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1132
!VariablePanel methodsFor:'enumerating subviews'!
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1133
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1134
changeSequenceOrderFor:aSubView to:anIndex
1416
b915d4f7709c comment
Claus Gittinger <cg@exept.de>
parents: 1388
diff changeset
  1135
    "change a subview's position in the subviews collection.
1159
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1136
    "
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1137
    |success|
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1138
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1139
    success := super changeSequenceOrderFor:aSubView to:anIndex.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1140
    success ifTrue:[
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1141
        self setupSubviews.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1142
        self resizeSubviews.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1143
    ].
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1144
    ^ success
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1145
! !
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1146
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
!VariablePanel methodsFor:'event handling'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
sizeChanged:how
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
    "my size has changed; resize my subviews"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
    shown ifTrue:[
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1153
        (how == #smaller) ifTrue:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1154
            self resizeSubviews
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1155
        ] ifFalse:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1156
            "/
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1157
            "/ do it in reverse order, to avoid some redraws
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1158
            "/
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1159
            self resizeSubviewsFrom:(self subViews size) to:1
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1160
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
    self changed:#sizeOfView with:how.
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1163
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1164
    "Modified: 28.1.1997 / 17:56:30 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
!VariablePanel methodsFor:'initializing'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1168
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1169
computeBarHeight
958
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1170
    "compute the height if the separating bar from either the
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1171
     form or an explicit height given in the styleSheet"
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1172
1362
f2a9bc6ad68d new resource naming
Claus Gittinger <cg@exept.de>
parents: 1350
diff changeset
  1173
    <resource: #style (#'variablePanel.barHeight')>
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1174
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1175
    |bH h|
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1176
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1177
    shadowForm notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1178
        bH := shadowForm height + 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1179
    ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1180
        self is3D ifTrue:[
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1181
            h := 2
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1182
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1183
            h := 2
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1184
        ].
1362
f2a9bc6ad68d new resource naming
Claus Gittinger <cg@exept.de>
parents: 1350
diff changeset
  1185
        bH := styleSheet at:'variablePanel.barHeight'.
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1186
        bH isNil ifTrue:[
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1187
            h := styleSheet at:'variablePanel.barHeightMM' default:h.
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1188
            bH := (h * device verticalPixelPerMillimeter) rounded.
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1189
        ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1190
    ].
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1191
    self barHeight:bH.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1192
    knobHeight := bH.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1193
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1194
    handleLabels notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1195
        font := font on:device.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1196
        bH := handleLabels inject:bH into:[:maxSoFar :thisLabel |
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1197
                                           thisLabel isNil ifTrue:[
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1198
                                                maxSoFar
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1199
                                           ] ifFalse:[
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1200
                                                maxSoFar max:(thisLabel heightOn:self)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1201
                                           ]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1202
                                          ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1203
        bH := bH + font descent - 1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1204
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1205
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1206
    self barHeight:bH.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1207
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1208
    "Modified: / 31.10.1997 / 22:23:44 / cg"
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1209
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1210
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
defaultControllerClass
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
    ^ VariablePanelController
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
fixSize 
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1216
    super fixSize.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
    extentChanged ifTrue:[
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1218
        self resizeSubviews
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1219
    ].
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1220
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1221
    "Modified: 22.3.1997 / 01:19:55 / stefan"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
initCursor
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
    "set the cursor - a double arrow"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
  1227
    cursor := self class cursorForOrientation:orientation
900
0541b96dd173 use Image instead of Form
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
  1228
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
  1229
    "Modified: 28.3.1997 / 14:45:44 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
initStyle
966
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1233
    "setup viewStyle specifics"
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1234
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1235
    |mm|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
    super initStyle.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
    handleColor := DefaultHandleColor on:device.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
    DefaultHandleStyle isNil ifTrue:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1242
        handleStyle := styleSheet name
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
    ] ifFalse:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1244
        handleStyle := DefaultHandleStyle
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1245
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1246
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1247
    handleLevel := DefaultHandleLevel.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1248
    showHandle := DefaultShowHandle.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1249
    handlePosition := DefaultHandlePosition.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
    trackLine := DefaultTrackingLine.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1251
    separatingLine := DefaultSeparatingLine.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1252
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1253
    DefaultHandleImage notNil ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1254
        shadowForm := DefaultHandleImage onDevice:device.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1255
        barWidth := shadowForm width.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1256
    ] ifFalse:[
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1257
        handleStyle == #next ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1258
            DefaultHandleImage notNil ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1259
                shadowForm := DefaultHandleImage onDevice:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1260
            ] ifFalse:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1261
                shadowForm := self class shadowFormOn:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1262
                lightForm := self class lightFormOn:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1263
            ].
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1264
            barWidth := shadowForm width.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1265
        ] ifFalse:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1266
            shadowForm := lightForm := nil.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1267
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1268
            mm := device verticalPixelPerMillimeter.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1269
            barWidth := (1.5 * mm) rounded. "motif style width"
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1270
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1271
    ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1272
    self computeBarHeight.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1273
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1274
    handleStyle == #mswindows ifTrue:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1275
        barWidth := (ArrowButton new direction:#up) width + 1 
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1276
    ].
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1277
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1278
    "Modified: / 19.5.1998 / 16:21:02 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1279
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1281
initialize
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1282
    orientation isNil ifTrue:[orientation := #vertical].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1283
    super initialize.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1284
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1285
    "Modified: 7.3.1996 / 14:08:25 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1286
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1287
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1288
!VariablePanel methodsFor:'private'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1289
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1290
anyNonRelativeSubviews
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1291
    "return true, if any of my subviews has no relative origin/extent"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1292
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1293
    self subViews do:[:aComponent |
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1294
        aComponent relativeCorner isNil ifTrue:[^ true].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1295
        aComponent relativeOrigin isNil ifTrue:[^ true]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1296
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1297
    ^ false
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1298
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1299
    "Modified: 28.1.1997 / 17:57:26 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1301
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1302
handleLabelAt:hIndex
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1303
    handleLabels notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1304
        ^ handleLabels at:hIndex ifAbsent:nil
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1305
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1306
    ^ nil
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1307
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1308
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1309
handleOriginsWithIndexDo:aBlock
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1310
    "evaluate the argument block for every handle-origin"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1311
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1312
    self handleOriginsWithIndexFrom:1 to:(self subViews size) do:aBlock
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1313
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1314
    "Modified: 28.1.1997 / 17:53:44 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1317
handleOriginsWithIndexFrom:start to:stop do:aBlock
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
    "evaluate the argument block for some handle-origins"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1319
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1320
    |x y hw hh hDelta vDelta subViews
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
     first "{ Class: SmallInteger }"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
     last  "{ Class: SmallInteger }"|
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1324
    (subViews := self subViews) notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1325
        shadowForm notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1326
            hw := shadowForm width.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1327
            hh := shadowForm height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1328
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1329
            hw := hh := barWidth
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1330
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1331
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1332
        (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1333
            hDelta := barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1334
            vDelta := barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1335
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1336
            hDelta := vDelta := 0
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1337
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1338
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1339
        (handlePosition == #left) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1340
            x := hDelta. 
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1341
            y := vDelta.
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1342
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1343
            orientation == #vertical ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1344
                x := x + barWidth
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1345
            ] ifFalse:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1346
                y := y + barWidth
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1347
            ].
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1348
            margin ~~ 0 ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1349
                x := x + 2
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1350
            ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1351
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1352
            (handlePosition == #right) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1353
                x := width - hw - margin - hDelta.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1354
                y := height - hh - margin - vDelta.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1355
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1356
                x := width - barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1357
                y := height - barWidth // 2
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1358
            ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1359
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1360
        first := start + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1361
        last := stop.
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1362
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1363
        first to:last do:[:index |
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1364
            |view|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1366
            view := subViews at:index.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1367
            orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1368
                y := view top "origin y" - barHeight + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1369
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1370
                x := view left "origin x" - barHeight + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1371
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1372
            aBlock value:(x @ y) value:index
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1373
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1375
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1376
    "Modified: / 1.11.1997 / 11:53:40 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1377
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1378
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
resizeSubviews
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1380
    "readjust size of all subviews"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1382
    self resizeSubviewsFrom:1 to:(self subViews size)
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1383
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1384
    "Modified: 28.1.1997 / 17:54:42 / cg"
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1385
    "Modified: 22.3.1997 / 01:01:31 / stefan"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1386
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1387
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
resizeSubviewsFrom:start to:stop
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1389
    "readjust size of some subviews"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1391
    |step nSubviews subViews|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1393
    (subViews := self subViews) size > 0 ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1394
        (start <= stop) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1395
            step := 1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1396
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1397
            step := -1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1398
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1399
        nSubviews := subViews size.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1400
        start to:stop by:step do:[:index |
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1401
            |bw view o1 o2 relOrg relCorner newOrg newCorner newExt|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1403
            view := subViews at:index.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1404
            bw := view borderWidth.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1405
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1406
            index == 1 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1407
                o1 := 0.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1408
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1409
                o1 := barHeight // 2 - bw
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1410
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1411
            index ==  nSubviews ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1412
                o2 := 0.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1413
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1414
                o2 := barHeight // 2 - bw
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1415
            ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1417
            newOrg := view computeOrigin.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1418
            newOrg notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1419
                (index ~~ 1) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1420
                    orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1421
                        newOrg y:(newOrg y + o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1422
                    ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1423
                        newOrg x:(newOrg x + o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1424
                    ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1425
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1426
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1427
            newExt := view computeExtent.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1428
            newExt notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1429
                orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1430
                    newExt y:(newExt y - o2 - o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1431
                ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1432
                    newExt x:(newExt x - o2 - o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1433
                ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1434
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1435
            view pixelOrigin:newOrg extent:newExt.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1436
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
    ]
873
d1274f0256a6 removed transcript message
Claus Gittinger <cg@exept.de>
parents: 871
diff changeset
  1438
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1439
    "Modified: 28.1.1997 / 17:55:03 / cg"
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  1440
    "Modified: 22.3.1997 / 01:02:21 / stefan"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1441
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1442
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1443
setupSubviews
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
    "setup subviews sizes (in case of non-relative sizes)"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1445
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1446
    |pos delta subViews nSubViews "{ Class: SmallInteger }"|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1447
300
0823ef38e629 adding/removing views to Panels
ah
parents: 299
diff changeset
  1448
    "/ setup all subviews to spread evenly ...
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1449
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1450
    subViews := self subViews.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1451
    nSubViews := subViews size.
1043
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
  1452
    nSubViews == 0 ifTrue:[^ self].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1453
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1454
    pos := 0.0. 
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1455
    delta := 1.0 / nSubViews.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1456
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1457
    1 to:nSubViews do:[:index |
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1458
        |view|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1459
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1460
        view := subViews at:index.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1461
        orientation == #vertical ifTrue:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1462
            index == subViews size ifTrue:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1463
                view origin:(0.0 @ pos) corner:(1.0 @ 1.0)
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1464
            ] ifFalse:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1465
                view origin:(0.0 @ pos) corner:(1.0 @ (pos + delta))
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1466
            ].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1467
        ] ifFalse:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1468
            index == subViews size ifTrue:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1469
                view origin:(pos @ 0.0) corner:(1.0 @ 1.0)
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1470
            ] ifFalse:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1471
                view origin:(pos @ 0.0) corner:((pos + delta) @ 1.0)
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1472
            ].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1473
        ].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1474
        pos := pos + delta
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1475
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1476
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1477
    "Modified: 28.1.1997 / 17:56:20 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1478
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1480
!VariablePanel methodsFor:'private tableView protocol'!
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1481
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1482
setupSubviewOrigins
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1483
    "setup subviews origins 
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1484
     if we only have relative extents 
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1485
     (Variable Panels need relative origins and corners!!) (SV 16.1.95)"
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1486
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1487
    |x y e eX eY subViews n "{ Class: SmallInteger }"|
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1488
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1489
    x := y := 0.0.
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1490
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1491
    subViews := self subViews.
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1492
    n := subViews size.
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1493
    1 to:n do:[:index |
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1494
        |view|
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1495
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1496
        view := subViews at:index.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1497
        e := view relativeExtent.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1498
        e notNil ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1499
            view relativeExtent:nil.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1500
            eX := e x.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1501
            eY := e y.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1502
            index == n ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1503
                view origin:(x @ y) corner:(1.0 @ 1.0)
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1504
            ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1505
                orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1506
                    view origin:(x @ y) corner:(1.0 @ (y+eY))
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1507
                ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1508
                    view origin:(x @ y) corner:((x+eX) @ 1.0)
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1509
                ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1510
            ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1511
            orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1512
                y := y + eY.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1513
            ] ifFalse:[    
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1514
                x := x + eX.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1515
            ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1516
        ] ifFalse: [
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1517
            view origin:(x @ y).
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1518
            orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1519
                y := view relativeCorner y.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1520
            ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1521
                x := view relativeCorner x.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1522
            ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1523
        ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1524
    ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1525
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  1526
    "Modified: 21.8.1996 / 10:01:29 / stefan"
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1527
    "Modified: 28.1.1997 / 17:55:21 / cg"
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1528
! !
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  1529
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1530
!VariablePanel class methodsFor:'documentation'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1532
version
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1533
    ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.39 1998-05-19 14:21:49 cg Exp $'
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
! !