TabItem.st
author Claus Gittinger <cg@exept.de>
Sat, 08 Mar 2008 11:59:40 +0100
changeset 3358 54f70d1e57b7
parent 3347 b3cccb8303ae
child 3393 8b665bfc7be0
permissions -rw-r--r--
comment
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     1
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     4
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e065c08b2a69 initial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    11
"
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
    13
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    14
Model subclass:#TabItem
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
    15
	instanceVariableNames:'view rawLabel label enabled argument canvas activeHelpText
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
    16
		translateLabel shortcutKey majorKey minorKey miniScrollerVertical
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
    17
		miniScrollerHorizontal hasVerticalScrollBar
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
    18
		hasHorizontalScrollBar foregroundColor createNewBuilder
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
    19
		autoHideScrollBars accessCharacterPosition activeHelpKey builder'
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    20
	classVariableNames:''
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    21
	poolDictionaries:''
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    22
	category:'Views-Support'
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    23
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    24
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    25
!TabItem class methodsFor:'documentation'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    26
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    27
copyright
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    28
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    29
 COPYRIGHT (c) 1997 by eXept Software AG
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    30
              All Rights Reserved
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    31
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    32
 This software is furnished under a license and may be used
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    37
 hereby transferred.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    38
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    39
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    40
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    41
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    42
documentation
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    43
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    44
    describes one tab entry; could be used for tabs instead of a string. Whenever
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    45
    a value changed, a change notification is raised
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    46
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    47
    [see also:]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    48
        TabItemEditor
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    49
        TabView
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    50
        NoteBookView
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    51
        UIPainter
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    52
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    53
    [author:]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    54
        Claus Atzkern
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    55
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    56
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    57
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    58
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    59
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    60
examples
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    61
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    62
    labels derived from item
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    63
                                                                                [exBegin]                                      
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    64
    |top tab|
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    65
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    66
    top := StandardSystemView new label:'tabs at top'; extent:250@100.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    67
    tab  := TabView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    68
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    69
    tab direction:#top.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    70
    tab list:(#( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ]).
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    71
    tab action:[:aName|Transcript showCR:aName].
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    72
    top open.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    73
                                                                                [exEnd]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    74
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    75
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    76
    testing tab configuration and change notifications
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    77
                                                                                [exBegin]                                      
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    78
    |top tab list idx label|
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    79
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    80
    top := StandardSystemView new label:'tabs at top'; extent:250@100.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    81
    tab  := TabView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    82
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    83
    tab direction:#top.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    84
    list := (#( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ]).
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    85
    tab list:list.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    86
    tab action:[:aName|Transcript showCR:aName].
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    87
    top openAndWait.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    88
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    89
    [
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    90
        idx := 0.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    91
        label := LabelAndIcon icon:(Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir.xpm' ))
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    92
                            string:'Test Tab'.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    93
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    94
        [top shown] whileTrue:[
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    95
            |aTab lbl|
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    96
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    97
            (idx := idx + 1) > list size ifTrue:[idx := 1].
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    98
e065c08b2a69 initial checkin
ca
parents:
diff changeset
    99
            aTab := list at:idx.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   100
            lbl  := aTab label.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   101
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   102
            Delay waitForSeconds:0.5. aTab label:label.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   103
            Delay waitForSeconds:0.5. aTab enabled:false.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   104
            Delay waitForSeconds:0.5. aTab enabled:true.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   105
            Delay waitForSeconds:0.5. aTab foregroundColor:(Color red).
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   106
            Delay waitForSeconds:0.5. aTab foregroundColor:nil.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   107
            aTab label:lbl.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   108
        ]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   109
    ] forkAt:1.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   110
                                                                                [exEnd]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   111
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   112
"
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   113
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   114
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   115
!TabItem class methodsFor:'instance creation'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   116
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   117
label:aLabel
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   118
    ^ self new label:aLabel
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   119
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   120
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   121
!TabItem class methodsFor:'tests'!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   122
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   123
test
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   124
    |top tab list item|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   125
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   126
    top := StandardSystemView new label:'tabs at top'; extent:400@400.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   127
    tab  := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   128
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   129
    tab direction:#top.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   130
    list := #( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   131
    item := list at:1.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   132
    item majorKey:ClockView.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   133
    item := list at:2.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   134
    item majorKey:CodingExamples_GUI::GUIDemoNoteBook.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   135
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   136
    item := list at:3.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   137
    item majorKey:CodingExamples_GUI::GUIDemoMenu.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   138
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   139
    tab list:list.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   140
    top open.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   141
! !
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   142
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   143
!TabItem methodsFor:'accessing'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   144
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   145
accessCharacterPosition
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   146
    "get the index of the access character in the label text or string, or 0 if none"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   147
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   148
    ^ accessCharacterPosition ? 0
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   149
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   150
    "Modified: / 06-09-2006 / 14:57:08 / cg"
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   151
!
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   152
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   153
accessCharacterPosition:anIndex
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   154
    "set the index of the access character in the label"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   155
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   156
    accessCharacterPosition := anIndex
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   157
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   158
    "Modified: / 06-09-2006 / 14:57:44 / cg"
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   159
!
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   160
716
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   161
argument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   162
    "returns a user defined argument or nil
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   163
    "
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   164
    ^ argument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   165
!
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   166
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   167
argument:anArgument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   168
    "set a user defined argument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   169
    "
1674
042a8f089e77 add inputGroup
ca
parents: 1671
diff changeset
   170
    (anArgument isString and:[anArgument isEmpty]) ifTrue:[
042a8f089e77 add inputGroup
ca
parents: 1671
diff changeset
   171
        argument := nil
042a8f089e77 add inputGroup
ca
parents: 1671
diff changeset
   172
    ] ifFalse:[
042a8f089e77 add inputGroup
ca
parents: 1671
diff changeset
   173
        argument := anArgument
042a8f089e77 add inputGroup
ca
parents: 1671
diff changeset
   174
    ].
716
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   175
    argument := anArgument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   176
!
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   177
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   178
createNewBuilder
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   179
    "returns true if a new builder is used to create the canvas;
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   180
     the default is true"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   181
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   182
    ^ createNewBuilder ? true
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   183
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   184
    "Modified: / 06-09-2006 / 14:58:58 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   185
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   186
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   187
createNewBuilder:aBool
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   188
    "set/clear the flag which controls if a new ui-builder is used to create the canvas;
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   189
     the default is true. This affects if the bindings will be shared or not between tabs."
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   190
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   191
    createNewBuilder := aBool
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   192
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   193
    "Modified: / 06-09-2006 / 15:00:04 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   194
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   195
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   196
enabled
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   197
    "get the enabled state of the tab
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   198
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   199
    ^ enabled ? true
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   200
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   201
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   202
enabled:aState
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   203
    "set the enabled state of the tab
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   204
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   205
    |s|
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   206
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   207
    s := aState ? true.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   208
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   209
    self enabled ~~ s ifTrue:[
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   210
        enabled := s.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   211
        self changed:#enabled
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   212
    ]
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   213
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   214
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   215
foregroundColor
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   216
    "get the label color or nil"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   217
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   218
    ^ foregroundColor
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   219
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   220
    "Modified: / 06-09-2006 / 15:14:46 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   221
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   222
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   223
foregroundColor:aColor
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   224
    "set the label color or nil"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   225
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   226
    foregroundColor ~= aColor ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   227
        foregroundColor := aColor.
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   228
        self changed:#foregroundColor
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   229
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   230
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   231
    "Modified: / 06-09-2006 / 15:00:31 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   232
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   233
3296
cbd5655f3905 added hasView
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
   234
hasView
cbd5655f3905 added hasView
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
   235
    ^ view notNil
cbd5655f3905 added hasView
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
   236
!
cbd5655f3905 added hasView
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
   237
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   238
label
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   239
    "get the label or selector to access a label/bitmap. To get the label to be shown
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   240
     use: #rawLabel
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   241
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   242
    ^ label
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   243
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   244
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   245
label:aLabel
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   246
    "set the label or selector to access the label/bitmap"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   247
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   248
    label := aLabel.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   249
1936
ce9aa6069889 in #label: treat label as different, if emphasis is.
Claus Gittinger <cg@exept.de>
parents: 1891
diff changeset
   250
    (aLabel ~= rawLabel
3346
ed88a5f2aaee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   251
    or:[aLabel class ~~ rawLabel class 
1936
ce9aa6069889 in #label: treat label as different, if emphasis is.
Claus Gittinger <cg@exept.de>
parents: 1891
diff changeset
   252
    or:[aLabel isString 
ce9aa6069889 in #label: treat label as different, if emphasis is.
Claus Gittinger <cg@exept.de>
parents: 1891
diff changeset
   253
        and:[rawLabel isString
3346
ed88a5f2aaee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   254
        and:[(aLabel sameStringAndEmphasisAs:rawLabel) not]]]])
1936
ce9aa6069889 in #label: treat label as different, if emphasis is.
Claus Gittinger <cg@exept.de>
parents: 1891
diff changeset
   255
ce9aa6069889 in #label: treat label as different, if emphasis is.
Claus Gittinger <cg@exept.de>
parents: 1891
diff changeset
   256
    ifTrue:[
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   257
        rawLabel := aLabel.
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   258
        self changed
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   259
    ]
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   260
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   261
    "Modified: / 06-09-2006 / 15:54:13 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   262
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   263
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   264
labelForegroundColor
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   265
    "get the label color or nil
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   266
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   267
    ^ self foregroundColor
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   268
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   269
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   270
labelForegroundColor:aColor
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   271
    "set the label color or nil
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   272
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   273
    self foregroundColor:aColor
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   274
!
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   275
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   276
shortcutKey
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   277
    "get the key to press to select the tab item from the keyboard; a symbol or nil"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   278
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   279
    ^ shortcutKey
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   280
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   281
    "Modified: / 06-09-2006 / 15:09:18 / cg"
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   282
!
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   283
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   284
shortcutKey:aKeyOrNil
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   285
    "set the key to press to select the tab item from the keyboard; a symbol or nil"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   286
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   287
    |key|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   288
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   289
    aKeyOrNil size ~~ 0 ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   290
        key := aKeyOrNil asSymbol
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   291
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   292
    shortcutKey := key
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   293
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   294
    "Modified: / 06-09-2006 / 15:09:31 / cg"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   295
!
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   296
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   297
view:aView
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   298
    aView isNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   299
        view := aView.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   300
        ^ self.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   301
    ].
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   302
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   303
    view notNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   304
        aView ~~ view ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   305
            self error:'TabItems cannot be reused'.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   306
        ].
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   307
    ].
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   308
    view := aView.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   309
    self setAttributesWithBuilder:view application builder.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   310
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   311
    "Modified: / 06-09-2006 / 17:58:58 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   312
