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