VariablePanel.st
author Claus Gittinger <cg@exept.de>
Sun, 31 Oct 2010 13:01:12 +0100
changeset 4187 16652b9859a7
parent 4043 9e0d97fd4b21
child 4206 570f1a1e587e
permissions -rw-r--r--
snapAdornment stuff cleanup
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
"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
    12
"{ Package: 'stx:libwidg' }"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
    13
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
SimpleView subclass:#VariablePanel
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    15
	instanceVariableNames:'barHeight barWidth barLevel separatingLine shadowForm lightForm
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    16
		showHandle handlePosition handleColor handleStyle handleLevel
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    17
		noColor trackLine redrawLocked orientation handleLabels
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    18
		knobHeight realRelativeSizes snapAdornment'
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    19
	classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
		DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    21
		DefaultHandleLevel DefaultVCursor DefaultHCursor
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
    22
		DefaultHandleImage DefaultSnapIcons DefaultSnapHandlePosition'
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    23
	poolDictionaries:''
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    24
	category:'Views-Layout'
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    27
Object subclass:#SnapAdornment
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    28
	instanceVariableNames:'level mode selectedLevel enterLevel selectedBgColor enterBgColor
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    29
		iconLeftRight iconUpDown iconLeft iconRight iconUp iconDown width
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    30
		height'
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    31
	classVariableNames:''
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    32
	poolDictionaries:''
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    33
	privateIn:VariablePanel
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    34
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
    35
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
    36
!VariablePanel class methodsFor:'documentation'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
copyright
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
 COPYRIGHT (c) 1991 by Claus Gittinger
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
	      All Rights Reserved
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
 This software is furnished under a license and may be used
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
 only in accordance with the terms of that license and with the
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
 inclusion of the above copyright notice.   This software may not
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
 be provided or otherwise made available to, or used by, any
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
 other person.  No title to or ownership of the software is
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
 hereby transferred.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
!
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
documentation
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    a View to separate its subviews vertically by a movable bar;
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    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
    56
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    In order to correctly setup this kind of view, the subviews must
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    be created with a relative origin & relative corner.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    The panel does not verify the relative subview bounds; 
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    therefore, it is your responsibility to set those relative sizes to fit
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    according the orientation (see bad example below).
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    The bar-handle is either an exposed knob (style == #motif)
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    or the form defined in Scroller (style ~~ #motif)
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    or nothing.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    Typically creation is done as:
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    69
        p := VariablePanel in:superView.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    70
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    72
        v1 := <someViewClass> origin:0.0 @ 0.0
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    73
                              corner:1.0 @ 0.5
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    74
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    75
        v2 := <someViewClass> origin:0.0 @ 0.5 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    76
                              corner:1.0 @ 0.8 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    77
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    78
        v3 := <someViewClass> origin:0.0 @ 0.8 
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    79
                              corner:1.0 @ 1.0
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    80
                                  in:p.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    81
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    82
    The two subclasses VariableHorizontalPanel and VariableVerticalPanel
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    83
    preset the orientation. They are a kept for backward compatibility
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    84
    (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
    85
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    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
    87
    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
    88
    See examples.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    89
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
    90
    [instance Variables:]
496
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
        barHeight               <Integer>       the height of the bar (for verticalPanels)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    93
        barWidth                <Integer>       the width of the bar  (for horizontalPanels)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    94
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    95
        separatingLine          <Boolean>       show a separating line (as in motif style)
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    96
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    97
        shadowForm              <Image/Form>    form (shadow part) drawn as handle - if nonNil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    98
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    99
        lightForm               <Image/Form>    form (light part) drawn as handle - if nonNil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   100
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   101
        showHandle              <Boolean>       if false, no handle is drawn
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
        handlePosition          <Symbol>        where is the handle - one of #left, #center, #right
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
        handleColor             <Color>         inside color of handle - defaults to viewBackground
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
        handleStyle             <Symbol>        type of handle; one of #next, #motif or nil
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   108
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   109
        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
   110
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   111
        trackLine               <Boolean>       if true, an inverted line is drawn for tracking;
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   112
                                                otherwise, the whole bar is inverted.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   113
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   114
        redrawLocked                            internal - locks redraws while tracking
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   115
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   116
        orientation             <Symbol>        one of #horizontal / #vertical
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   117
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   118
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   119
    [styleSheet values:]
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   120
        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
   121
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   122
        variablePanel.handleStyle       #next / #motif / #iris / #full / nil (special handles)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   123
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   124
        variablePanel.handlePosition    #left / #center / #right (default:#right)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   125
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   126
        variablePanel.handleLevel       3D level of heandle (default:2)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   127
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   128
        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
   129
                                        as opposed to tracking the whole bar (default:false)
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   130
                                        (obsoleted by trackingStyle)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   131
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   132
        variablePanel.trackingStyle     #solidRectangle / #solidLine / #dashedLine
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   133
                                        detailed control over how to draw tracking
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   134
                                        (obsoletes trackingLine above)
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   135
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   136
        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
   137
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   138
        variablePanel.handleColor       color of the handle. (default:Black)
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   139
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   140
        variablePanel.handleEnteredColor 
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   141
                                        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
   142
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   143
    [see also:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   144
        PanelView
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   145
        
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   146
    [author:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   147
        Claus Gittinger
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
examples
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
"
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   153
   example (notice that the subviews MUST have relative bounds):
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   154
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   155
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   157
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   158
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   160
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   161
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   162
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   163
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   164
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   166
        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
   167
        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
   168
        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
   169
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   170
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   171
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   172
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   174
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   175
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   179
   change the handles level:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   180
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   181
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   183
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   184
        top extent:300@300.
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
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   187
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   188
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   189
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   190
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   191
        p handleLevel:-1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   193
        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
   194
        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
   195
        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
   196
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   197
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   198
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   199
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   201
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   202
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   206
   change the handles style to nil makes it invisible:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   207
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   208
        |top p v1 v2 v3|
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   209
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   210
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   211
        top extent:300@300.
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
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   214
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   215
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   216
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   217
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   218
        p handleStyle:nil.
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   219
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   220
        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
   221
        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
   222
        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
   223
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   224
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   225
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   226
        v3 viewBackground:(Color yellow).
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   227
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   228
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   229
                                                                        [exEnd]
397
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   230
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   231
7038c3c38ced *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 396
diff changeset
   232
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   233
   define your own handle (-bitmap):
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   234
                                                                        [exBegin]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   235
        |top p v1 v2 v3|
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   236
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   237
        top := StandardSystemView new.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   238
        top extent:300@300.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   239
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   240
        p := VariablePanel 
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   241
                 origin:0.0 @ 0.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   242
                 corner:1.0 @ 1.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   243
                 in:top.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   244
        p orientation:#vertical.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   245
        p handleImage:(Image fromFile:'bitmaps/ScrollLt.8.xbm').
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   246
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   247
        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
   248
        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
   249
        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
   250
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   251
        v1 viewBackground:(Color red).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   252
        v2 viewBackground:(Color green).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   253
        v3 viewBackground:(Color yellow).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   254
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   255
        top open
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   256
                                                                        [exEnd]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   257
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   258
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   259
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   260
   another handle-bitmap:
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   261
                                                                        [exBegin]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   262
        |top p v1 v2 v3|
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   263
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   264
        top := StandardSystemView new.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   265
        top extent:300@300.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   266
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   267
        p := VariablePanel 
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   268
                 origin:0.0 @ 0.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   269
                 corner:1.0 @ 1.0
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   270
                 in:top.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   271
        p orientation:#vertical.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   272
        p handleImage:(Form width:9
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   273
                            height:11
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   274
                            fromArray:#(
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   275
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   276
                                        2r00001000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   277
                                        2r00011100 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   278
                                        2r00111110 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   279
                                        2r01111111 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   280
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   281
                                        2r01111111 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   282
                                        2r00111110 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   283
                                        2r00011100 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   284
                                        2r00001000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   285
                                        2r00000000 2r00000000
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   286
                                       )
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   287
                      ).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   288
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   289
        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
   290
        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
   291
        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
   292
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   293
        v1 viewBackground:(Color red).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   294
        v2 viewBackground:(Color green).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   295
        v3 viewBackground:(Color yellow).
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   296
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   297
        top open
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   298
                                                                        [exEnd]
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   299
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   300
    placing scrolled and unscrolled views into a variablePanel:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   301
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   302
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   304
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   305
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   307
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   308
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   309
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   310
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   311
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   313
        v1 := ScrollableView for:SelectionInListView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   314
        v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   315
        v1 list:(FileDirectory directoryNamed:'/etc') contents.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   316
        v1 action:[:selNr |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   317
                |fullName stream text|
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   318
                fullName := '/etc/' , v1 selectionValue.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   319
                stream := fullName asFilename readStream.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   320
                stream notNil ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   321
                    text := stream contents.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   322
                    v2 contents:text.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   323
                    v3 contents:text
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   324
                ]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   325
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   327
        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
   328
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   329
        v3 := ScrollableView for:TextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   330
        v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   331
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   332
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   335
    dynamically adding/removing views:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   336
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   337
        |top p v1 v2 b|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   339
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   340
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   342
        b := Toggle label:'show' in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   343
        b showLamp:false.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   344
        b origin:0.0 @ 0.0 corner:(1.0 @ 40).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   345
        b action:[:state |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   346
                state ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   347
                    b label:'hide'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   348
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   349
                    v2 := ScrollableView for:EditTextView.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   350
                    v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   351
                    v2 contents:'another text'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   352
                    p addSubView:v2.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   353
                    v2 realize.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   354
                ] ifFalse:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   355
                    b label:'show'.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   356
                    v2 destroy.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   357
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   358
                ]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   359
            ].
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
        p := VariablePanel
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   362
                origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   363
                corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   364
                in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   365
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   366
        p topInset:50.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   368
        v1 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   369
        v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   370
        v1 contents:'some text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   372
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   373
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   376
    dynamically flipping orientation:
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
    Notice: you have to change the relative bounds of the subviews first.
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   378
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   379
        |top p v1 v2 b|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   381
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   382
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   384
        b := Toggle label:'flip' in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   385
        b showLamp:false.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   386
        b origin:0.0 @ 0.0 corner:(1.0 @ 40).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   387
        b action:[:state |
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   388
                state ifTrue:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   389
                    v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   390
                    v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   391
                    p orientation:#horizontal.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   392
                ] ifFalse:[
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   393
                    v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   394
                    v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   395
                    p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   396
                ].
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   397
            ].
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
        p := VariablePanel
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   400
                origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   401
                corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   402
                in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   403
        p orientation:#vertical.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   404
        p topInset:50.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   406
        v1 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   407
        v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   408
        v1 contents:'some text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   410
        v2 := ScrollableView for:EditTextView in:p.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   411
        v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   412
        v2 contents:'another text'.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   414
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   415
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   418
   combining fix-size with variable size:
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
   (need 3 extra frame-views to place the extra labels into)
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   420
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   421
        |top p v1 l1 v2 l2 v3 l3 f1 f2 f3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   423
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   424
        top extent:300@300.
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
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   427
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   428
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   429
                 in:top.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   431
        p orientation:#vertical.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   432
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   433
        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
   434
        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
   435
        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
   436
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   437
        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
   438
        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
   439
        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
   440
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   441
        l1 := Label label:'sub1' in:f1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   442
        l2 := Label label:'sub2' in:f2.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   443
        l3 := Label label:'sub3' in:f3.
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
        l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   446
           bottomInset:(l1 preferredExtent y negated).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   447
        l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   448
           bottomInset:(l2 preferredExtent y negated).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   449
        l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   450
           bottomInset:(l3 preferredExtent y negated).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   452
        v1 topInset:(l1 preferredExtent y); level:-1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   453
        v2 topInset:(l2 preferredExtent y); level:-1.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   454
        v3 topInset:(l3 preferredExtent y); level:-1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   456
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   457
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   458
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   460
        top open
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   461
                                                                        [exEnd]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   462
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   463
   VerticalPansels allow a label to be associated with the
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   464
   handles; this looks much like the above, but is slightly
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   465
   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
   466
   view - it has no handle.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   467
                                                                        [exBegin]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   468
        |top p v1 v2 v3|
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
        top := StandardSystemView new.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   471
        top extent:300@300.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   472
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   473
        p := VariablePanel 
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   474
                 origin:0.0 @ 0.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   475
                 corner:1.0 @ 1.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   476
                 in:top.
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
        p orientation:#vertical.
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   479
        p handleLabels:#('ignored' 'sub2' 'sub3').
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   480
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   481
        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
   482
        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
   483
        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
   484
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   485
        v1 viewBackground:(Color red).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   486
        v2 viewBackground:(Color green).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   487
        v3 viewBackground:(Color yellow).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   488
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   489
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   490
                                                                        [exEnd]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   492
   handle labels can be more than strings ....
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   493
   (however, they should have about the same height, since
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   494
    the largest defines heights of all bars;
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   495
    retry the example below with a larger bitmap image ...)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   496
                                                                        [exBegin]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   497
        |top e p v1 v2 v3|
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   498
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   499
        top := StandardSystemView new.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   500
        top extent:300@300.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   501
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   502
        p := VariablePanel 
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   503
                 origin:0.0 @ 0.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   504
                 corner:1.0 @ 1.0
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   505
                 in:top.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   506
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   507
        p orientation:#vertical.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   508
        e := Array with:#bold
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   509
                   with:#color->Color red.
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   510
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   511
        p handleLabels:(Array with:nil
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   512
                              with:('bold and red' asText emphasizeAllWith:e)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   513
                              with:(Image fromFile:'ScrollRt.xbm')).
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
        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
   516
        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
   517
        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
   518
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   519
        v1 viewBackground:(Color red).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   520
        v2 viewBackground:(Color green).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   521
        v3 viewBackground:(Color yellow).
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   522
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   523
        top open
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   524
                                                                        [exEnd]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   525
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   526
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
   BAD EXAMPLE (wrong relative sizes - repaired on handle move):
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   529
                                                                        [exBegin]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   530
        |top p v1 v2 v3|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   532
        top := StandardSystemView new.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   533
        top extent:300@300.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   535
        p := VariablePanel 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   536
                 origin:0.0 @ 0.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   537
                 corner:1.0 @ 1.0
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   538
                 in:top.
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   539
        p orientation:#vertical.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   541
        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
   542
        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
   543
        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
   544
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   545
        v1 viewBackground:(Color red).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   546
        v2 viewBackground:(Color green).
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   547
        v3 viewBackground:(Color yellow).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   549
        top open
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   550
                                                                        [exEnd]
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   551
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   552
   example with snapMode:
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   553
                                                                        [exBegin]
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   554
        |top p v1 v2 v3|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   555
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   556
        top := StandardSystemView new.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   557
        top extent:300@300.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   558
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   559
        p := VariablePanel 
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   560
                 origin:0.0 @ 0.0
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   561
                 corner:1.0 @ 1.0
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   562
                 in:top.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   563
        p orientation:#vertical.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   564
        p snapMode:#min.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   565
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   566
        v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   567
        v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   568
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   569
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   570
        v1 viewBackground:(Color red).
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   571
        v2 viewBackground:(Color green).
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   572
        v3 viewBackground:(Color yellow).
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   573
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   574
        top open
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   575
                                                                        [exEnd]
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   576
4043
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   577
   example with redefined handle-image:
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   578
                                                                        [exBegin]
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   579
        |top p v1 v2 v3|
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   580
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   581
        top := StandardSystemView new.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   582
        top extent:300@300.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   583
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   584
        p := VariablePanel 
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   585
                 origin:0.0 @ 0.0
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   586
                 corner:1.0 @ 1.0
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   587
                 in:top.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   588
        p orientation:#vertical.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   589
        p handleImage:(ToolbarIconLibrary barResizeVerticalIcon).
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   590
        p showHandle:true.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   591
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   592
        v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   593
        v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   594
        v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p.
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   595
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   596
        v1 viewBackground:(Color red).
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   597
        v2 viewBackground:(Color green).
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   598
        v3 viewBackground:(Color yellow).
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   599
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   600
        top open
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   601
                                                                        [exEnd]
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   602
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   603
295
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
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   607
!VariablePanel class methodsFor:'defaults'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   609
cursorForOrientation:orientation
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   610
    "return an appropriate cursor"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   611
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   612
    ^ self cursorForOrientation:orientation onDevice:Display.
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   613
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   614
    "Modified: / 30.9.1998 / 18:21:10 / cg"
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   615
!
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   616
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   617
cursorForOrientation:orientation onDevice:device
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   618
    "return an appropriate cursor"
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   619
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   620
    |cursor|
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   621
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   622
    orientation == #vertical ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   623
        DefaultVCursor notNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   624
            cursor := DefaultVCursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   625
        ] ifFalse:[
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   626
            device platformName = 'WIN32' ifFalse:[
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   627
                cursor := Cursor 
2073
40873b6d96bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   628
                            sourceForm:(Smalltalk imageFromFileNamed:'VVPanel.xbm' forClass:self)
40873b6d96bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   629
                            maskForm:(Smalltalk imageFromFileNamed:'VVPanel_m.xbm' forClass:self)
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   630
                            hotX:8
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   631
                            hotY:8.
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   632
            ].
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   633
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   634
            "
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   635
             if bitmaps are not available or under Win95, 
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   636
             use a standard cursor
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   637
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   638
            cursor isNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   639
                "which one looks better ?"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   640
                cursor := Cursor upDownArrow
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   641
                "cursor := Cursor upLimitArrow"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   642
            ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   643
            DefaultVCursor := cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   644
        ]
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   645
    ] ifFalse:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   646
        DefaultHCursor notNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   647
            cursor := DefaultHCursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   648
        ] ifFalse:[
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   649
            device platformName = 'WIN32' ifFalse:[
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   650
                cursor := Cursor 
2073
40873b6d96bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   651
                            sourceForm:(Smalltalk imageFromFileNamed:'VHPanel.xbm' forClass:self)
40873b6d96bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   652
                            maskForm:(Smalltalk imageFromFileNamed:'VHPanel_m.xbm' forClass:self)
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   653
                            hotX:8
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   654
                            hotY:8.
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   655
            ].
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   656
            "
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   657
             if bitmaps are not available or under Win95, 
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   658
             use a standard cursor
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   659
            "
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   660
            cursor isNil ifTrue:[
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   661
                "which one looks better ?"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   662
                cursor := Cursor leftRightArrow
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   663
                "cursor := Cursor leftLimitArrow"
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   664
            ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   665
            DefaultHCursor := cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   666
        ]
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   667
    ].
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   668
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   669
    ^ cursor
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   670
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   671
    "
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   672
     DefaultVCursor := DefaultHCursor := nil.
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   673
    "
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   674
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   675
    "Created: / 30.9.1998 / 18:20:41 / cg"
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
   676
    "Modified: / 30.9.1998 / 18:23:07 / cg"
