From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:48:48 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>TabControlExample</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none tabs <imports></imports> <category>Examples</category> <attributes> <package>TabControl-Example</package> </attributes> </class> <comment> Examples.TabControlExample
This class provides a simple example for the tab control widget. Instance Variables: tabs <SelectionInList> tab array
</comment> <methods> Examples.TabControlExample <category>private</category>
labelArray "Private - The list of tab names (and/or icons). See also #specArray." ^Array with: 'Appearance' with: self class colorsImage -> 'Colors' with: self class printerImage -> ''
specArray "Private - The list of associated sub canvaes. See also #labelArray." ^#(#appearanceSpec #fontsSpec #colorsSpec)
</methods> <methods> Examples.TabControlExample <category>interface opening</category>
postOpenWith: aBuilder super postOpenWith: aBuilder. self tabsChanged
</methods> <methods> Examples.TabControlExample <category>aspects</category>
tabs tabs isNil ifTrue: [(tabs := SelectionInList with: self labelArray) selectionIndex: 1. tabs selectionIndexHolder onChangeSend: #tabsChanged to: self]. ^tabs
</methods> <methods> Examples.TabControlExample <category>changing</category>
tabsChanged "Every time, a tab is changed, a new sub canvas gets installed." | index | index := self tabs selectionIndex. (self builder componentAt: #tabbing) widget client: self spec: (self specArray at: index)
</methods> <methods> Examples.TabControlExample class <category>examples</category>
example1 "self example1" ^self open
</methods> <methods> Examples.TabControlExample class <category>interface specs</category>
appearanceSpec "UIPainter new openOnClass: self andSelector: #appearanceSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Unlabeled Canvas' #bounds: #(#{Graphics.Rectangle} 646 415 954 785 ) #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.LabelSpec} #layout: #(#{Core.Point} 23 23 ) #label: 'This is the first page' ) ) ) )
colorsSpec "UIPainter new openOnClass: self andSelector: #colorsSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Unlabeled Canvas' #bounds: #(#{Graphics.Rectangle} 646 415 954 785 ) #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 0 0.5 0.5 0.5 ) #label: 'This is the third page' ) ) ) )
fontsSpec "UIPainter new openOnClass: self andSelector: #fontsSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Unlabeled Canvas' #bounds: #(#{Graphics.Rectangle} 646 415 954 785 ) #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} -23 1 -23 1 1 1 ) #label: 'This is the second page' ) ) ) )
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: ' TabControl Example' #bounds: #(#{Graphics.Rectangle} 646 457 954 743 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TabControlSpec} #layout: #(#{Graphics.LayoutFrame} 6 0 6 0 -6 1 -40 1 ) #name: #tabbing #model: #tabs #labels: #() ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -172 1 -31 1 -92 1 -6 1 ) #model: #closeRequest #label: 'OK' ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -86 1 -31 1 -6 1 -6 1 ) #model: #closeRequest #label: 'Cancel' ) ) ) )
</methods> <methods> Examples.TabControlExample class <category>resources</category>
colorsImage "UIMaskEditor new openOnClass: self andSelector: #colorsImage" <resource: #image> ^CachedImage on: (Image extent: 10@10 depth: 3 bitsPerPixel: 4 palette: (Graphics.MappedPalette withColors: ((Core.Array new: 5) at: 1 put: Graphics.ColorValue blue; at: 2 put: Graphics.ColorValue magenta; at: 3 put: Graphics.ColorValue white; at: 4 put: (Graphics.ColorValue scaledRed: 3693 scaledGreen: 3693 scaledBlue: 3693); at: 5 put: (Graphics.ColorValue scaledRed: 0 scaledGreen: 4240 scaledBlue: 0); yourself)) usingBits: #[51 51 51 51 51 0 0 0 50 35 68 50 35 0 0 0 50 35 68 50 35 0 0 0 51 51 51 51 51 0 0 0 49 19 34 50 35 0 0 0 49 19 34 50 35 0 0 0 51 51 51 51 51 0 0 0 50 35 0 50 35 0 0 0 50 35 0 50 35 0 0 0 51 51 51 51 51 0 0 0])
printerImage "UIMaskEditor new openOnClass: self andSelector: #printerImage" <resource: #image> ^CachedImage on: (Image extent: 16@16 depth: 3 bitsPerPixel: 4 palette: (MappedPalette withColors: ((Array new: 7) at: 1 put: ColorValue black; at: 2 put: (ColorValue scaledRed: 5548 scaledGreen: 5548 scaledBlue: 5548); at: 3 put: (ColorValue scaledRed: 6077 scaledGreen: 6077 scaledBlue: 6077); at: 4 put: ColorValue white; at: 5 put: ColorValue green; at: 6 put: ColorValue red; at: 7 put: (ColorValue scaledRed: 4227 scaledGreen: 4227 scaledBlue: 4227); yourself)) usingBits: #[34 34 34 34 38 102 34 34 34 34 34 34 99 51 102 34 34 34 34 38 51 51 51 0 34 34 38 99 51 51 48 34 34 38 99 99 51 51 2 34 38 99 17 22 99 48 32 2 99 17 68 17 22 96 38 96 99 51 17 85 17 22 102 96 99 17 51 17 22 102 102 96 99 17 17 54 102 102 102 96 102 17 17 22 102 102 96 2 38 102 17 22 102 96 6 2 32 17 102 22 96 6 96 2 34 0 17 96 6 96 2 34 34 34 0 22 96 2 34 34 34 34 34 34 34 34 34 34])
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class>