TabView.st
author Claus Gittinger <cg@exept.de>
Tue, 01 Jul 2003 10:51:51 +0200
changeset 2531 2f38bbea4b36
parent 1401 e92d55efca08
child 3902 ff89bd4a8992
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     1
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
1118
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
     3
	      All Rights Reserved
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     4
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
dd49faa984ce intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    11
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    12
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    13
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    15
1401
e92d55efca08 total redeisign
Claus Gittinger <cg@exept.de>
parents: 1385
diff changeset
    16
NoteBookView subclass:#TabView
e92d55efca08 total redeisign
Claus Gittinger <cg@exept.de>
parents: 1385
diff changeset
    17
	instanceVariableNames:''
550
f4c65aff6387 remove:
ca
parents: 548
diff changeset
    18
	classVariableNames:''
f4c65aff6387 remove:
ca
parents: 548
diff changeset
    19
	poolDictionaries:''
f4c65aff6387 remove:
ca
parents: 548
diff changeset
    20
	category:'Views-Interactors'
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    21
!
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    22
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    23
!TabView class methodsFor:'documentation'!
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    24
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    25
copyright
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    26
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    27
 COPYRIGHT (c) 1997 by eXept Software AG
1118
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
    28
	      All Rights Reserved
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    29
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    30
 This software is furnished under a license and may be used
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    35
 hereby transferred.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    36
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    37
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    38
!
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    39
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    40
documentation
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    41
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    42
    implements the tabs-view component of a noteBook.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    43
    May also be used on its own (without a surrounding noteBook).
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    44
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    45
    The functionality is basically the same as provided by a
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    46
    PopUpList or SelectionInListView, in that a valueHolder
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    47
    gets a value assigned corresponding to the selected tab
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    48
    from a list of possible tabs.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    49
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    50
    [author:]
1118
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
    51
	Claus Atzkern
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    52
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    53
    [see also:]