1158
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   677
!
225c0d52068d cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents: 1151
diff changeset
   678
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
lightFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
    "use same handle as Scroller"
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
    ^ Scroller handleLightFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
shadowFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
    "use same handle as Scroller"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
    ^ Scroller handleShadowFormOn:aDisplay
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   690
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   691
snapIcons
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   692
    "returns dictionary of snapIcons
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   693
    "
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   694
    |upIcon snapIcons|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   695
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   696
    DefaultSnapIcons isNil ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   697
        DefaultSnapIcons := IdentityDictionary new.
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   698
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   699
        DefaultSnapIcons at:#iconUp    put:self snapIconUp.
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   700
        DefaultSnapIcons at:#iconRight put:self snapIconRight.
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   701
        DefaultSnapIcons at:#iconDown  put:self snapIconDown.
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   702
        DefaultSnapIcons at:#iconLeft  put:self snapIconLeft.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
   703
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
   704
        DefaultSnapIcons at:#iconUpDown    put:self snapIconUpDown.
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   705
        DefaultSnapIcons at:#iconLeftRight put:self snapIconLeftRight.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   706
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   707
    ^ DefaultSnapIcons
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   708
"
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
   709
DefaultSnapIcons := nil.
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
   710
self snapIcons
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   711
"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   712
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
   713
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   714
updateStyleCache
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   715
    "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
   716
1388
ac52d9b7c8dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   717
    <resource: #style (#'variablePanel.showHandle' 
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   718
                       #'variablePanel.handleStyle'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   719
                       #'variablePanel.handleImage'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   720
                       #'variablePanel.handlePosition' 
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   721
                       #'variablePanel.handleLevel'
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
   722
                       #'variablePanel.snapHandlePosition' 
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   723
                       #'variablePanel.trackingLine'   
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   724
                       #'variablePanel.trackingStyle'
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   725
                       #'variablePanel.separatingLine' 
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   726
                       #'variablePanel.handleColor')>
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   727
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   728
    |lineModeBoolean|
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   729
2084
5e2d277d82a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2073
diff changeset
   730
    DefaultVCursor := DefaultHCursor := nil.
5e2d277d82a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2073
diff changeset
   731
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   732
    DefaultShowHandle := StyleSheet at:#'variablePanel.showHandle' default:true.
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   733
    DefaultHandleStyle := StyleSheet at:#'variablePanel.handleStyle'.
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   734
    DefaultHandlePosition := StyleSheet at:#'variablePanel.handlePosition' "default:#right".
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   735
    DefaultHandlePosition isNil ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   736
        DefaultHandlePosition := ScrollableView defaultScrollBarPosition.
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   737
    ].
2252
67269562b687 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   738
    DefaultSnapHandlePosition := StyleSheet at:#'variablePanel.snapHandlePosition' default:DefaultHandlePosition.
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   739
    DefaultHandleLevel := StyleSheet at:#'variablePanel.handleLevel' default:2.
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   740
    DefaultTrackingLine := StyleSheet at:#'variablePanel.trackingStyle'.
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   741
    DefaultTrackingLine isNil ifTrue:[
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   742
        lineModeBoolean := StyleSheet at:#'variablePanel.trackingLine' default:false.
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   743
        lineModeBoolean ifTrue:[
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   744
            DefaultTrackingLine := #solidLine
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   745
        ] ifFalse:[
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   746
            DefaultTrackingLine := #solidRectangle
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   747
        ]
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   748
    ].
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   749
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   750
    DefaultSeparatingLine := StyleSheet at:#'variablePanel.separatingLine' default:false.
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   751
    DefaultHandleColor := StyleSheet colorAt:#'variablePanel.handleColor' default:Black.
