From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:47:11 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>FieldSelectionExample</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none partID partID2 <imports></imports> <category>Examples-Help</category> <attributes> <package>FieldSelection-Example</package> </attributes> </class> <comment> Examples.FieldSelectionExample
FieldSelectionExample demonstrates techniques for manipulating the selection in an input field.
</comment> <methods> Examples.FieldSelectionExample <category>actions</category>
addPart "Put a template in the partID field, then highlight the suffix." | wrapper | self partID value: 'MW-0000'. wrapper := self builder componentAt: #part1. wrapper takeKeyboardFocus. wrapper widget controller selectFrom: 4 to: 7.
addPart2 "Put a template in the partID2 field, then position the insertion point." | wrapper | self partID2 value: 'MW-'. wrapper := self builder componentAt: #part2. wrapper takeKeyboardFocus. wrapper widget controller selectAt: 4.
</methods> <methods> Examples.FieldSelectionExample <category>aspects</category>
partID "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^partID isNil ifTrue: [partID := String new asValue] ifFalse: [partID]
partID2 "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^partID2 isNil ifTrue: [partID2 := String new asValue] ifFalse: [partID2]
</methods> <methods> Examples.FieldSelectionExample class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: 'FieldSelectionExample' #min: #(#Point 303 93 ) #max: #(#Point 383 93 ) #bounds: #(#Rectangle 417 371 800 464 ) ) #component: #(#SpecCollection #collection: #( #(#InputFieldSpec #layout: #(#Rectangle 35 41 146 67 ) #name: #part1 #model: #partID ) #(#InputFieldSpec #layout: #(#Rectangle 227 41 338 67 ) #name: #part2 #model: #partID2 ) #(#DividerSpec #layout: #(#Rectangle 181 -3 185 96 ) #orientation: #vertical ) #(#LabelSpec #layout: #(#Point 6 68 ) #label: 'Suffix is highlighted' ) #(#LabelSpec #layout: #(#Point 193 68 ) #label: 'Insertion point at end' ) #(#ActionButtonSpec #layout: #(#Rectangle 47 8 133 32 ) #model: #addPart #label: 'New part' #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 241 9 324 33 ) #model: #addPart2 #label: 'New part' #defaultable: true ) ) ) )
</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>