! !
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   313
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
   314
!TabItem methodsFor:'accessing-canvas'!
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   315
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   316
canvas
3358
54f70d1e57b7 comment
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
   317
    "returns the application. Creates one if not already present"
54f70d1e57b7 comment
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
   318
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   319
    |view cls wsel classNameKey oldBuilder usedBuilder appl|
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   320
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   321
    canvas notNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   322
        ^ canvas
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   323
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   324
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   325
    (classNameKey := majorKey) notNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   326
        oldBuilder := builder.
1891
ab8801a1c22d subapps always got a new builder (even if one was already present)
tm
parents: 1777
diff changeset
   327
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   328
        (oldBuilder notNil
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   329
        and:[(appl := oldBuilder application) notNil]) ifTrue:[
2848
a6f481effd99 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   330
            canvas := appl subApplicationFor:majorKey.
a6f481effd99 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   331
            canvas isNil ifTrue:[
a6f481effd99 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   332
                cls := appl resolveName:classNameKey.
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   333
            ]
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   334
        ] ifFalse:[
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   335
            "/ cls := Smalltalk resolveName:classNameKey inClass:self class.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   336
            cls := Smalltalk classNamed:classNameKey.
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   337
        ].
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   338
        canvas isNil ifTrue:[
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   339
            cls isNil ifTrue:[
2491
10f86a3c5342 do NOT catch errors !!!!!
martin
parents: 2439
diff changeset
   340
                self error:('no canvas for majorKey: ' , classNameKey) mayProceed:true.
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   341
                "/ self majorKey:nil.
2491
10f86a3c5342 do NOT catch errors !!!!!
martin
parents: 2439
diff changeset
   342
                ^ nil
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   343
            ].
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   344
            canvas := cls new.
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   345
        ].
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   346
2723
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   347
        self isCanvasApplicationModel ifTrue:[
2794
80afa90b592d *** empty log message ***
penk
parents: 2723
diff changeset
   348
            view := ApplicationSubView new.
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   349
            wsel := minorKey ? #windowSpec.
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   350
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   351
            (usedBuilder := canvas builder) isNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   352
                (usedBuilder := oldBuilder) isNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   353
                    usedBuilder := canvas createBuilder.
1891
ab8801a1c22d subapps always got a new builder (even if one was already present)
tm
parents: 1777
diff changeset
   354
                ] ifFalse:[
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   355
                    canvas builder:usedBuilder.
1891
ab8801a1c22d subapps always got a new builder (even if one was already present)
tm
parents: 1777
diff changeset
   356
                ].
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   357
            ].
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   358
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   359
            (appl notNil and:[canvas masterApplication isNil]) ifTrue:[
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   360
                canvas masterApplication:appl
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   361
            ].