441
e170bca66a78 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
   752
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   753
    DefaultHandleImage := StyleSheet at:#'variablePanel.handleImage'
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   754
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   755
    "
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   756
     VariablePanel updateStyleCache
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   757
    "
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   758
2084
5e2d277d82a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2073
diff changeset
   759
    "Modified: / 13.12.1999 / 12:08:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   762
!VariablePanel class methodsFor:'image specs'!
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   763
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   764
snapIconDown
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   765
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   766
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   767
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   768
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   769
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   770
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   771
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   772
     self snapIconDown inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   773
     ImageEditor openOnClass:self andSelector:#snapIconDown
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   774
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   775
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   776
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   777
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   778
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   779
        constantNamed:#'VariablePanel class snapIconDown'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   780
        ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B(J *F(Z!!*F(Z!!*@@@@@@@!!BDHQ!!FDXQ!!FDXP@@H@@@EPUATEPUATEPUAT@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@A?LX1#FLX3>C8)R%JT)R''0GA#FLX1#FN@H@@@@@@@@P@@a') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   781
!
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   782
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   783
snapIconLeft
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   784
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   785
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   786
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   787
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   788
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   789
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   790
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   791
     self snapIconLeft inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   792
     ImageEditor openOnClass:self andSelector:#snapIconLeft
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   793
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   794
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   795
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   796
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   797
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   798
        constantNamed:#'VariablePanel class snapIconLeft'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   799
        ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   800
@C @B@@@@@@@@@@@@@@@@@@P@C@)@BD@IP@@@@@BJP@!!@BT@@@@@@B$HHP %@@@@AP@)@BD@IP@@D@T0JP@!!@BT@@@@ED2$@HP@%@@@@AP@)ARDHIP@@@@T@
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   801
JP@!!@BT@@A@ELB @HP@E@@@@@C\@@@@@@@@@@@@@@@T@B@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@A@0\OA0LA@D@6UPL@@@XE@0@@A TC@@@FAPL@@@XE@0@@A UCLD@FAPL@@@XE@0@@A TC@@DCA0=''T0D@@b') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   802
!
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   803
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   804
snapIconLeftRight
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   805
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   806
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   807
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   808
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   809
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   810
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   811
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   812
     self snapIconLeftRight inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   813
     ImageEditor openOnClass:self andSelector:#snapIconLeftRight
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   814
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   815
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   816
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   817
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   818
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   819
        constantNamed:#'VariablePanel class snapIconLeftRight'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   820
        ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   821
