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