1943
c90153998d43 set new application in builder if builder is created
martin
parents: 1936
diff changeset
   362
            self createNewBuilder ifTrue:[
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   363
                usedBuilder application:canvas
1943
c90153998d43 set new application in builder if builder is created
martin
parents: 1936
diff changeset
   364
            ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   365
            view client:canvas spec:wsel builder:usedBuilder.
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   366
            canvas window:(self setupCanvasView:view).
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   367
        ] ifFalse:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   368
            canvas := self setupCanvasView:canvas
1943
c90153998d43 set new application in builder if builder is created
martin
parents: 1936
diff changeset
   369
        ]
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   370
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   371
    ^ canvas
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   372
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   373
    "Modified: / 06-09-2006 / 15:07:55 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   374
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   375
3347
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   376
canvasOrNil
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   377
    "returns the application or nil - does NOT create one"
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   378
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   379
    ^ canvas 
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   380
!
b3cccb8303ae changed #canvasOrNil
Claus Gittinger <cg@exept.de>
parents: 3346
diff changeset
   381
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   382
canvasView
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   383
    "returns the view the canvas is running in or nil if no canvas
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   384
     specified or not yet created
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   385
    "
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   386
    |canvas|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   387
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   388
    (canvas := self canvas) notNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   389
        ^ canvas perform:#window ifNotUnderstood:[canvas]
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   390
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   391
    ^ nil
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   392
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   393
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   394
destroyCanvas
3268
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   395
    |canvasView|
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   396
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   397
    canvas notNil ifTrue:[
2723
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   398
        self isCanvasApplicationModel ifTrue:[
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   399
            canvas releaseAsSubCanvas.
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   400
        ].
3268
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   401
        (canvasView := self canvasView) notNil ifTrue:[
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   402
            canvasView destroy.
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   403
        ].
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   404
        canvas := nil
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   405
    ].