@@@@@@@K@AH@@@@@@AX@L@@@@@@(@BD@AQD@B@@FJ#@!!@AT@@@@@@J*@@@@@DP@H@AD*LBD@EP@@@@@@J"\!!B1T@@@@@E"(0HP@U@@@@@@B*$P@H@@X@L@@@
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   822
J @!!@AT@@@@@@B(RHP UDP@0@@@@@@@@@@@@I0@K@@@@@@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' LC <NK@ @@A@&QPLP@@XE@0@@C<A? A@VAPL@@@XE@0@@A TCL@@O @>@@BXE@0@PY$TCD@@A@0\OA0LAXb') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   823
!
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   824
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   825
snapIconRight
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   826
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   827
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   828
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   829
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   830
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   831
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   832
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   833
     self snapIconRight inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   834
     ImageEditor openOnClass:self andSelector:#snapIconRight
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   835
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   836
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   837
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   838
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   839
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   840
        constantNamed:#'VariablePanel class snapIconRight'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   841
        ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   842
@@L@@@@@@@@@@@@@@AT@B@@@J@@!!@@T@E@@@@B(QHS@U@AP@@@@*@BD@EP@T@@@@J L!!@AT@E@@@DB(0HP@U@AP@@@@*J"D@EP@T@@@@J @!!B!!TH@@@@@B(@
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   843
HP@U@@@@@A@*LBD@EP@@@@@@@@X@@@@@@@@@@@@@@@ @B@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@4A \G%2X4@AXE@0@@A TC@E@6AQL@@@XE@0@@A TC@@@6APL@@@XEL0@@A UC\@@VAPL@@@PFA0^''M PP@b') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   844
!
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   845
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   846
snapIconUp
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   847
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   848
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   849
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   850
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   851
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   852
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   853
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   854
     self snapIconUp inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   855
     ImageEditor openOnClass:self andSelector:#snapIconUp
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   856
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   857
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   858
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   859
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   860
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   861
        constantNamed:#'VariablePanel class snapIconUp'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   862
        ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@J *B(J *B(J (B @@@@@@BEHT!!REHT!!RDHP!!@@@@@@@EPUATEPUATE@TAP@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'B@@@@@@@@D@\X1#FLX1 8C9R%JT)R%G0_3FLX1#FL? @@@@@@@@@@@@a') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   863
!
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   864
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   865
snapIconUpDown
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   866
    "This resource specification was automatically generated
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   867
     by the ImageEditor of ST/X."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   868
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   869
    "Do not manually edit this!! If it is corrupted,
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   870
     the ImageEditor may not be able to read the specification."
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   871
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   872
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   873
     self snapIconUpDown inspect
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   874
     ImageEditor openOnClass:self andSelector:#snapIconUpDown
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   875
     Icon flushCachedIcons
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   876
    "
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   877
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   878
    <resource: #image>
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   879
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   880
    ^Icon
2590
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   881
        constantNamed:#'VariablePanel class snapIconUpDown'
9e2e11f928f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2533
diff changeset
   882
        ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@H@@@@@@ @@@@@@@@@B J@BB J@(@HJ@(@@@@@@@!!BDD !!BDHPBBDHP@@@@@@APE@HAPE@T@ E@T@@@@@@@@@@B@@@@@@H@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@J@@B @@@PLX)#FJX1?C )R%JT)R#8_A#JLX2#FGC>@@(@@J@@H@@a') ; yourself); yourself]
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
   883
! !
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
   884
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
!VariablePanel methodsFor:'accessing'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
2650
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   887
isHorizontal
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   888
    ^ orientation == #horizontal
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   889
!
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   890
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
orientation
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   892
    "return my orientation; either #horizontal or #vertical"
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   893
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
    ^ orientation
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   895
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   896
    "Modified: 6.3.1996 / 18:08:45 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
orientation:aSymbol
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   900
    "change  my orientation; aSymbol must be one of #horizontal or #vertical.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   901
     Changing implies a resize of my subViews."
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   902
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   903
    aSymbol ~~ orientation ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   904
        orientation := aSymbol.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   905
        self initCursor.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   906
        self anyNonRelativeSubviews ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   907
            self setupSubviews
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   908
        ].
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   909
        shown ifTrue:[
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   910
            self cursor:cursor.
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   911
            self sizeChanged:nil.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   912
            self redrawIfShown.
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   913
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
    ]
485
50cbbe748ac9 commentary
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   915
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   916
    "Modified: 29.5.1996 / 16:22:35 / cg"
2650
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   917
!
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   918
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   919
relativeCorners
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   920
    ^ self subViews 
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   921
        collect:[:eachView | 
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   922
                self isHorizontal ifTrue:[
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   923
                    eachView relativeCorner x
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   924
                ] ifFalse:[
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   925
                    eachView relativeCorner y
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   926
                ]
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   927
        ]
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   928
!
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   929
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   930
relativeCorners:aCollection
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   931
    |pos|
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   932
3278
a898d63d521e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
   933
    aCollection size == self subViews size ifFalse:[^ self ].
a898d63d521e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
   934
2650
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   935
    pos := 0.0.
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   936
    self subViews with:aCollection 
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   937
        do:[:eachView :eachCorner |
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   938
            self isHorizontal ifTrue:[
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   939
                eachView origin:(pos @ 0.0) corner:(eachCorner @ 1.0)
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   940
            ] ifFalse:[
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   941
                eachView origin:(0.0 @ pos) corner:(1.0 @ eachCorner)
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   942
            ].
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   943
            pos := eachCorner
e4fee3badbdd access to relative sizes
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   944
        ]
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   945
! !
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   946
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   947
!VariablePanel methodsFor:'accessing-look'!
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   948
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
barHeight
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   950
    "return the height of the separating bar"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
    ^ barHeight
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
barHeight:nPixel
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
    "set the height of the separating bar"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   958
    |bH|
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   959
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   960
    bH := nPixel.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
1207
2668cd0caee7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   962
    "make certain bar is visible and catchable"
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   963
    (bH < 4) ifTrue:[
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   964
        bH := 4
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   967
    "make it even, so spacing is equally spreadable among subviews"
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   968
    bH odd ifTrue:[
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   969
        bH := bH + 1
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   970
    ].
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   971
    self setBarHeight:bH
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   972
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   973
    "Modified: / 28.4.1997 / 14:30:33 / dq"
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   974
    "Modified: / 30.1.2000 / 22:31:32 / cg"
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   975
!
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   976
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   977
barLevel:level
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   978
    "set the 3D level of the separating bar"
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   979
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   980
    barLevel ~~ level ifTrue:[
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   981
        barLevel := level.
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   982
        self redrawIfShown.    
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   983
    ]
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   984
!
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   985
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   986
handleImage:aBitmapOrImage
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   987
    "define the handles image"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   988
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   989
    shadowForm := aBitmapOrImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   990
    lightForm := nil.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   991
    self computeBarHeight.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   992
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   993
    "Created: 7.11.1996 / 20:21:10 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
   994
    "Modified: 7.11.1996 / 20:27:22 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
   997
handleLabels:aCollectionOfLabels
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
   998
    "define special handle labels - typically a collection of
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
   999
     bitmap images. Notice, that the first handle is not
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1000
     drawn, that is, the first element if the argument is useless."
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1001
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1002
    orientation == #horizontal ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1003
        self error:'not allowed for horizontal panels'
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1004
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1005
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1006
    handleLabels := aCollectionOfLabels.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1007
    self computeBarHeight.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1008
    self resizeSubviews.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1009
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1010
    "
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1011
     |top panel v1 v2|
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1012
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1013
     top := StandardSystemView new.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1014
     panel := VariableVerticalPanel origin:0.0@0.0 corner:1.0@1.0 in:top.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1015
     panel add:(EditTextView origin:0.0@0.0 corner:1.0@0.5).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1016
     panel add:(EditTextView origin:0.0@0.5 corner:1.0@1.0).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1017
     panel handleStyle:nil.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1018
     panel handleLabels:#('foo' 'bar').
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1019
     top open
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1020
    "
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1021
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1022
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1023
handleLevel:aNumber
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1024
    "define the 3D level of the handle (only with some styles).
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1025
     Normally, this is defined via styleSheet files, but this entry allows
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1026
     individual views to be manipulated."
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
2244
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1028
    handleLevel ~~ aNumber ifTrue:[
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1029
        handleLevel := aNumber.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1030
        self redrawIfShown.    
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1031
    ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
handlePosition
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
    "return the position of the handle"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
    ^ handlePosition
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
handlePosition:aSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
    "define the position of the handle; the argument aSymbol
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1042
     may be one of #left, #right or #center.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1043
     If never set by the program, the position is controlled by the styleSheet."
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
2244
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1045
    handlePosition ~~ aSymbol ifTrue:[
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1046
        handlePosition := aSymbol ? DefaultHandlePosition.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1047
        self redrawIfShown.    
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1048
    ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1049
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1050
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1051
handleShadowImage:shadowImage lightImage:lightImage
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1052
    "define the handles image; both shadow and light parts"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1053
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1054
    shadowForm := shadowImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1055
    lightForm := lightImage.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1056
    self computeBarHeight.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1057
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1058
    "Created: 7.11.1996 / 20:21:51 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1059
    "Modified: 7.11.1996 / 20:27:26 / cg"
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1060
!
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1061
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1062
handleStyle:styleSymbol
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1063
    "define the style of the handle;
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1064
     styleSymbol may be #motif to draw a little knob or
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1065
     anything else to draw scrollBars handleForm.
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1066
     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
  1067
     individual views to be manipulated."
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1069
    (styleSymbol ~~ handleStyle) ifTrue:[
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1070
        handleStyle := styleSymbol.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1071
        handleStyle == #next ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1072
            shadowForm := self class shadowFormOn:device.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1073
            lightForm := self class lightFormOn:device.
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1074
        ] ifFalse:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1075
            shadowForm := lightForm := nil
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1076
        ].
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1077
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1078
        shadowForm notNil ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1079
            (self is3D and:[handleStyle ~~ #motif]) ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1080
                self barHeight:(shadowForm height + 2).
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1081
                barWidth := shadowForm width
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1082
            ]
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1083
        ].
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1084
        shown ifTrue:[
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1085
            self resizeSubviews.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1086
            self redrawIfShown.    
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1087
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
    ]
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1089
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1090
    "Created: 24.2.1996 / 19:04:07 / cg"
722
3f297a438fec use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1091
    "Modified: 29.5.1996 / 16:22:24 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
1948
e92d1005d6a3 direct access to barHeight
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  1094
setBarHeight:nPixel
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1095
    "check whether snap matches to extent of bar otherwise disable snap"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1096
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1097
    snapAdornment notNil ifTrue:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1098
        barHeight := nPixel max:(snapAdornment height ? 0)
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1099
    ] ifFalse:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1100
        barHeight := nPixel max:0
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1101
    ].
1948
e92d1005d6a3 direct access to barHeight
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  1102
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
  1103
    realized ifTrue:[
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1104
        self resizeSubviews
2108
b9322a905330 resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
  1105
    ]
1948
e92d1005d6a3 direct access to barHeight
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  1106
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1107
    "Modified: / 31-10-2010 / 13:00:06 / cg"
1948
e92d1005d6a3 direct access to barHeight
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  1108
!
e92d1005d6a3 direct access to barHeight
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  1109
2114
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1110
showHandle
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1111
    "return the the handle-drawing flag; aBoolean"
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1112
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1113
    ^ showHandle
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1114
!
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1115
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1116
showHandle:aBoolean
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1117
    "enabled/disable the handle-drawing"
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1118
2244
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1119
    showHandle ~~ aBoolean ifTrue:[
9366bda63514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2243
diff changeset
  1120
        showHandle := aBoolean ? DefaultShowHandle.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1121
        self redrawIfShown
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1122
    ]
2114
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1123
!
54afdc74da11 access to showHandle flag
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1124
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1125
snapHandlePosition
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1126
    "return the position of the snap-handle"
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1127
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1128
    ^ self handlePosition. "/ ^ snapHandlePosition
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1129
!
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1130
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1131
snapHandlePosition:aSymbol
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1132
    "define the position of the snap-handle; the argument aSymbol
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1133
     may be one of #left, #right or #center.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1134
     If never set by the program, the position is controlled by the styleSheet."
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1135
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1136
    self handlePosition:aSymbol.
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1137
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1138
"/    snapHandlePosition := aSymbol.
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1139
"/    realized ifTrue:[
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1140
"/        self invalidate
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1141
"/    ]
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1142
!
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  1143
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1144
snapMode
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1145
    "allowed modes are:
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1146
        nil             no snap
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1147
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1148
        #max            on press the view is increased to bottom(vertical) or right(horizontal)
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1149
        #min            on press the view is decreased to top   (vertical) or left (horizontal)
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1150
        #maxMin         on press the view is increased or decreased dependent on its current extent
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1151
        #minMax         on press the view is increased or decreased dependent on its current extent
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1152
    "
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1153
    snapAdornment notNil ifTrue:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1154
        ^ snapAdornment mode
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1155
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1156
    ^ nil
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1157
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1158
    "Modified: / 31-10-2010 / 13:00:16 / cg"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1159
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1160
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1161
snapMode:aMode
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1162
    "allowed modes are:
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1163
        nil             no snap
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1164
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1165
        #max            on press the view is increased to bottom(vertical) or right(horizontal)
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1166
        #min            on press the view is decreased to top   (vertical) or left (horizontal)
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1167
        #maxMin         on press the view is increased or decreased dependent on its current extent
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1168
        #minMax         on press the view is increased or decreased dependent on its current extent
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1169
    "
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1170
    |oldHeight oldMode|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1171
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1172
    aMode notNil ifTrue:[
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1173
        ( #( max min maxMin minMax both) includes:aMode) ifFalse:[
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1174
            ^ self error:('unknown snapMode: ', aMode printString).
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1175
        ]
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1176
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1177
    (oldMode := self snapMode) == aMode ifTrue:[^ self].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1178
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1179
    (snapAdornment notNil and:[aMode notNil]) ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1180
        "must only redraw"
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1181
        snapAdornment mode:aMode
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1182
    ] ifFalse:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1183
        "must recompute barHeight and redraw"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1184
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1185
        aMode isNil ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1186
            snapAdornment := nil
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1187
        ] ifFalse:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1188
            self initSnapAdornment.
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1189
            snapAdornment mode:aMode.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1190
        ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1191
        oldHeight := barHeight.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1192
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1193
        self computeBarHeight.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1194
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1195
        oldHeight ~~ barHeight ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1196
            "must recompute subViews"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1197
            self setupSubviews.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1198
            self resizeSubviews.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1199
        ]
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1200
    ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1201
    self redrawIfShown.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1202
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1203
    "Modified: / 31-10-2010 / 13:00:39 / cg"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1204
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1205
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
style:styleSymbol
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
    "define the style of the handle;
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
     styleSymbol may be #motif to draw a little knob or
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
     anything else to draw scrollBars handleForm.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
     Normally, this is defined via styleSheet files, but this entry allows
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
     individual views to be manipulated."
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1213
    self handleStyle:styleSymbol
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
395
db172e0f3d56 renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  1215
    "Modified: 24.2.1996 / 19:04:19 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1218
!VariablePanel methodsFor:'adding & removing components'!
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1219
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1220
addSubView:aView
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1221
    "a view is added; adjust other subviews sizes"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1222
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1223
    super addSubView:aView.
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1224
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1225
    realized ifTrue:[
2482
b499b4a10907 fixed removeSubView
martin
parents: 2305
diff changeset
  1226
        self setupSubviews.
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1227
        self resizeSubviews.
2483
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1228
        aView beVisible.
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1229
    ]
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1230
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1231
    "Created: 17.1.1996 / 22:41:00 / cg"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1232
    "Modified: 24.2.1996 / 19:05:05 / cg"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1233
!
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1234
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1235
removeSubView:aView
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1236
    "a view is removed; adjust other subviews sizes"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1237
2483
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1238
    aView beInvisible.
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1239
    super removeSubView:aView.
2483
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1240
    shown ifTrue:[             
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1241
        realized 
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1242
        "/ (superView isNil or:[superView shown]) 
94560abb05ce fixed removeSubView
martin
parents: 2482
diff changeset
  1243
        ifTrue:[
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1244
            self setupSubviews.
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1245
            self resizeSubviews.
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1246
        ]
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1247
    ]
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1248
! !
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1249
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
!VariablePanel methodsFor:'drawing'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1251
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1252
drawHandle:hIndex atX:hx y:hy
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1253
    "draw a single handle at hx/hy"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1255
    |h w x y m xm ym lbl maxKnob
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1256
     mar           "{ Class: SmallInteger }"
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1257
     barWidthInt   "{ Class: SmallInteger }"
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1258
     barHeightInt  "{ Class: SmallInteger }" |
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1259
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1260
    ((handleStyle isNil or:[handleStyle == #none])
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1261
    and:[handleLabels isNil]) ifTrue:[^ self].
396
973d4a9fa32c setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents: 395
diff changeset
  1262
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1263
    mar := margin.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1264
    barHeightInt := barHeight.
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1265
    barWidthInt := barWidth.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1266
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1267
    shadowForm notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1268
        h := shadowForm height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1269
        w := shadowForm width .
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1270
        maxKnob := h min:barHeightInt.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1271
    ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1272
        maxKnob := knobHeight min: barHeightInt.
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1273
        maxKnob := maxKnob max:4.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1274
        handleStyle == #full ifTrue:[
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1275
            w := h := maxKnob
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1276
        ] ifFalse:[
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1277
            w := h := maxKnob - 4.
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1278
        ]
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
    self paint:viewBackground.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1282
    self lineStyle:#solid.
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1283
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1284
    orientation == #vertical ifTrue:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1285
        self fillRectangleX:mar y:hy 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1286
                      width:(width - mar - mar) 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1287
                     height:barHeightInt.
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1288
        (handleStyle notNil
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1289
        and:[handleStyle ~~ #none]) ifTrue:[
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1290
            (handleStyle ~~ #normal 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1291
            and:[handleStyle ~~ #mswindows]) ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1292
                m := (maxKnob - h) // 2.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1293
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1294
                shadowForm isNil ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1295
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1296
                    y := hy + (barHeightInt // 2).   "/ center of the bar
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1297
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1298
                    separatingLine ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1299
                        self paint:shadowColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1300
                        self displayLineFromX:mar y:y toX:(width - mar) y:y.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1301
                        y := y + 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1302
                        self paint:lightColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1303
                        self displayLineFromX:mar y:y toX:(width - mar) y:y.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1304
                        self paint:viewBackground.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1305
                    ].
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1306
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1307
                    self fillRectangleX:(hx - barWidthInt) 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1308
                                      y:hy 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1309
                                  width:(barWidthInt + barWidthInt) 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1310
                                 height:h.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1311
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1312
                    handleStyle == #line ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1313
                        self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1314
                        self displayLineFromX:hx - barWidthInt y:y toX:hx + barWidthInt y:y
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1315
                    ] ifFalse:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1316
                        y := hy.   
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1317
                        handleStyle == #st80 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1318
                            y := y - 1
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1319
                        ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1320
                        ym := y + m.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1322
                        handleStyle == #full ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1323
                            handleLevel ~~ 0 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1324
                                self 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1325
                                    drawEdgesForX:0 "/ -(handleLevel abs)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1326
                                    y:ym "/-1
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1327
                                    width:width "/+(handleLevel+handleLevel)abs
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1328
                                    height:h-2 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1329
                                    level:handleLevel
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1330
                                    shadow:shadowColor 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1331
                                    light:lightColor
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1332
                                    halfShadow:nil 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1333
                                    halfLight:nil 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1334
                                    style:nil 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1335
                            ]
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1336
                        ] ifFalse:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1337
                            handleLevel ~~ 0 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1338
                                self drawEdgesForX:(hx - barWidthInt)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1339
                                                 y:ym
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1340
                                             width:(barWidthInt + barWidthInt)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1341
                                            height:h 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1342
                                             level:handleLevel.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1343
                            ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1344
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1345
                            handleStyle == #iris ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1346
                                self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1347
                                self fillDeviceRectangleX:(hx - barWidthInt + 2)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1348
                                                        y:(ym + 2)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1349
                                                    width:(barWidthInt + barWidthInt - 4)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1350
                                                   height:h - 4
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1351
                            ]
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1352
                        ]
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1353
                    ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1354
                ] ifFalse:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1355
                    y := hy.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1356
                    (shadowForm notNil or:[lightForm notNil]) ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1357
                        self drawHandleFormAtX:hx y:(y + m)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1358
                    ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1359
                ].
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1360
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1361
                handleStyle == #st80 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1362
                    y := hy - 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1363
                    self paint:lightColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1364
                    self displayLineFromX:mar y:y toX:(width - mar - mar - 1) y:y.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1365
                    self displayLineFromX:0 y:hy toX:0 y:(hy + knobHeight - 1).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1366
                    y := hy + knobHeight - 2.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1367
                    self paint:shadowColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1368
                    self displayLineFromX:mar y:y toX:(width - mar) y:y.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1369
                        "uncomment the -1 if you dont like the notch at the right end"
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1370
                        "                            VVV"
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1371
                    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
  1372
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1373
            ] ifFalse:[
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1374
                y := hy + barHeightInt - 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1375
                self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1376
                separatingLine ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1377
                    self displayLineFromX:0 y:hy+1 toX:width y:hy+1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1378
                    self displayLineFromX:0 y:y toX:width y:y.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1379
                ].
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1380
                self fillRectangleX:hx y:hy width:barWidthInt height:barHeightInt.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1381
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1382
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1383
        lbl := self handleLabelAt:hIndex.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1384
        lbl notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1385
            hIndex ~~ 1 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1386
                self paint:Color black.