1118
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
    54
	NoteBookView
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
    55
	SelectionInListView PopUpList ValueHolder TabWidget
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    56
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    57
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    58
!
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    59
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    60
examples
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    61
"
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    62
    tabs at top of a view
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    63
                                                                                [exBegin]                                      
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    64
    |top tab view inset|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    65
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    66
    top := StandardSystemView new label:'tabs at top'; extent:250@100.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    67
    tab  := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    68
    ' view := View    origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.                     '. 
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    69
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    70
    tab direction:#top.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    71
    tab list:#( 'Foo' 'Bar' 'Baz' ).
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    72
    ' inset := tab preferredSizeXorY .  '.
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    73
    ' tab  bottomInset:(inset negated). '.
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    74
    ' view topInset:inset.              '.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    75
    tab action:[:aName|Transcript showCR:aName].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    76
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    77
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    78
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    79
    tabs at bottom of a view; changing widget to MAC style
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    80
                                                                                [exBegin]                                      
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    81
    |top tab view inset|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    82
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    83
    top := StandardSystemView new label:'tabs at bottom'; extent:250@100.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
    84
    view := View    origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
    85
    tab  := TabView origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:top.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    86
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    87
    view viewBackground:(tab styleAt:#selectedColor).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    88
    tab direction:#bottom.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    89
    tab tabWidget:#Mac.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    90
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    91
    tab list:#( 'Foo' 'Bar' 'Baz' ).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    92
    inset := tab preferredSizeXorY.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    93
    tab  topInset:(inset negated).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    94
    view bottomInset:inset.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    95
    tab action:[:aName|Transcript showCR:aName].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    96
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    97
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
    98
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
    99
    tabs at right of a view
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   100
                                                                                [exBegin]                                      
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   101
    |top tab view inset|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   102
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   103
    top := StandardSystemView new label:'tabs at right'; extent:100@250.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   104
    view := View    origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   105
    tab  := TabView origin:1.0 @ 0.0 corner:1.0 @ 1.0 in:top.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   106
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   107
    view viewBackground:(tab styleAt:#selectedColor).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   108
    tab direction:#right.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   109
    tab list:#( 'Foo' 'Bar' 'Baz' ).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   110
    inset := tab preferredSizeXorY.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   111
    tab leftInset:(inset negated).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   112
    view rightInset:inset.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   113
    tab action:[:aName|Transcript showCR:aName].
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   114
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   115
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   116
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   117
    tabs at left of a view
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   118
                                                                                [exBegin]                                      
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   119
    |top tab view inset|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   120
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   121
    top := StandardSystemView new label:'tabs at left'; extent:100@250.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   122
    tab  := TabView origin:0.0 @ 0.0 corner:0.0 @ 1.0 in:top.
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   123
    view := View    origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   124
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   125
    view viewBackground:(tab styleAt:#selectedColor).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   126
    tab direction:#left.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   127
    tab list:#( 'Foo' 'Bar' 'Baz' ).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   128
    inset := tab preferredSizeXorY.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   129
    tab rightInset:(inset negated).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   130
    view leftInset:inset.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   131
    tab action:[:aName|Transcript showCR:aName].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   132
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   133
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   134
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   135
    changing default style( see TabWidget class ); useing index
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   136
                                                                                [exBegin]                                      
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   137
    |top tab view|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   138
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   139
    top := StandardSystemView new label:'example'; extent:450@300.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   140
    tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 40 in:top.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   141
    tab horizontalInset:10.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   142
    view := NoteBookFrameView origin:0.0 @ 40  corner:1.0 @ 1.0 in:top.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   143
    view horizontalInset:10.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   144
    view bottomInset:10.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   145
    view level:2.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   146
    view viewBackground:(Image fromFile:'bitmaps/gifImages/garfield.gif').
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   147
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   148
    tab styleAt:#selectedColor    put:(view viewBackground).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   149
    tab styleAt:#unselectedColor  put:(Color grey:60).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   150
    tab styleAt:#expandSelection  put:9@7.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   151
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   152
    tab list:#( 'Foo' 'Bar' 'Baz').
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   153
    tab useIndex:true.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   154
    tab action:[:aName| Transcript showCR:aName ].
352
fbc4de042995 1. support of usedIndex
ca
parents: 349
diff changeset
   155
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   156
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   157
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   158
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   159
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   160
    using images and text
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   161
                                                                                [exBegin]
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   162
    |top tab view list|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   163
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   164
    top := StandardSystemView new label:'example'.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   165
    tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   166
    list := #( 'SBrowser' 'FBrowser' 'Debugger' ).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   167
    list := list collect:[:n | Image fromFile:'bitmaps/' , n , '.xbm'].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   168
    list add:'A Text'.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   169
    tab list:list.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   170
    tab action:[:indexOrNil| Transcript showCR:indexOrNil ].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   171
    top extent:(tab preferredExtent).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   172
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   173
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   174
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   175
    using images and text; MAC style
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   176
                                                                                [exBegin]
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   177
    |top tab view list|
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   178
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   179
    top := StandardSystemView new label:'example'.
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   180
    tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   181
    tab tabWidget:#Mac.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   182
    list := #( 'SBrowser' 'FBrowser' 'Debugger' ).
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   183
    list := list collect:[:n | Image fromFile:'bitmaps/' , n , '.xbm'].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   184
    list add:'A Text'.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   185
    tab list:list.
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   186
    tab action:[:indexOrNil| Transcript showCR:indexOrNil ].
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   187
    top extent:(tab preferredExtent).
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   188
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   189
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   190
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   191
    tabs at top of view dealing with other models
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   192
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   193
                                                                                [exBegin]
352
fbc4de042995 1. support of usedIndex
ca
parents: 349
diff changeset
   194
    |top sel view l top2 s top3 p|
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   195
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   196
    l := SelectionInList new.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   197
    l list:#('foo' 'bar' 'baz').
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   198
    l selectionIndex:1.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   199
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   200
    top2 := StandardSystemView new.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   201
    top2 extent:100@100.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   202
    s := SelectionInListView origin:0.0@0.0 corner:1.0@1.0 in:top2.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   203
    s model:l.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   204
    top2 open.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   205
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   206
    top3 := StandardSystemView new.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   207
    top3 extent:100@100.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   208
    s := PopUpList in:top3.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   209
    s model:l.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   210
    top3 open.
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   211
499
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   212
    top := StandardSystemView new label:'example'; extent:200@50.
fbf62bb89ca4 redraw only label in case of enabled state changed
ca
parents: 445
diff changeset
   213
    sel := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   214
    sel useIndex:true.
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   215
    sel model:(l selectionIndexHolder).
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   216
    sel listHolder:(l listHolder).
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   217
    sel action:[:indexOrNil|Transcript showCR:indexOrNil].
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   218
    top open.
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   219
                                                                                [exEnd]
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   220
"
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   221
! !
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   222
1401
e92d55efca08 total redeisign
Claus Gittinger <cg@exept.de>
parents: 1385
diff changeset
   223
!TabView methodsFor:'initialization'!
387
5b7a8d0fe86e use index or label
ca
parents: 376
diff changeset
   224
1118
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   225
initStyle
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   226
    "setup style attributes
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   227
    "
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   228
a49afa5a9f10 fixed font setup in initStyle.
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   229
    super initStyle.
1401
e92d55efca08 total redeisign
Claus Gittinger <cg@exept.de>
parents: 1385
diff changeset
   230
    tabModus := true.
367
cff1a140978f tabs at top, bottom, left and right
ca
parents: 352
diff changeset
   231
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   232
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   233
! !
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   234
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   235
!TabView class methodsFor:'documentation'!
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   236
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   237
version
2531
2f38bbea4b36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   238
    ^ '$Header: /cvs/stx/stx/libwidg2/TabView.st,v 1.47 2003-07-01 08:51:51 cg Exp $'
343
dd49faa984ce intitial checkin
ca
parents:
diff changeset
   239
! !