3268
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   406
cdc4a1749cb9 changed #destroyCanvas
Claus Gittinger <cg@exept.de>
parents: 3191
diff changeset
   407
    "Modified: / 02-11-2007 / 14:54:47 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   408
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   409
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   410
majorKey
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   411
    ^ majorKey
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   412
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   413
    "Modified: / 06-09-2006 / 15:01:14 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   414
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   415
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   416
majorKey:aMajorKey
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   417
    |key|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   418
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   419
    aMajorKey notNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   420
        aMajorKey isBehavior ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   421
            key := aMajorKey name asSymbol
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   422
        ] ifFalse:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   423
            aMajorKey size ~~ 0 ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   424
                key := aMajorKey asSymbol
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   425
            ]
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   426
        ]
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   427
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   428
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   429
    self majorKey ~~ key ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   430
        self destroyCanvas
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   431
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   432
    majorKey := key.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   433
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   434
    "Modified: / 06-09-2006 / 15:01:22 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   435
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   436
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   437
minorKey
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   438
    ^ minorKey
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   439
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   440
    "Modified: / 06-09-2006 / 15:01:58 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   441
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   442
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   443
minorKey:aMinorKey
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   444
    minorKey := aMinorKey.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   445
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   446
    "Modified: / 06-09-2006 / 15:02:04 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   447