2734
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1387
                lbl displayOn:self x:mar y:hy + (lbl ascentOn:self)
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1388
"/                lbl isImageOrForm ifTrue:[
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1389
"/                    lbl displayOn:self x:mar y:hy
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1390
"/                ] ifFalse:[
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1391
"/                    lbl displayOn:self x:mar y:hy + font ascent + 1
ba7f56186e88 correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents: 2650
diff changeset
  1392
"/                ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1393
            ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1394
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1395
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1396
    ] ifFalse:[
1096
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1397
        self fillRectangleX:hx y:mar 
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1398
                      width:barHeightInt
e17800280f82 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
  1399
                     height:(height - mar - mar).
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1400
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1401
        (handleStyle notNil
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1402
        and:[handleStyle ~~ #none]) ifTrue:[
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1403
            (handleStyle ~~ #normal
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1404
            and:[handleStyle ~~ #mswindows]) ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1405
                 m := (barHeightInt - w) // 2.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1406
                m := (maxKnob - w) // 2.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1407
                 shadowForm isNil ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1408
                    x := hx + (barHeightInt // 2).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1409
                    separatingLine ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1410
                        self paint:shadowColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1411
                        self displayLineFromX:x y:mar toX:x y:(height - mar).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1412
                        x := x + 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1413
                        self paint:lightColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1414
                        self displayLineFromX:x y:mar toX:x y:(height - mar).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1415
                        self paint:viewBackground.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1416
                    ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1417
                    self fillRectangleX:hx y:(hy - barWidthInt) 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1418
                                  width:w 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1419
                                 height:(barWidthInt + barWidthInt).
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1420
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1421
                    handleStyle == #line ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1422
                        self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1423
                        self displayLineFromX:x y:hy - barWidthInt toX:x y:hy + barWidthInt.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1424
                    ] ifFalse:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1425
                        x := hx.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1426
                        handleStyle == #st80 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1427
                            x := x - 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1428
                        ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1429
                        xm := x + m.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1430
                        handleStyle == #full ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1431
                            handleLevel ~~ 0 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1432
                                self 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1433
                                    drawEdgesForX:xm "/-1
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1434
                                    y:0 "/ -handleLevel
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1435
                                    width:w-2
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1436
                                    height:height "/ +handleLevel+handleLevel 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1437
                                    level:handleLevel
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1438
                                    shadow:shadowColor 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1439
                                    light:lightColor
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1440
                                    halfShadow:nil 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1441
                                    halfLight:nil 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1442
                                    style:nil
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1443
                            ]
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1444
                        ] ifFalse:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1445
                            handleLevel ~~ 0 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1446
                                self drawEdgesForX:xm
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1447
                                                 y:(hy - barWidthInt)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1448
                                             width:w 
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1449
                                            height:(barWidthInt + barWidthInt)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1450
                                             level:handleLevel.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1451
                            ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1452
                            handleStyle == #iris ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1453
                                self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1454
                                self fillDeviceRectangleX:(xm + 2)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1455
                                                        y:(hy - barWidthInt + 2)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1456
                                                    width:w - 4
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1457
                                                   height:(barWidthInt + barWidthInt - 4)
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1458
                            ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1459
                        ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1460
                    ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1461
                ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1462
                    x := hx.
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1463
                    (shadowForm notNil or:[lightForm notNil]) ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1464
                        self drawHandleFormAtX:(x + m) y:hy
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1465
                    ]
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1466
                ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1467
                handleStyle == #st80 ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1468
                    x := hx - 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1469
                    self paint:lightColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1470
                    self displayLineFromX:x y:mar toX:x y:(height - mar).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1471
                    self displayLineFromX:hx y:0 toX:(hx + barHeightInt - 1) y:0.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1472
                    x := hx + barHeightInt - 2.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1473
                    self paint:shadowColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1474
                    self displayLineFromX:x y:mar toX:x y:(height - mar).
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1475
                        "uncomment the -1 if you dont like the notch at the bottom end"
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1476
                        "                   VVV"
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1477
                    self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeightInt - 1) y:height-1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1478
                ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1479
            ] ifFalse:[
1981
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1480
                x := hx + barHeightInt - 1.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1481
                self paint:handleColor.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1482
                separatingLine ifTrue:[
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1483
                    self displayLineFromX:hx+1 y:0 toX:hx+1 y:height.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1484
                    self displayLineFromX:x y:0 toX:x y:height.
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1485
                ].
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1486
                self fillRectangleX:hx y:hy width:barHeightInt height:barWidthInt
15a646f9e4fb error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
  1487
            ]
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1488
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1489
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1490
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1491
    "Modified: / 29.7.1998 / 22:48:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1492
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1493
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1494
drawHandleFormAtX:hx y:hy
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
    "draw a handles bitmap at hx/hy"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1496
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1497
    shadowForm notNil ifTrue:[
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1498
        self paint:shadowColor.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1499
        self displayForm:shadowForm x:hx y:hy.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1500
    ].
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1501
    lightForm notNil ifTrue:[
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1502
        self paint:lightColor.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1503
        self displayForm:lightForm x:hx y:hy.
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1504
    ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1505
    self paint:viewBackground
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1506
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1507
    "Modified: 7.11.1996 / 20:25:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1508
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1509
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1510
drawSnapAt:anIndex
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1511
    "draw the snap for a handle at an index"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1512
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1513
    |snapLayout icon level offLevel paint canChangeExtent
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1514
     left   "{ Class:SmallInteger }"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1515
     top    "{ Class:SmallInteger }"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1516
     width  "{ Class:SmallInteger }"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1517
     height "{ Class:SmallInteger }"
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1518
     snapMode leftEdge wEdge topEdge hEdge part wPart hPart|
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1519
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1520
    (snapLayout := self snapLayoutAt:anIndex) isNil ifTrue:[
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1521
        "snap disabled"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1522
        ^ self
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1523
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1524
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1525
    left   := snapLayout left.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1526
    top    := snapLayout top.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1527
    width  := snapLayout width.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1528
    height := snapLayout height.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1529
    snapMode := self snapMode.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1530
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1531
    offLevel := level := (snapAdornment level ? 0).
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1532
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1533
    canChangeExtent := self canChangeExtentOfViewAt:anIndex.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1534
    canChangeExtent ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1535
        (controller isSnapEntered:anIndex) ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1536
            controller isSnapPressed ifTrue:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1537
                level := snapAdornment selectedLevel ? 0.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1538
                paint := snapAdornment selectedBgColor.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1539
            ] ifFalse:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1540
                level := snapAdornment enterLevel ? 0.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1541
                paint := snapAdornment enterBgColor.
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1542
            ].
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1543
        ]
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1544
    ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1545
    paint isNil ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1546
        paint := viewBackground.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1547
    ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1548
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1549
    self paint:paint.
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1550
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1551
"/    level == 0 ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1552
"/    ].
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1553
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1554
    self fillRectangleX:left+1 y:top+1 width:width-2 height:height-2.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1555
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1556
    level ~~ 0 ifTrue:[
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1557
        leftEdge := left + 1.
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1558
        wEdge := wPart := width - 2.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1559
        topEdge := top + 1.
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1560
        hEdge := hPart := height - 2.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1561
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1562
        orientation == #vertical ifTrue:[
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1563
            wPart := width // 3.
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1564
        ] ifFalse:[
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1565
            hPart := height // 3.
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1566
        ].
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1567
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1568
        level < 0 ifTrue:[
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1569
            part := (self subViews at:anIndex) objectAttributeAt:#snapPart.
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1570
            part == #left ifTrue:[
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1571
                self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel.
2243
c2a288b3b73e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  1572
                wPart := wPart + 1.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1573
            ] ifFalse:[
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1574
                part == #middle ifTrue:[
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1575
                    self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel.
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1576
                    orientation == #vertical ifTrue:[
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1577
                        leftEdge := leftEdge + wPart.
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1578
                    ] ifFalse:[
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1579
                        topEdge := topEdge + hPart.
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1580
                    ]
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1581
                ] ifFalse:[
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1582
                    part == #right ifTrue:[
2238
397f5d6d59c5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  1583
                        self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel.
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1584
                        orientation == #vertical ifTrue:[
2243
c2a288b3b73e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  1585
                            leftEdge := leftEdge + (width - wPart - 1).
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1586
                        ] ifFalse:[
2243
c2a288b3b73e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  1587
                            topEdge := topEdge + (height - hPart - 1).
c2a288b3b73e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  1588
                        ].
c2a288b3b73e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  1589
                        wPart := wPart - 1.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1590
                    ]
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1591
                ]
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1592
            ].
2240
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1593
            wEdge := wPart.
