Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.124.mcz ==================== Summary ==================== Name: ToolBuilder-Morphic-mt.124 Author: mt Time: 12 April 2015, 6:30:24.599 pm UUID: dac1df35-d6de-5c4b-8cba-3d9c185f3cc4 Ancestors: ToolBuilder-Morphic-mt.123 Morphic tool builder messages re-organized. =============== Diff against ToolBuilder-Morphic-mt.123 =============== Item was changed: + ----- Method: MorphicToolBuilder>>buildHelpFor:spec: (in category 'private') ----- - ----- Method: MorphicToolBuilder>>buildHelpFor:spec: (in category 'pluggable widgets') ----- buildHelpFor: widget spec: aSpec aSpec help ifNotNil: [:stringOrSymbol | stringOrSymbol isSymbol ifTrue: [widget balloonTextSelector: stringOrSymbol] ifFalse: [widget balloonText: stringOrSymbol]].! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableActionButton: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableActionButton: (in category 'pluggable widgets') ----- buildPluggableActionButton: aSpec | button | button := self buildPluggableButton: aSpec. button color: Color white. ^button! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableAlternateMultiSelectionList: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableAlternateMultiSelectionList: (in category 'pluggable widgets') ----- buildPluggableAlternateMultiSelectionList: aSpec | listMorph listClass | aSpec getSelected ifNotNil: [ ^ self error: 'There is no PluggableAlternateListMorphOfManyByItem' ]. listClass := self alternateMultiSelectListClass. listMorph := listClass on: aSpec model list: aSpec list primarySelection: aSpec getIndex changePrimarySelection: aSpec setIndex listSelection: aSpec getSelectionList changeListSelection: aSpec setSelectionList menu: aSpec menu. listMorph setProperty: #highlightSelector toValue: #highlightMessageList:with: ; setProperty: #itemConversionMethod toValue: #asStringOrText ; setProperty: #balloonTextSelectorForSubMorphs toValue: #balloonTextForClassAndMethodString ; enableDragNDrop: SystemBrowser browseWithDragNDrop ; menuTitleSelector: #messageListSelectorTitle. self register: listMorph id: aSpec name. listMorph keystrokeActionSelector: aSpec keyPress ; getListElementSelector: aSpec listItem ; getListSizeSelector: aSpec listSize. self buildHelpFor: listMorph spec: aSpec. self setFrame: aSpec frame in: listMorph. parent ifNotNil: [ self add: listMorph to: parent ]. panes ifNotNil: [ aSpec list ifNotNil:[panes add: aSpec list ] ]. ^ listMorph! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableButton: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggableButton: (in category 'pluggable widgets') ----- buildPluggableButton: aSpec | widget label state action enabled | label := aSpec label. state := aSpec state. action := aSpec action. widget := self buttonClass on: aSpec model getState: (state isSymbol ifTrue:[state]) action: nil label: (label isSymbol ifTrue:[label]). widget style: aSpec style. aSpec changeLabelWhen ifNotNilDo: [ :event | widget whenChanged: event update: aSpec label]. self register: widget id: aSpec name. enabled := aSpec enabled. enabled isSymbol ifTrue:[widget getEnabledSelector: enabled] ifFalse:[widget enabled:enabled]. widget action: action. widget getColorSelector: aSpec color. widget offColor: Color white.. self buildHelpFor: widget spec: aSpec. (label isSymbol or:[label == nil]) ifFalse:[widget label: label]. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableCheckBox: (in category 'widgets optional') ----- - ----- 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 changed: + ----- Method: MorphicToolBuilder>>buildPluggableCodePane: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableCodePane: (in category 'pluggable widgets') ----- buildPluggableCodePane: aSpec "Install the default styler for code panes. Implementation note: We should just be doing something like, e.g., ^(self buildPluggableText: aSpec) useDefaultStyler Unfortunately, this will retrieve and layout the initial text twice which can make for a noticable performance difference when looking at some larger piece of code. So instead we copy the implementation from buildPlugggableText: here and insert #useDefaultStyler at the right point" | widget | widget := self codePaneClass new. widget useDefaultStyler. widget on: aSpec model text: aSpec getText accept: aSpec setText readSelection: aSpec selection menu: aSpec menu. widget font: Preferences standardCodeFont. self register: widget id: aSpec name. widget getColorSelector: aSpec color. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. widget borderColor: Color lightGray. widget color: Color white. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableDropDownList: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableDropDownList: (in category 'pluggable widgets') ----- buildPluggableDropDownList: spec | widget model listSelector selectionSelector selectionSetter | model := spec model. listSelector := spec listSelector. selectionSelector := spec selectionSelector. selectionSetter := spec selectionSetter. widget := self dropDownListClass new model: model; listSelector: listSelector; selectionSelector: selectionSelector; selectionSetter: selectionSetter; yourself. self register: widget id: spec name. widget installDropDownList. self setFrame: spec frame in: widget. parent ifNotNil:[self add: widget to: parent]. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableInputField: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableInputField: (in category 'pluggable widgets') ----- buildPluggableInputField: aSpec | widget | widget := self buildPluggableText: aSpec. widget acceptOnCR: true. widget hideScrollBarsIndefinitely. widget wantsFrameAdornments: false. widget textMorph autoFit: false; wrapFlag: true; width: 999999. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableList: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggableList: (in category 'pluggable widgets') ----- buildPluggableList: aSpec | widget listClass getIndex setIndex | aSpec getSelected ifNil:[ listClass := self listClass. getIndex := aSpec getIndex. setIndex := aSpec setIndex. ] ifNotNil:[ listClass := self listByItemClass. getIndex := aSpec getSelected. setIndex := aSpec setSelected. ]. widget := listClass on: aSpec model list: aSpec list selected: getIndex changeSelected: setIndex menu: aSpec menu keystroke: aSpec keyPress. self register: widget id: aSpec name. widget getListElementSelector: aSpec listItem. widget getListSizeSelector: aSpec listSize. widget getIconSelector: aSpec icon. widget getHelpSelector: aSpec help. widget doubleClickSelector: aSpec doubleClick. widget dragItemSelector: aSpec dragItem. widget dropItemSelector: aSpec dropItem. widget wantsDropSelector: aSpec dropAccept. widget autoDeselect: aSpec autoDeselect. widget keystrokePreviewSelector: aSpec keystrokePreview. aSpec color isNil ifTrue: [widget borderWidth: 1; borderColor: Color lightGray; color: Color white] ifFalse: [widget color: aSpec color]. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. panes ifNotNil:[ aSpec list ifNotNil:[panes add: aSpec list]. ]. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableMultiSelectionList: (in category 'widgets optional') ----- - ----- Method: MorphicToolBuilder>>buildPluggableMultiSelectionList: (in category 'pluggable widgets') ----- buildPluggableMultiSelectionList: aSpec | widget listClass | aSpec getSelected ifNotNil:[^self error:'There is no PluggableListMorphOfManyByItem']. listClass := self multiSelectListClass. widget := listClass on: aSpec model list: aSpec list primarySelection: aSpec getIndex changePrimarySelection: aSpec setIndex listSelection: aSpec getSelectionList changeListSelection: aSpec setSelectionList menu: aSpec menu. self register: widget id: aSpec name. widget keystrokeActionSelector: aSpec keyPress. widget getListElementSelector: aSpec listItem. widget getListSizeSelector: aSpec listSize. self buildHelpFor: widget spec: aSpec. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. panes ifNotNil:[ aSpec list ifNotNil:[panes add: aSpec list]. ]. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggablePanel: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggablePanel: (in category 'pluggable widgets') ----- buildPluggablePanel: aSpec | widget children frame | widget := self panelClass new. self register: widget id: aSpec name. widget model: aSpec model. widget color: Color transparent. widget clipSubmorphs: true. children := aSpec children. children isSymbol ifTrue:[ widget getChildrenSelector: children. widget update: children. children := #(). ]. self buildAll: children in: widget. self buildHelpFor: widget spec: aSpec. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. self setLayout: aSpec layout in: widget. widget layoutInset: 0. widget borderWidth: 0. widget submorphsDo:[:sm| (frame := sm layoutFrame) ifNotNil:[ (frame rightFraction = 0 or:[frame rightFraction = 1]) ifFalse:[frame rightOffset:1]. (frame bottomFraction = 0 or:[frame bottomFraction = 1]) ifFalse:[frame bottomOffset: 1]]]. widget color: Color transparent. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableText: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggableText: (in category 'pluggable widgets') ----- buildPluggableText: aSpec | widget | widget := self textPaneClass on: aSpec model text: aSpec getText accept: aSpec setText readSelection: aSpec selection menu: aSpec menu. widget editTextSelector: aSpec editText. widget askBeforeDiscardingEdits: aSpec askBeforeDiscardingEdits. widget font: Preferences standardCodeFont. self register: widget id: aSpec name. widget getColorSelector: aSpec color. self buildHelpFor: widget spec: aSpec. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. widget borderColor: Color lightGray. widget color: Color white. ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableTree: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggableTree: (in category 'pluggable widgets') ----- buildPluggableTree: aSpec | widget | widget := self treeClass new. self register: widget id: aSpec name. widget model: aSpec model. widget getSelectedPathSelector: aSpec getSelectedPath. widget setSelectedSelector: aSpec setSelected. widget getSelectedSelector: aSpec getSelected. widget setSelectedParentSelector: aSpec setSelectedParent. widget getChildrenSelector: aSpec getChildren. widget hasChildrenSelector: aSpec hasChildren. widget getLabelSelector: aSpec label. widget getIconSelector: aSpec icon. widget getHelpSelector: aSpec help. widget getMenuSelector: aSpec menu. widget keystrokeActionSelector: aSpec keyPress. widget nodeClass: aSpec nodeClass. widget getRootsSelector: aSpec roots. widget autoDeselect: aSpec autoDeselect. widget dropItemSelector: aSpec dropItem. widget wantsDropSelector: aSpec dropAccept. widget dragItemSelector: aSpec dragItem. widget columns: aSpec columns. self setFrame: aSpec frame in: widget. parent ifNotNil:[self add: widget to: parent]. " panes ifNotNil:[ aSpec roots ifNotNil:[panes add: aSpec roots]. ]. " ^widget! Item was changed: + ----- Method: MorphicToolBuilder>>buildPluggableWindow: (in category 'widgets required') ----- - ----- Method: MorphicToolBuilder>>buildPluggableWindow: (in category 'pluggable widgets') ----- buildPluggableWindow: aSpec | widget children | aSpec layout == #proportional ifFalse:[ "This needs to be implemented - probably by adding a single pane and then the rest" ^self error: 'Not implemented'. ]. widget := (self windowClassFor: aSpec) new. self register: widget id: aSpec name. widget model: aSpec model. aSpec label ifNotNil: [:label| label isSymbol ifTrue:[widget getLabelSelector: label] ifFalse:[widget setLabel: label]]. aSpec multiWindowStyle notNil ifTrue: [widget savedMultiWindowState: (SavedMultiWindowState on: aSpec model)]. children := aSpec children. children isSymbol ifTrue:[ widget getChildrenSelector: children. widget update: children. children := #(). ]. widget closeWindowSelector: aSpec closeAction. panes := OrderedCollection new. self buildAll: children in: widget. self buildHelpFor: widget spec: aSpec. widget bounds: (RealEstateAgent initialFrameFor: widget initialExtent: (aSpec extent ifNil:[widget initialExtent]) world: self currentWorld). widget setUpdatablePanesFrom: panes. ^widget! |
Free forum by Nabble | Edit this page |