!
1671
0564c18a4ea4 support accelerator and accessCharacter
ca
parents: 716
diff changeset
   448
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   449
setupCanvasView:aView
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   450
    |frame isV isH auto|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   451
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   452
    isH := self hasHorizontalScrollBar.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   453
    isV := self hasVerticalScrollBar.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   454
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   455
    (isH or:[isV]) ifFalse:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   456
        frame := aView
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   457
    ] ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   458
        frame := ScrollableView for:ViewScroller.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   459
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   460
        frame horizontalScrollable:isH.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   461
        frame verticalScrollable:isV.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   462
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   463
        isH ifTrue:[frame horizontalMini:(self miniScrollerHorizontal)].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   464
        isV ifTrue:[frame verticalMini:(self miniScrollerVertical)].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   465
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   466
        (auto := self autoHideScrollBars) notNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   467
            frame autoHideScrollBars:auto
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   468
        ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   469
        frame scrolledView scrolledView:aView.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   470
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   471
    frame objectAttributeAt:#isTabItem put:true.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   472
  ^ frame
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   473
! !
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   474
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
   475
!TabItem methodsFor:'accessing-scrollbars'!
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   476
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   477
autoHideScrollBars
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   478
    ^ autoHideScrollBars
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   479
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   480
    "Modified: / 06-09-2006 / 14:58:38 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   481
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   482
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   483
autoHideScrollBars:aBoolOrNil
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   484
    autoHideScrollBars := aBoolOrNil
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   485
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   486
    "Modified: / 06-09-2006 / 14:58:45 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   487
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   488
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   489
hasHorizontalScrollBar
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   490
    ^ hasHorizontalScrollBar ? false
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   491
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   492
    "Modified: / 06-09-2006 / 15:00:39 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   493
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   494
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   495
hasHorizontalScrollBar:aBool
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   496
    |flag|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   497
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   498
    aBool == true ifTrue:[flag := true]
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   499
                 ifFalse:[self miniScrollerHorizontal:false].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   500
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   501
    hasHorizontalScrollBar := flag
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   502
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   503
    "Modified: / 06-09-2006 / 15:00:58 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   504
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   505
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   506
hasVerticalScrollBar
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   507
    ^ hasVerticalScrollBar ? false
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   508
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   509
    "Modified: / 06-09-2006 / 15:01:03 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   510
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   511
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   512
hasVerticalScrollBar:aBool
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   513
    |flag|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   514
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   515
    aBool == true ifTrue:[flag := true]
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   516
                 ifFalse:[self miniScrollerVertical:false].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   517
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   518
    hasVerticalScrollBar := flag
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   519
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   520
    "Modified: / 06-09-2006 / 15:01:10 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   521
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   522
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   523
miniScrollerHorizontal
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   524
    ^ miniScrollerHorizontal ? false
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   525
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   526
    "Modified: / 06-09-2006 / 15:01:29 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   527
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   528
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   529
miniScrollerHorizontal:aBool
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   530
    miniScrollerHorizontal := aBool
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   531
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   532
    "Modified: / 06-09-2006 / 15:01:40 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   533
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   534
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   535
miniScrollerVertical
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   536
    ^ miniScrollerVertical ? false
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   537
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   538
    "Modified: / 06-09-2006 / 15:01:45 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   539
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   540
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   541
miniScrollerVertical:aBool
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   542
    miniScrollerVertical := aBool
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   543
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   544
    "Modified: / 06-09-2006 / 15:01:55 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   545
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   546
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   547
!TabItem methodsFor:'building'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   548
716
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   549
editAgument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   550
    "used by TabItemEditor to get the argument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   551
    "
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   552
    ^ argument isSymbol ifTrue:['#', argument] ifFalse:[argument]
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   553
!
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   554
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   555
editAgument:anArgument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   556
    "used by TabItemEditor to set the argument
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   557
    "
2439
5bc545c13f51 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 2438
diff changeset
   558
    |size|