c878eeeb676f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1594
            hEdge := hPart.
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1595
        ].
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1596
        self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:level.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1597
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1598
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1599
    canChangeExtent ifFalse:[^ self].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1600
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1601
    snapMode == #both ifTrue:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1602
        icon := (orientation == #vertical) 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1603
                    ifTrue:[snapAdornment iconUpDown] 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1604
                    ifFalse:[snapAdornment iconLeftRight]
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1605
    ] ifFalse:[
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1606
        (self snapAtIndexWillGrow:anIndex) ifTrue:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1607
            icon := (orientation == #vertical) 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1608
                        ifTrue:[snapAdornment iconDown] 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1609
                        ifFalse:[snapAdornment iconRight]
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1610
        ] ifFalse:[
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1611
            icon := (orientation == #vertical) 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1612
                        ifTrue:[snapAdornment iconUp]   
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1613
                        ifFalse:[snapAdornment iconLeft]
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  1614
        ].
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1615
    ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1616
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1617
    icon displayOn:self x:(left + ((width - icon width) // 2))
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1618
                        y:(top  + ((height - icon height) // 2)).
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1619
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1620
    "Modified: / 31-10-2010 / 12:58:27 / cg"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1621
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1622
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
invertHandleBarAtX:hx y:hy
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1624
    |doLine oldStyle|
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1625
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1626
    doLine := (trackLine == #solidLine 
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1627
               or:[trackLine == #dashedLine
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1628
               or:[trackLine == #dottedLine]]).
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1629
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1630
    trackLine == #dashedLine ifTrue:[
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1631
        oldStyle := lineStyle.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1632
        self lineStyle:#dashed.
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1633
    ] ifFalse:[
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1634
        trackLine == #dottedLine ifTrue:[
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1635
            oldStyle := lineStyle.
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1636
            self lineStyle:#dotted.
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1637
        ]
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1638
    ].
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1639
1220
9bc6add9aa54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  1640
    self clippedByChildren:false.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1641
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1642
    self xoring:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1643
        |yL xL halfHeight|
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1644
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1645
        halfHeight := (barHeight // 2) - 1.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1647
        orientation == #vertical ifTrue:[
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1648
            yL := hy + halfHeight.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1649
            doLine ifTrue:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1650
                self displayLineFromX:0 y:yL toX:width y:yL.
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1651
            ] ifFalse:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1652
                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
  1653
            ]
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1654
        ] ifFalse:[
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1655
            xL := hx + halfHeight.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1656
            doLine ifTrue:[
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1657
                self displayLineFromX:xL y:0 toX:xL y:height.
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1658
            ] ifFalse:[
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1659
                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
  1660
            ]
1130
3c9a9961d225 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1661
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1662
    ].
1220
9bc6add9aa54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  1663
    self clippedByChildren:true.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1664
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1665
    oldStyle notNil ifTrue:[
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1666
        self lineStyle:oldStyle.
1131
98922cb07e5b allow handleStyle of #none
Claus Gittinger <cg@exept.de>
parents: 1130
diff changeset
  1667
    ].
1129
17a77892f180 added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
  1668
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1669
    "Modified: / 28.4.1997 / 14:56:26 / dq"
1894
abf63db59265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1670
    "Modified: / 3.5.1999 / 18:49:04 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1671
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1673
lockRedraw
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1674
    redrawLocked := true
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1675
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1676
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1677
redrawHandlesFrom:start to:stop
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1678
    "redraw some handles and snaps"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1679
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1680
    subViews size ~~ 0 ifTrue:[
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1681
        self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex |
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1682
            |hx hy|
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1683
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1684
            hx := hPoint x.
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1685
            hy := hPoint y.
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1686
            barLevel notNil ifTrue:[
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1687
                self drawEdgesForX:0 y:hy width:width height:barHeight level:barLevel.
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1688
            ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1689
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1690
            "/ do not draw handle, if there is a snapper ...
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1691
            self hasSnapHandle ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1692
                self drawSnapAt:hIndex-1
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1693
            ] ifFalse:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1694
                showHandle ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1695
                    self drawHandle:hIndex atX:hx y:hy.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1696
                ].
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  1697
            ].
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1698
        ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  1699
    ].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1700
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  1701
    "Modified: / 31-10-2010 / 12:43:33 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1702
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1703
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1704
unlockRedraw
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
    redrawLocked := false
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1706
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1707
1159
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1708
!VariablePanel methodsFor:'enumerating subviews'!
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1709
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1710
changeSequenceOrderFor:aSubView to:anIndex
3884
15b8ddf523b0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1711
    "change a subview's position in the subviews collection."
15b8ddf523b0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1712
1159
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1713
    |success|
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1714
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1715
    success := super changeSequenceOrderFor:aSubView to:anIndex.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1716
    success ifTrue:[
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1717
        self setupSubviews.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1718
        self resizeSubviews.
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1719
    ].
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1720
    ^ success
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1721
! !
856ac1c6046c changeSequenceOrderFor:to:
ca
parents: 1158
diff changeset
  1722
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1723
!VariablePanel methodsFor:'event handling'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1724
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1725
sizeChanged:how
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1726
    "my size has changed; resize my subviews"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1727
2123
33fda8594eee must resize children if realized;
Claus Gittinger <cg@exept.de>
parents: 2114
diff changeset
  1728
    realized ifTrue:[
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1729
        (how == #smaller) ifTrue:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1730
            self resizeSubviews
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1731
        ] ifFalse:[
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1732
            "/
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1733
            "/ 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
  1734
            "/
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1735
            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
  1736
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1738
    self changed:#sizeOfView with:how.
3670
10c6c46e16c2 dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents: 3463
diff changeset
  1739
    superView notNil ifTrue:[
10c6c46e16c2 dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents: 3463
diff changeset
  1740
        superView subViewChangedSize
10c6c46e16c2 dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents: 3463
diff changeset
  1741
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1742
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1743
    "Modified: 28.1.1997 / 17:56:30 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1744
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1745
1821
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1746
!VariablePanel methodsFor:'focus handling'!
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1747
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1748
wantsFocusWithButtonPress
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1749
    "no, do not catch the keyboard focus on button click"
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1750
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1751
    ^ false
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1752
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1753
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1754
! !
b57cc9dc2c08 changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
  1755
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  1756
!VariablePanel methodsFor:'initialization & release'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1758
computeBarHeight
958
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1759
    "compute the height if the separating bar from either the
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1760
     form or an explicit height given in the styleSheet"
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1761
1550
f0297a144983 clear view when resizing
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  1762
    <resource: #style (#'variablePanel.barHeight'
f0297a144983 clear view when resizing
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  1763
                       #'variablePanel.barHeightMM')>
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1764
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1765
    |bH h lvl|
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1766
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1767
    shadowForm notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1768
        bH := shadowForm height + 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1769
    ] ifFalse:[
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1770
        bH := styleSheet at:#'variablePanel.barHeight'.
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1771
        bH isNil ifTrue:[
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1772
            h := styleSheet at:#'variablePanel.barHeightMM' default:2.
924
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1773
            bH := (h * device verticalPixelPerMillimeter) rounded.
81f3ca4512bd allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1774
        ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1775
    ].
1869
b435e03cf803 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1776
    lvl := styleSheet at:#'variablePanel.barLevel' default:0.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1777
    lvl ~~ 0 ifTrue:[
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1778
        bH := bH + (lvl abs * 2).
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1779
    ].
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1780
876
9766a5eda233 examples
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  1781
    self barHeight:bH.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1782
    knobHeight := bH.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1783
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1784
    handleLabels notNil ifTrue:[
1987
599825bed176 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  1785
        font := font onDevice:device.
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1786
        bH := handleLabels inject:bH into:[:maxSoFar :thisLabel |
874
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1787
                                           thisLabel isNil ifTrue:[
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1788
                                                maxSoFar
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1789
                                           ] ifFalse:[
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1790
                                                maxSoFar max:(thisLabel heightOn:self)
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1791
                                           ]
f79d88b92c1b example & fix for images
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1792
                                          ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1793
        bH := bH + font descent - 1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1794
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1795
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1796
    self barHeight:bH.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1797
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1798
    "Modified: / 29.7.1998 / 14:47:21 / cg"
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1799
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1800
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
defaultControllerClass
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
    ^ VariablePanelController
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1803
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
initCursor
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1806
    "set the cursor - a double arrow"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1807
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
  1808
    cursor := self class 
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
  1809
                cursorForOrientation:orientation
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
  1810
                onDevice:device
900
0541b96dd173 use Image instead of Form
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
  1811
1698
cab69c6081a8 use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
  1812
    "Modified: / 30.9.1998 / 18:20:35 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1814
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
initStyle
966
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1816
    "setup viewStyle specifics"
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1817
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1818
    |mm|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
    super initStyle.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
1987
599825bed176 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  1822
    handleColor := DefaultHandleColor onDevice:device.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
    DefaultHandleStyle isNil ifTrue:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1825
        handleStyle := styleSheet name
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
    ] ifFalse:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1827
        handleStyle := DefaultHandleStyle
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1828
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1830
    handleLevel := DefaultHandleLevel.
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1831
    showHandle := DefaultShowHandle.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
    handlePosition := DefaultHandlePosition.
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1833
    "/ snapHandlePosition := DefaultSnapHandlePosition.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1834
    trackLine := DefaultTrackingLine.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
    separatingLine := DefaultSeparatingLine.
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1837
    DefaultHandleImage notNil ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1838
        shadowForm := DefaultHandleImage onDevice:device.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1839
        barWidth := shadowForm width.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
    ] ifFalse:[
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1841
        handleStyle == #next ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1842
            DefaultHandleImage notNil ifTrue:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1843
                shadowForm := DefaultHandleImage onDevice:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1844
            ] ifFalse:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1845
                shadowForm := self class shadowFormOn:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1846
                lightForm := self class lightFormOn:device.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1847
            ].
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1848
            barWidth := shadowForm width.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1849
        ] ifFalse:[
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1850
            shadowForm := lightForm := nil.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1851
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1852
            mm := device verticalPixelPerMillimeter.
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1853
            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
  1854
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
    ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1856
    self computeBarHeight.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1857
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1858
    handleStyle == #mswindows ifTrue:[
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1859
        barWidth := (ArrowButton new direction:#up) width + 1 
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1860
    ].
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1861
1529
509edab0a08b allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1862
    "Modified: / 19.5.1998 / 16:21:02 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1863
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1864
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
initialize
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1866
    orientation isNil ifTrue:[orientation := #vertical].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1867
    super initialize.
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1868
    self bitGravity:nil.
496
f22ac16a5093 commentary & code cleanup
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1869
1628
d5065006e796 fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
  1870
    "Modified: / 29.7.1998 / 16:07:23 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1871
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
!VariablePanel methodsFor:'private'!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1874
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1875
anyNonRelativeSubviews
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1876
    "return true, if any of my subviews has no relative origin/extent"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1878
    self subViews do:[:aComponent |
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1879
        aComponent relativeCorner isNil ifTrue:[^ true].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1880
        aComponent relativeOrigin isNil ifTrue:[^ true]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1881
    ].
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
    ^ false
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1883
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1884
    "Modified: 28.1.1997 / 17:57:26 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1886
1655
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1887
expandSubView:expandedView
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1888
    "expand one of my subviews to full size"
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1889
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1890
    |pos subViews|
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1891
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1892
    realRelativeSizes notNil ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1893
        "/ already expanded ..
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1894
        ^ self
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1895
    ].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1896
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1897
    pos := 0.0. 
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1898
    subViews := self subViews.
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1899
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1900
    orientation == #vertical ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1901
        realRelativeSizes := subViews collect:[:v | v relativeCorner y - v relativeOrigin y].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1902
    ] ifFalse:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1903
        realRelativeSizes := subViews collect:[:v | v relativeCorner x - v relativeOrigin x].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1904
    ].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1905
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1906
    subViews do:[:aSubView |
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1907
        aSubView == expandedView ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1908
            aSubView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1909
            pos := 1.0
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1910
        ] ifFalse:[
3463
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  1911
            aSubView beInvisible.
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  1912
1655
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1913
            orientation == #vertical ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1914
                aSubView origin:(0.0 @ pos) corner:(1.0 @ pos)
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1915
            ] ifFalse:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1916
                aSubView origin:(pos @ 0.0) corner:(pos @ 1.0)
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1917
            ]
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1918
        ]
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1919
    ].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1920
    self resizeSubviews.
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1921
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1922
    "Modified: 28.1.1997 / 17:56:20 / cg"
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1923
!
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1924
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1925
handleLabelAt:hIndex
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1926
    handleLabels notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1927
        ^ handleLabels at:hIndex ifAbsent:nil
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1928
    ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1929
    ^ nil
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1930
!
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1931
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1932
handleOriginsWithIndexDo:aBlock
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
    "evaluate the argument block for every handle-origin"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1934
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1935
    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
  1936
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1937
    "Modified: 28.1.1997 / 17:53:44 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1938
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1939
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1940
handleOriginsWithIndexFrom:start to:stop do:aBlock
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1941
    "evaluate the argument block for some handle-origins"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1943
    |x y hw hh hDelta vDelta subViews
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
     first "{ Class: SmallInteger }"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1945
     last  "{ Class: SmallInteger }"|
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1946
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1947
    (subViews := self subViews) notNil ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1948
        shadowForm notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1949
            hw := shadowForm width.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1950
            hh := shadowForm height.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1951
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1952
            hw := hh := barWidth
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1953
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1955
        (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1956
            hDelta := barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1957
            vDelta := barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1958
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1959
            hDelta := vDelta := 0
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1960
        ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1962
        (handlePosition == #left) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1963
            x := hDelta. 
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1964
            y := vDelta.
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1965
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1966
            orientation == #vertical ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1967
                x := x + barWidth
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1968
            ] ifFalse:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1969
                y := y + barWidth
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1970
            ].
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1971
            margin ~~ 0 ifTrue:[
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1972
                x := x + 2
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1973
            ].
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1974
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1975
            (handlePosition == #right) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1976
                x := width - hw - margin - hDelta.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1977
                y := height - hh - margin - vDelta.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1978
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1979
                x := width - barWidth // 2.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1980
                y := height - barWidth // 2
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1981
            ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1982
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1983
        first := start + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1984
        last := stop.
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1985
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1986
        first to:last do:[:index |
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1987
            |view|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1988
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1989
            view := subViews at:index.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1990
            orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1991
                y := view top "origin y" - barHeight + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1992
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1993
                x := view left "origin x" - barHeight + 1.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1994
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1995
            aBlock value:(x @ y) value:index
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  1996
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1997
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1998
1381
d69604d4bbb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  1999
    "Modified: / 1.11.1997 / 11:53:40 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2000
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2001
2623
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2002
redrawIfShown
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2003
    shown ifTrue:[
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2004
        self clear.
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2005
    ].
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2006
    self invalidate
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2007
!
fdc67970afc9 barLevel added
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
  2008
2026
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2009
resizeSubViewsTo:relativeSizeList
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2010
    "change subviews sizes as defined in the argument list
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2011
     (a collection of relative sizes)"
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2012
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2013
    |pos subViews|
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2014
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2015
    subViews := self subViews.
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2016
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2017
    pos := 0.0.
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2018
    subViews with:relativeSizeList do:[:aSubView :relSize |
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2019
        orientation == #vertical ifTrue:[
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2020
            aSubView origin:(0.0 @ pos) corner:(1.0 @ (pos + relSize))
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2021
        ] ifFalse:[
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2022
            aSubView origin:(pos @ 0.0) corner:((pos + relSize) @ 1.0)
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2023
        ].
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2024
        pos := pos + relSize.
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2025
    ].
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2026
    self resizeSubviews.
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2027
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2028
!
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2029
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2030
resizeSubviews
1151
94aff1c7b0aa Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents: 1131
diff changeset
  2031
    "readjust size of all subviews"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2032
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2033
    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
  2034
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2035
    "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
  2036
    "Modified: 22.3.1997 / 01:01:31 / stefan"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2037
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2038
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2039
resizeSubviewsFrom:start to:stop
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2040
    "readjust size of some subviews"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2041
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2042
    |step nSubviews subViews|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2043
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2044
    (subViews := self subViews) size > 0 ifTrue:[
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2045
        (start <= stop) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2046
            step := 1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2047
        ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2048
            step := -1
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2049
        ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2050
        nSubviews := subViews size.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2051
        start to:stop by:step do:[:index |
2026
9876789dfba7 added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents: 1987
diff changeset
  2052
            |bw view o1 o2 newOrg newCorner newExt|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2053
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2054
            view := subViews at:index.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2055
            bw := view borderWidth.
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2056
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2057
            index == 1 ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2058
                o1 := 0.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2059
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2060
                o1 := barHeight // 2 - bw
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2061
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2062
            index ==  nSubviews ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2063
                o2 := 0.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2064
            ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2065
                o2 := barHeight // 2 - bw
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2066
            ].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2067
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2068
            newOrg := view computeOrigin.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2069
            newOrg notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2070
                (index ~~ 1) ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2071
                    orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2072
                        newOrg y:(newOrg y + o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2073
                    ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2074
                        newOrg x:(newOrg x + o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2075
                    ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2076
                ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2077
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2078
            newExt := view computeExtent.
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2079
            newExt notNil ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2080
                orientation == #vertical ifTrue:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2081
                    newExt y:(newExt y - o2 - o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2082
                ] ifFalse:[
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2083
                    newExt x:(newExt x - o2 - o1)
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2084
                ]
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2085
            ].
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2086
            view pixelOrigin:newOrg extent:newExt.
1550
f0297a144983 clear view when resizing
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  2087
        ].
1551
1b9a8a925fe7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2088
        shown ifTrue:[
1b9a8a925fe7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2089
            "/ must clear, since handles are copied automatically (by bitGravity)
1b9a8a925fe7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2090
            self clear.
1b9a8a925fe7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2091
            self invalidate.
1b9a8a925fe7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2092
        ]
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2093
    ]
873
d1274f0256a6 removed transcript message
Claus Gittinger <cg@exept.de>
parents: 871
diff changeset
  2094
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2095
    "Modified: / 22.3.1997 / 01:02:21 / stefan"
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2096
    "Modified: / 23.2.2000 / 18:32:37 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2097
!
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2098
1655
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2099
restoreSubViewRatios
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2100
    "restore my subviews sizes to the state before the full-expand"
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2101
3463
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2102
    |pos|
1655
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2103
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2104
    realRelativeSizes == nil ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2105
        "/ not expanded - ignore
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2106
        ^ self
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2107
    ].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2108
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2109
    pos := 0.0.
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2110
    self subViews with:realRelativeSizes do:[:aSubView :aRelativeSize |
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2111
        orientation == #vertical ifTrue:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2112
            aSubView origin:(0.0 @ pos) corner:(1.0 @ (pos+aRelativeSize))
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2113
        ] ifFalse:[
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2114
            aSubView origin:(pos @ 0.0) corner:((pos+aRelativeSize) @ 1.0)
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2115
        ].
