From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:47:18 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>FieldValidation1Example</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none productCode <imports></imports> <category>Examples-Help</category> <attributes> <package>FieldValidation1-Example</package> </attributes> </class> <comment> Examples.FieldValidation1Example
FieldValidation1Example demonstrates a technique for validating input to a field, character by character.
</comment> <methods> Examples.FieldValidation1Example <category>private</category>
keyPress: ev "Validate the character." | ch ascii | ch := ev keyValue. "Allow tab and cr." ascii := ch asInteger. (ascii == 9 or: [ascii == 13]) ifTrue: [^ev]. ch isAlphaNumeric ifFalse: [ Dialog warn: 'Please enter only letters and digits'. ^nil]. ^ev
</methods> <methods> Examples.FieldValidation1Example <category>interface opening</category>
postBuildWith: aBuilder | ctrlr | ctrlr := (aBuilder componentAt: #codeField) widget controller. ctrlr keyboardHook: [ :ev :c | self keyPress: ev].
</methods> <methods> Examples.FieldValidation1Example <category>aspects</category>
productCode "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^productCode isNil ifTrue: [productCode := String new asValue] ifFalse: [productCode]
</methods> <methods> Examples.FieldValidation1Example class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: 'FieldValidation1Example' #min: #(#Point 184 106 ) #max: #(#Point 246 106 ) #bounds: #(#Rectangle 415 493 661 599 ) ) #component: #(#SpecCollection #collection: #( #(#InputFieldSpec #layout: #(#Rectangle 75 26 174 52 ) #name: #codeField #model: #productCode ) #(#LabelSpec #layout: #(#Point 7 57 ) #label: 'Punctuation is not accepted' ) ) ) )
</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>