716
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   559
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   560
    anArgument size ~~ 0 ifTrue:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   561
        argument := anArgument withoutSeparators.
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   562
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   563
        (size := argument size) == 0 ifTrue:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   564
            argument := nil
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   565
        ] ifFalse:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   566
            (argument startsWith:$#) ifTrue:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   567
                size > 1 ifTrue:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   568
                    argument := (argument copyFrom:2) asSymbol
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   569
                ] ifFalse:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   570
                    argument := nil
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   571
                ]
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   572
            ]
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   573
        ]
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   574
    ] ifFalse:[
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   575
        argument := nil
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   576
    ]
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   577
!
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   578
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   579
rawLabel
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   580
    "returns the label to be shown
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   581
    "
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   582
    ^ rawLabel ? ' '
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   583
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   584
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   585
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   586
702
cf639897acfd support of TabItemEditor
ca
parents: 701
diff changeset
   587
setAttributesFromClass:aClass
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   588
    "setup attributes from aClass 
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   589
     Ugly: used only with the tabListEditor."
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   590
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   591
    |spec cls|
1761
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   592
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   593
    rawLabel := nil.
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   594
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   595
    cls := aClass.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   596
    cls isBehavior not ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   597
        self halt.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   598
        cls := Smalltalk classNamed:aClass
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   599
    ].
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   600
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   601
    cls notNil ifTrue:[
1761
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   602
        (self translateLabel and:[label isString]) ifTrue:[
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   603
            rawLabel := cls perform:(label asSymbol) ifNotUnderstood:nil
702
cf639897acfd support of TabItemEditor
ca
parents: 701
diff changeset
   604
        ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   605
        (majorKey isNil and:[minorKey notNil]) ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   606
"/            Error handle:[:ex|
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   607
"/            ] do:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   608
                "/ spec := cls perform:(minorKey asSymbol) ifNotUnderstood:nil.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   609
                "/ spec notNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   610
                    canvas := ApplicationSubView new.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   611
                    canvas client:nil spec:minorKey "spec" builder:(UIBuilder new).
1761
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   612
                    canvas := self setupCanvasView:canvas.
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   613
                "/ ].
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   614
"/            ]
1761
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   615
        ]        
702
cf639897acfd support of TabItemEditor
ca
parents: 701
diff changeset
   616
    ].
1761
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   617
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   618
    rawLabel isNil ifTrue:[
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   619
        rawLabel := label isNil ifTrue:[''] ifFalse:[label printString]
631af8bb3076 *** empty log message ***
ca
parents: 1760
diff changeset
   620
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   621
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   622
    "Modified: / 06-09-2006 / 17:48:37 / cg"
702
cf639897acfd support of TabItemEditor
ca
parents: 701
diff changeset
   623
!
cf639897acfd support of TabItemEditor
ca
parents: 701
diff changeset
   624
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   625
setAttributesWithBuilder:aBuilder
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   626
    "setup attributes dependent on the builder
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   627
    "
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   628
    |appl usedBuilder |
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   629
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   630
    usedBuilder := self createNewBuilder ifTrue:[UIBuilder new] ifFalse:[aBuilder].
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   631
    builder := usedBuilder.
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   632
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   633
    (self translateLabel and:[label isString]) ifTrue:[
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   634
        rawLabel := aBuilder labelFor:(label asSymbol).
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   635
    ].
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   636
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   637
    rawLabel isNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   638
        rawLabel := label printString.
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   639
    ].
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   640
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   641
    (aBuilder isEditing or:[(appl := aBuilder application) isNil]) ifFalse:[
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   642
        activeHelpKey notNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   643
            activeHelpText := appl helpTextForKey:activeHelpKey.
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   644
        ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   645
        usedBuilder application isNil ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   646
            usedBuilder application:appl
1777
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   647
        ].
1c09f7e0a18a set masterApplication ... in case of an ApplicationModel
tm
parents: 1761
diff changeset
   648
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   649
        (majorKey isNil and:[minorKey notNil]) ifTrue:[
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   650
            canvas := ApplicationSubView new.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   651
            canvas client:appl spec:minorKey builder:usedBuilder.
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   652
            canvas := self setupCanvasView:canvas.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   653
        ]
1891
ab8801a1c22d subapps always got a new builder (even if one was already present)
tm
parents: 1777
diff changeset
   654
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   655
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   656
    "Modified: / 06-09-2006 / 17:47:46 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   657
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   658
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   659
translateLabel
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   660
    "returns true if the label derives from the application"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   661
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   662
    ^ translateLabel ? false
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   663
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   664
    "Modified: / 06-09-2006 / 15:09:40 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   665