3463
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2116
        pos := pos + aRelativeSize.
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2117
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2118
        aSubView shown ifFalse:[
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2119
            aSubView hiddenOnRealize:false.
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2120
            shown ifTrue:[aSubView beVisible].
8408a4c800db focus handling
ca
parents: 3278
diff changeset
  2121
        ].
1655
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2122
    ].
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2123
    realRelativeSizes := nil.
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2124
    self resizeSubviews.
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2125
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2126
    "Modified: 28.1.1997 / 17:56:20 / cg"
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2127
!
2928bb99f774 added #expand & #restore
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2128
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2129
setupSubviews
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2130
    "setup subviews sizes (in case of non-relative sizes)"
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2131
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2132
    |pos delta subViews nSubViews "{ Class: SmallInteger }"|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2133
300
0823ef38e629 adding/removing views to Panels
ah
parents: 299
diff changeset
  2134
    "/ setup all subviews to spread evenly ...
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2135
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2136
    subViews := self subViews.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2137
    nSubViews := subViews size.
1043
f0eeb4035bb8 re-setup subViews when removing a subview;
ca
parents: 980
diff changeset
  2138
    nSubViews == 0 ifTrue:[^ self].
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2139
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2140
    pos := 0.0. 
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2141
    delta := 1.0 / nSubViews.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2142
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2143
    1 to:nSubViews do:[:index |
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2144
        |view org corn|
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2145
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2146
        view := subViews at:index.
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2147
        orientation == #vertical ifTrue:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2148
            org := (0.0 @ pos). 
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2149
            index == subViews size ifTrue:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2150
                corn := (1.0 @ 1.0)
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2151
            ] ifFalse:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2152
                corn := (1.0 @ (pos + delta))
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2153
            ].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2154
        ] ifFalse:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2155
            org := (pos @ 0.0).
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2156
            index == subViews size ifTrue:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2157
                corn := (1.0 @ 1.0)
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2158
            ] ifFalse:[
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2159
                corn := ((pos + delta) @ 1.0)
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2160
            ].
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2161
        ].
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2162
        view origin:org corner:corn.
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2163
        pos := pos + delta
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2164
    ]
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2165
2160
a750dda8205b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2123
diff changeset
  2166
    "Modified: / 23.2.2000 / 18:14:01 / cg"
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2167
! !
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
2743
65b5445cb984 method category rename
Claus Gittinger <cg@exept.de>
parents: 2734
diff changeset
  2169
!VariablePanel methodsFor:'private-snap queries'!
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2170
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2171
canChangeExtentOfViewAt:anIndex
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2172
    "returns true if extent at an index is changable
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2173
    "
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2174
    |view|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2175
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2176
    view := subViews at:anIndex ifAbsent:[^ false].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2177
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2178
    orientation == #vertical ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2179
        view height > 2 ifFalse:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2180
            view := subViews at:(anIndex + 1) ifAbsent:[^ false].
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2181
            ^ view height > 2
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2182
        ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2183
        ^ true
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2184
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2185
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2186
    view width > 2 ifFalse:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2187
        view := subViews at:(anIndex + 1) ifAbsent:[^ false].
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2188
        ^ view width > 2
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2189
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2190
    ^ true
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2191
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2192
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2193
initSnapAdornment
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2194
    |num icon level enterLevel selectedLevel color|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2195
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2196
    snapAdornment isNil ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2197
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2198
        snapAdornment := SnapAdornment "IdentityDictionary" new.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2199
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2200
        level         := styleSheet at:#'variablePanel.snapLevel'      default:1.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2201
        enterLevel    := styleSheet at:#'variablePanel.snapEnterLevel' default:level.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2202
        selectedLevel := styleSheet at:#'variablePanel.selectedLevel'  default:(level negated).
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2203
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2204
        snapAdornment level:level.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2205
        snapAdornment enterLevel:enterLevel.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2206
        snapAdornment selectedLevel:selectedLevel.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2207
        snapAdornment mode:#min.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2208
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2209
        color := styleSheet 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2210
                    colorAt:#'variablePanel.snapSelectedBgColor'
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2211
                    default:(StyleSheet colorAt:#'button.activeBackgroundColor').
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2212
        color notNil ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2213
            snapAdornment selectedBgColor:(color onDevice:device)
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2214
        ].
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2215
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2216
        color := StyleSheet 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2217
                    colorAt:#'variablePanel.snapEnterBgColor'
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2218
                    default:(StyleSheet colorAt:#'button.enteredBackgroundColor').
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2219
        color notNil ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2220
            snapAdornment enterBgColor:(color onDevice:device)
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2221
        ].
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2222
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2223
        self class snapIcons keysAndValuesDo:[:aKey :anIcon|
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2224
            anIcon device == device ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2225
                icon := anIcon
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2226
            ] ifFalse:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2227
                icon := anIcon copy onDevice:device.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2228
                icon clearMaskedPixels.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2229
                device == Display ifTrue:[
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2230
                    self class snapIcons at:aKey put:icon.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2231
                ]
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2232
            ].
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2233
            snapAdornment at:aKey put:icon
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2234
        ].
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2235
        "compute required snap extent including level and margins ..."
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2236
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2237
        num  := level abs max:(enterLevel abs).
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2238
        num  := num max:(selectedLevel abs).
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2239
        num  := (num + 2) "margin into handle := 1" * 2.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2240
        icon := snapAdornment iconUp.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2241
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2242
        snapAdornment height:(icon height + num).
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2243
        snapAdornment width:(icon width  + num).
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2244
    ].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2245
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2246
    ^ snapAdornment
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2247
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2248
    "Modified: / 31-10-2010 / 12:59:39 / cg"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2249
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2250
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2251
snapAtIndexWillGrow:anIndex
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2252
    "returns true if the view assigned to the snap at an index will grow
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2253
     if pressing the snap
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2254
    "
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2255
    |view mode|
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2256
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2257
    (mode := self snapMode) notNil ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2258
        (mode == #max or:[mode == #maxMin]) ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2259
            "on press the view is increased to bottom(vertical) or right(horizontal)"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2260
            view := subViews at:(anIndex + 1) ifAbsent:[^ false].
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2261
            ^ orientation == #vertical ifTrue:[view height > 2] ifFalse:[view width  > 2]
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2262
        ].    
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2263
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2264
        (mode == #min or:[mode == #minMax]) ifTrue:[
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2265
            "on press the view is decreased to top(vertical) or left (horizontal)"
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2266
            view := subViews at:anIndex ifAbsent:[^ false].
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2267
            ^ orientation == #vertical ifTrue:[view height <= 2] ifFalse:[view width  <= 2]
2236
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  2268
        ].
