|
Class: TabItem
Object
|
+--Model
|
+--TabItem
- Package:
- stx:libwidg2
- Category:
- Views-Support
- Version:
- rev:
1.47
date: 2019/05/30 07:44:04
- user: cg
- file: TabItem.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Claus Atzkern
describes one tab entry; could be used for tabs instead of a string. Whenever
a value changed, a change notification is raised
TabItemEditor
TabView
NoteBookView
UIPainter
instance creation
-
label: aLabel
-
accessing
-
accessCharacterPosition
-
get the index of the access character in the label text or string, or 0 if none
-
accessCharacterPosition: anIndex
-
set the index of the access character in the label
-
argument
-
returns a user defined argument or nil
-
argument: anArgument
-
set a user defined argument
-
createNewBuilder
-
returns true if a new builder is used to create the canvas;
the default is true
-
createNewBuilder: aBool
-
set/clear the flag which controls if a new ui-builder is used to create the canvas;
the default is true. This affects if the bindings will be shared or not between tabs.
-
destroyTabAction
-
if non-nil, this tab has its own private destroyButton.
This can be used for individual tabs; for an overall tab-destroy capability,
change the destroyTab: action of my owning tabView
-
destroyTabAction: aBlock
-
if non-nil, this tab has its own private destroyButton.
This can be used for individual tabs; for an overall tab-destroy capability,
change the destroyTab: action of my owning tabView
-
enabled
-
get the enabled state of the tab
-
enabled: aBoolean
-
set the enabled state of the tab
-
hasView
-
-
label
-
get the label or selector to access a label/bitmap. To get the label to be shown
use: #rawLabel
-
label: aLabel
-
set the label or selector to access the label/bitmap
-
nameKey
-
an additional (untranslated) key (do not use the label to identify tabs)
-
nameKey: aStringOrSymbol
-
an additional (untranslated) key (do not use the label to identify tabs)
-
shortcutKey
-
get the key to press to select the tab item from the keyboard; a symbol or nil
-
shortcutKey: aKeyOrNil
-
set the key to press to select the tab item from the keyboard; a symbol or nil
-
view
-
-
view: aView
-
accessing-canvas
-
canvas
-
returns the application or view. Creates one if not already present
-
canvasApplication
-
returns the application the canvas is running
-
canvasOrNil
-
returns the application or nil - does NOT create one
-
canvasView
-
returns the view the canvas is running in or nil if no canvas
specified or not yet created
-
destroyCanvas
-
-
majorKey
-
-
majorKey: aMajorKey
-
-
minorKey
-
-
minorKey: aMinorKey
-
-
setupCanvasView: aView
-
not horizontal scrollable - always set x to scrolled view x
accessing-color & font
-
foregroundColor
-
get the label color or nil
-
foregroundColor: aColor
-
set the label color or nil
-
labelForegroundColor
-
get the label color or nil
-
labelForegroundColor: aColor
-
set the label color or nil
accessing-scrollbars
-
autoHideScrollBars
-
-
autoHideScrollBars: aBoolOrNil
-
-
hasHorizontalScrollBar
-
-
hasHorizontalScrollBar: aBool
-
-
hasVerticalScrollBar
-
-
hasVerticalScrollBar: aBool
-
-
miniScrollerHorizontal
-
-
miniScrollerHorizontal: aBool
-
-
miniScrollerVertical
-
-
miniScrollerVertical: aBool
-
building
-
applicationProvidesLabel
-
returns true if the label is acquired from the application
-
applicationProvidesLabel: aBool
-
set/clear the flag which controls if the label is provided by the application
-
editAgument
-
used by TabItemEditor to get the argument
-
editAgument: anArgument
-
used by TabItemEditor to set the argument
-
rawLabel
-
returns the label to be shown
-
setAttributesFromClass: aClass
-
setup attributes from aClass
Ugly: used only with the tabListEditor.
-
setAttributesWithBuilder: aBuilder
-
setup attributes dependent on the builder
-
translateLabel
-
returns true if the label derives from the application
-
translateLabel: aBool
-
set/clear the flag which controls if the label is translated to a national language
via the applications resources
converting
-
skippedInLiteralEncoding
-
define the inst-slots which are skipped when generating a literalArrayEncoding;
(to skip the ones with default values.)
displaying
-
displayOn: aGC x: x y: y
-
-
heightOn: aGC
-
-
widthOn: aGC
-
help
-
activeHelpKey
-
the key used to ask the application for the tooltip text (via helpTextFor:)
-
activeHelpKey: aSymbolicKey
-
the key used to ask the application for the tooltip text (via helpTextFor:)
-
activeHelpText
-
-
activeHelpText: aString
-
queries
-
isCanvasApplicationModel
-
returns true if the canvas is an application model
-
isEnabled
-
labels derived from item
|top tab|
top := StandardSystemView new label:'tabs at top'; extent:250@100.
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
tab direction:#top.
tab list:(#( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ]).
tab action:[:aName|Transcript showCR:aName].
top open.
|
|top tab list item|
top := StandardSystemView new label:'tabs at top'; extent:400@400.
tab := NoteBookView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
tab direction:#top.
list := #( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ].
item := list at:1.
item majorKey:ClockView.
item := list at:2.
item majorKey:CodingExamples_GUI::GUIDemoNoteBook.
item := list at:3.
item majorKey:CodingExamples_GUI::GUIDemoMenu.
tab list:list.
top open.
|
testing tab configuration and change notifications
|top tab list idx label|
top := StandardSystemView new label:'tabs at top'; extent:250@100.
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top.
tab direction:#top.
list := (#( 'Foo' 'Bar' 'Baz' ) collect:[:l| TabItem label:l ]).
tab list:list.
tab action:[:aName|Transcript showCR:aName].
top openAndWait.
[
idx := 0.
label := LabelAndIcon icon:(Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir.xpm' ))
string:'Test Tab'.
[top shown] whileTrue:[
|aTab lbl|
(idx := idx + 1) > list size ifTrue:[idx := 1].
aTab := list at:idx.
lbl := aTab label.
Delay waitForSeconds:0.5. aTab label:label.
Delay waitForSeconds:0.5. aTab enabled:false.
Delay waitForSeconds:0.5. aTab enabled:true.
Delay waitForSeconds:0.5. aTab foregroundColor:(Color red).
Delay waitForSeconds:0.5. aTab foregroundColor:nil.
aTab label:lbl.
]
] forkAt:1.
|
|