!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   666
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   667
translateLabel:aBool
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   668
    "set/clear the flag which controls if the label is translated to a national language
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   669
     via the applications resources"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   670
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   671
    |flag|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   672
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   673
    aBool == true ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   674
        flag := true.
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   675
    ].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   676
    translateLabel := flag.
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   677
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   678
    "Modified: / 06-09-2006 / 15:11:16 / cg"
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   679
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   680
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   681
!TabItem methodsFor:'converting'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   682
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   683
skippedInLiteralEncoding
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   684
    |skipped|
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   685
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   686
    skipped := super skippedInLiteralEncoding asOrderedCollection.
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   687
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   688
    skipped add:#view.
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   689
    skipped add:#rawLabel.
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   690
    skipped add:#canvas.
716
ed0ed44d8cfb add user defined argument
ca
parents: 702
diff changeset
   691
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   692
    self enabled                      ifTrue:[ skipped add:#enabled ].
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   693
    self accessCharacterPosition == 0 ifTrue:[ skipped add:#accessCharacterPosition ].
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   694
    self createNewBuilder             ifTrue:[ skipped add:#createNewBuilder ].
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   695
    self miniScrollerVertical        ifFalse:[ skipped add:#miniScrollerVertical ].
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   696
    self miniScrollerHorizontal      ifFalse:[ skipped add:#miniScrollerHorizontal ].
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   697
3191
a5bb500a135a literal encoding
ca
parents: 3068
diff changeset
   698
    ^ skipped
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   699
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   700
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   701
!TabItem methodsFor:'displaying'!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   702
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   703
displayOn:aGC x:x y:y
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   704
    |s|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   705
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   706
    (s := rawLabel ? label) isNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   707
        ^ self
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   708
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   709
    s isNumber ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   710
        s := s printString
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   711
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   712
    s displayOn:aGC x:x y:y
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   713
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   714
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   715
heightOn:aGC
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   716
    |s|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   717
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   718
    (s := rawLabel ? label) isNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   719
        ^ aGC font height
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   720
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   721
    ^ s heightOn:aGC
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   722
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   723
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   724
widthOn:aGC
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   725
    |s|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   726
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   727
    (s := rawLabel ? label) isNil ifTrue:[
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   728
        ^ 4
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   729
    ].
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   730
    ^ s widthOn:aGC
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   731
! !
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   732
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   733
!TabItem methodsFor:'help'!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   734
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   735
activeHelpKey
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   736
    ^ activeHelpKey
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   737
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   738
    "Modified: / 06-09-2006 / 14:58:11 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   739
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   740
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   741
activeHelpKey:aKey
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   742
    |key|
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   743
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   744
    aKey size > 0 ifTrue:[key := aKey asSymbol].
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   745
    activeHelpKey := key
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   746
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   747
    "Modified: / 06-09-2006 / 14:58:32 / cg"
1759
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   748
!
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   749
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   750
activeHelpText
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   751
    ^ activeHelpText
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   752
! !
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   753
a8b1d1fad2f1 add more functionality; canvas and help
ca
parents: 1674
diff changeset
   754
!TabItem methodsFor:'queries'!
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   755
2723
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   756
isCanvasApplicationModel
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   757
    "returns true if the canvas is an application model"
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   758
2723
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   759
    canvas notNil ifTrue:[
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   760
        ^ canvas isKindOf:ApplicationModel.
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   761
    ].
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   762
    ^ false.
3068
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   763
ae56b8c3c7a6 that code sucked - it still does, but less so.
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   764
    "Modified: / 06-09-2006 / 15:11:50 / cg"
2723
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   765
!
8532bbba673b call #releaseAsSubCanvas on destroyed applications
ca
parents: 2491
diff changeset
   766
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   767
isEnabled
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   768
    ^ self enabled
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   769
! !
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   770
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   771
!TabItem class methodsFor:'documentation'!
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   772
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   773
version
3358
54f70d1e57b7 comment
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
   774
    ^ '$Header: /cvs/stx/stx/libwidg2/TabItem.st,v 1.27 2008-03-08 10:59:40 cg Exp $'
696
e065c08b2a69 initial checkin
ca
parents:
diff changeset
   775
! !