cd77d04c9a0a snapMode: #both
Claus Gittinger <cg@exept.de>
parents: 2228
diff changeset
  2269
2269
4f1c764f1e53 icons beautified
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2270
        self error:'unexepected snapMode state'.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2271
    ].    
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2272
    ^ false     "snap is disabled"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2273
!
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2274
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2275
snapLayoutAt:anIndex
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2276
    "returns the layout of the snap at an index
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2277
     or nil if snaps are disabled
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2278
    "
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2279
    |v1 v2 left top right bot w snapX snapY|
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2280
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2281
    self hasSnapHandle ifFalse:[^ nil].         "snap disabled"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2282
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2283
    v1 := subViews at:anIndex     ifAbsent:[^ nil].
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2284
    v2 := subViews at:anIndex + 1 ifAbsent:[^ nil].
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2285
    w  := snapAdornment width ? 0.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2286
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  2287
    handlePosition "snapHandlePosition" == #left ifTrue:[
2241
d9c7f1486b7a draw snap at very left of panel
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2288
        snapX := snapY := margin. "/ ViewSpacing.
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2289
    ] ifFalse:[
2242
1aea02d32c96 snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  2290
        handlePosition "snapHandlePosition" == #right ifTrue:[
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2291
            snapX := width - w.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2292
            snapY := height - w.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2293
        ] ifFalse:[
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2294
            snapX := (width - w) // 2.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2295
            snapY := (height - w) // 2.
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2296
        ].
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2297
    ].
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2298
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2299
    orientation == #vertical ifTrue:[
2228
d74b093fe48d snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents: 2179
diff changeset
  2300
        left := snapX. "/ v1 width - w // 2.
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2301
        top := v1 bottom + 1.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2302
        right := left + w.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2303
        bot := v2 top.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2304
    ] ifFalse:[
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2305
        top := snapY. "/ v1 height - w // 2.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2306
        left := v1 right + 1.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2307
        right := v2 left.
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2308
        bot := top + w.
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2309
    ].
2598
6817bf076dc9 beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2310
    ^ Rectangle left:left top:top right:right bottom:bot
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2311
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2312
    "Modified: / 31-10-2010 / 12:47:16 / cg"
2179
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2313
! !
ae22ac1e068e support snap
ca
parents: 2160
diff changeset
  2314
2743
65b5445cb984 method category rename
Claus Gittinger <cg@exept.de>
parents: 2734
diff changeset
  2315
!VariablePanel methodsFor:'private-tableView protocol'!
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2316
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2317
setupSubviewOrigins
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2318
    "setup subviews origins 
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2319
     if we only have relative extents 
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2320
     (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
  2321
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2322
    |x y e eX eY subViews n "{ Class: SmallInteger }"|
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2323
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2324
    x := y := 0.0.
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2325
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  2326
    subViews := self subViews.
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2327
    n := subViews size.
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2328
    1 to:n do:[:index |
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2329
        |view|
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2330
826
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2331
        view := subViews at:index.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2332
        e := view relativeExtent.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2333
        e notNil ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2334
            view relativeExtent:nil.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2335
            eX := e x.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2336
            eY := e y.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2337
            index == n ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2338
                view origin:(x @ y) corner:(1.0 @ 1.0)
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2339
            ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2340
                orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2341
                    view origin:(x @ y) corner:(1.0 @ (y+eY))
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2342
                ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2343
                    view origin:(x @ y) corner:((x+eX) @ 1.0)
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2344
                ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2345
            ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2346
            orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2347
                y := y + eY.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2348
            ] ifFalse:[    
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2349
                x := x + eX.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2350
            ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2351
        ] ifFalse: [
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2352
            view origin:(x @ y).
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2353
            orientation == #vertical ifTrue:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2354
                y := view relativeCorner y.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2355
            ] ifFalse:[
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2356
                x := view relativeCorner x.
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2357
            ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2358
        ].
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2359
    ]
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2360
138bc07c873b Add comment.
Stefan Vogel <sv@exept.de>
parents: 722
diff changeset
  2361
    "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
  2362
    "Modified: 28.1.1997 / 17:55:21 / cg"
299
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2363
! !
d2f955840ad5 oops - tableViews private interface was lost - reintroduced
ah
parents: 295
diff changeset
  2364
3864
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2365
!VariablePanel methodsFor:'queries'!
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2366
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2367
hasSnapHandle
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2368
    ^ snapAdornment notNil
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2369
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2370
    "Created: / 31-10-2010 / 12:43:21 / cg"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2371
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2372
3864
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2373
isLayoutWrapper
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2374
    "answer true, if this view defines the layout of it's subviews"
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2375
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2376
    ^ true
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2377
! !
3b8f1fe89d48 UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents: 3670
diff changeset
  2378
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2379
!VariablePanel methodsFor:'realization'!
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2380
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2381
fixSize 
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2382
    super fixSize.
2305
f2850e54b0ab only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents: 2288
diff changeset
  2383
    self extentChangedFlag ifTrue:[
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2384
        self resizeSubviews
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2385
    ].
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2386
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2387
    "Modified: 22.3.1997 / 01:19:55 / stefan"
2531
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2388
!
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2389
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2390
realize
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2391
    super realize.
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2392
    self anyNonRelativeSubviews ifTrue:[
2533
0da5e1d49faa size computation fixed
Claus Gittinger <cg@exept.de>
parents: 2531
diff changeset
  2393
        self setupSubviews.
0da5e1d49faa size computation fixed
Claus Gittinger <cg@exept.de>
parents: 2531
diff changeset
  2394
        self sizeChanged:nil.   "/ force recomputation of subviews
2531
6fc09f6a83dd fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents: 2483
diff changeset
  2395
    ].
2288
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2396
! !
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2397
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2398
!VariablePanel methodsFor:'redrawing'!
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2399
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2400
redraw
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2401
    "redraw all of the handles"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2402
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2403
    redrawLocked ~~ true ifTrue:[
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2404
        "/ self clear.
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2405
        self redrawHandlesFrom:1 to:(self subViews size)
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2406
    ]
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2407
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2408
    "Modified: 28.1.1997 / 17:54:15 / cg"
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2409
! !
93f27fcd6dc2 category change
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2410
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2411
!VariablePanel::SnapAdornment methodsFor:'accessing'!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2412
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2413
enterBgColor
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2414
    ^ enterBgColor
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2415
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2416
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2417
enterBgColor:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2418
    enterBgColor := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2419
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2420
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2421
enterLevel
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2422
    ^ enterLevel
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2423
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2424
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2425
enterLevel:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2426
    enterLevel := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2427
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2428
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2429
height
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2430
    ^ height
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2431
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2432
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2433
height:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2434
    height := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2435
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2436
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2437
iconDown
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2438
    ^ iconDown
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2439
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2440
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2441
iconDown:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2442
    iconDown := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2443
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2444
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2445
iconLeft
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2446
    ^ iconLeft
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2447
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2448
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2449
iconLeft:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2450
    iconLeft := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2451
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2452
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2453
iconLeftRight
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2454
    ^ iconLeftRight
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2455
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2456
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2457
iconLeftRight:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2458
    iconLeftRight := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2459
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2460
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2461
iconRight
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2462
    ^ iconRight
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2463
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2464
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2465
iconRight:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2466
    iconRight := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2467
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2468
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2469
iconUp
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2470
    ^ iconUp
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2471
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2472
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2473
iconUp:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2474
    iconUp := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2475
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2476
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2477
iconUpDown
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2478
    ^ iconUpDown
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2479
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2480
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2481
iconUpDown:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2482
    iconUpDown := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2483
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2484
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2485
level
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2486
    ^ level
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2487
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2488
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2489
level:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2490
    level := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2491
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2492
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2493
mode
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2494
    ^ mode
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2495
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2496
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2497
mode:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2498
    mode := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2499
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2500
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2501
selectedBgColor
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2502
    ^ selectedBgColor
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2503
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2504
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2505
selectedBgColor:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2506
    selectedBgColor := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2507
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2508
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2509
selectedLevel
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2510
    ^ selectedLevel
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2511
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2512
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2513
selectedLevel:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2514
    selectedLevel := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2515
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2516
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2517
width
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2518
    ^ width
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2519
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2520
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2521
width:something
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2522
    width := something.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2523
! !
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2524
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2525
!VariablePanel::SnapAdornment methodsFor:'backward compatibility'!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2526
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2527
at:key 
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2528
    ^ self perform:key
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2529
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2530
    "Created: / 31-10-2010 / 12:38:58 / cg"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2531
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2532
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2533
at:key ifAbsent:default
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2534
    |value|
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2535
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2536
    value := self perform:key.
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2537
    ^ value ? default
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2538
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2539
    "Created: / 31-10-2010 / 12:41:10 / cg"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2540
!
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2541
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2542
at:key put:aValue
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2543
    self perform:(key,':') asSymbol with:aValue
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2544
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2545
    "Created: / 31-10-2010 / 12:38:48 / cg"
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2546
! !
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2547
871
541b8f9e8237 add label to vertical panel
ca
parents: 826
diff changeset
  2548
!VariablePanel class methodsFor:'documentation'!
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2549
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2550
version
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2551
    ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.91 2010-10-31 12:01:12 cg Exp $'
4043
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  2552
!
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  2553
9e0d97fd4b21 changed: #examples
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  2554
version_CVS
4187
16652b9859a7 snapAdornment stuff cleanup
Claus Gittinger <cg@exept.de>
parents: 4043
diff changeset
  2555
    ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.91 2010-10-31 12:01:12 cg Exp $'
295
aa5887bff1b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2556
! !