A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-rww.67.mcz ==================== Summary ==================== Name: ToolBuilder-Morphic-rww.67 Author: rww Time: 11 September 2010, 4:50:31.588 am UUID: ffdc3ca5-d75b-ba43-ade3-c461a9ee74b1 Ancestors: ToolBuilder-Morphic-ar.66 Implementation of a Morphic PluggableCheckBoxMorph =============== Diff against ToolBuilder-Morphic-ar.66 =============== Item was added: + ----- Method: MorphicToolBuilder>>buildPluggableCheckBox: (in category 'pluggable widgets') ----- + buildPluggableCheckBox: spec + + | widget label state action | + label := spec label. + state := spec state. + action := spec action. + widget := self checkBoxClass on: spec model + getState: (state isSymbol ifTrue:[state]) + action: (action isSymbol ifTrue:[action]) + label: (label isSymbol ifTrue:[label]). + self register: widget id: spec name. + + widget installButton. + " widget getColorSelector: spec color. + widget offColor: Color white.. + self buildHelpFor: widget spec: spec. + (label isSymbol or:[label == nil]) ifFalse:[widget label: label]. + " self setFrame: spec frame in: widget. + parent ifNotNil:[self add: widget to: parent]. + ^widget! Item was added: + ----- Method: MorphicToolBuilder>>checkBoxClass (in category 'widget classes') ----- + checkBoxClass + ^ PluggableCheckBoxMorph! Item was added: + AlignmentMorph subclass: #PluggableCheckBoxMorph + instanceVariableNames: 'model actionSelector valueSelector label' + classVariableNames: '' + poolDictionaries: '' + category: 'ToolBuilder-Morphic'! Item was added: + ----- Method: PluggableCheckBoxMorph classSide>>on:getState:action:label: (in category 'as yet unclassified') ----- + on: anObject getState: getStateSel action: actionSel label: labelSel + + ^ self new + on: anObject + getState: getStateSel + action: actionSel + label: labelSel + menu: nil + ! Item was added: + ----- Method: PluggableCheckBoxMorph>>actionSelector (in category 'accessing') ----- + actionSelector + "Answer the value of actionSelector" + + ^ actionSelector! Item was added: + ----- Method: PluggableCheckBoxMorph>>actionSelector: (in category 'accessing') ----- + actionSelector: anObject + "Set the value of actionSelector" + + actionSelector := anObject! Item was added: + ----- Method: PluggableCheckBoxMorph>>basicPanel (in category 'installing') ----- + basicPanel + ^BorderedMorph new + beTransparent; + extent: 0@0; + borderWidth: 0; + layoutInset: 0; + cellInset: 0; + layoutPolicy: TableLayout new; + listCentering: #topLeft; + cellPositioning: #center; + hResizing: #spaceFill; + vResizing: #shrinkWrap; + yourself! Item was added: + ----- Method: PluggableCheckBoxMorph>>horizontalPanel (in category 'installing') ----- + horizontalPanel + ^self basicPanel + cellPositioning: #center; + listDirection: #leftToRight; + yourself.! Item was added: + ----- Method: PluggableCheckBoxMorph>>installButton (in category 'installing') ----- + installButton + + | aButton aLabel | + aButton := UpdatingThreePhaseButtonMorph checkBox + target: self model; + actionSelector: self actionSelector; + getSelector: self valueSelector; + yourself. + aLabel := (StringMorph contents: self label translated + font: (StrikeFont familyName: TextStyle defaultFont familyName + size: TextStyle defaultFont pointSize - 1)). + self addMorph: (self horizontalPanel + addMorphBack: aButton; + addMorphBack: aLabel; + yourself).! Item was added: + ----- Method: PluggableCheckBoxMorph>>label (in category 'accessing') ----- + label + "Answer the value of label" + + ^ label! Item was added: + ----- Method: PluggableCheckBoxMorph>>label: (in category 'accessing') ----- + label: anObject + "Set the value of label" + + label := anObject! Item was added: + ----- Method: PluggableCheckBoxMorph>>model (in category 'accessing') ----- + model + "Answer the value of model" + + ^ model. + ! Item was added: + ----- Method: PluggableCheckBoxMorph>>model: (in category 'accessing') ----- + model: anObject + "Set the value of model" + + model := anObject! Item was added: + ----- Method: PluggableCheckBoxMorph>>on:getState:action:label:menu: (in category 'initialization') ----- + on: anObject getState: getStateSel action: actionSel label: labelSel menu: menuSel + + self model: anObject. + self valueSelector: getStateSel. + self actionSelector: actionSel. + self label: (self model perform: labelSel). + ! Item was added: + ----- Method: PluggableCheckBoxMorph>>valueSelector (in category 'accessing') ----- + valueSelector + "Answer the value of valueSelector" + + ^ valueSelector! Item was added: + ----- Method: PluggableCheckBoxMorph>>valueSelector: (in category 'accessing') ----- + valueSelector: anObject + "Set the value of valueSelector" + + valueSelector := anObject! |
Free forum by Nabble | Edit this page |