Marcel Taeumel uploaded a new version of ToolBuilder-MVC to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-MVC-mt.41.mcz ==================== Summary ==================== Name: ToolBuilder-MVC-mt.41 Author: mt Time: 12 April 2015, 9:12:29.901 pm UUID: 7e3ddec1-1470-dd41-8840-93ac896551dc Ancestors: ToolBuilder-MVC-mt.40 Fixes regarding pluggable menus and opening tools. =============== Diff against ToolBuilder-MVC-mt.40 =============== Item was changed: ToolBuilder subclass: #MVCToolBuilder + instanceVariableNames: 'panes topSize widgets parentMenu' - instanceVariableNames: 'panes topSize widgets' classVariableNames: '' poolDictionaries: '' category: 'ToolBuilder-MVC'! !MVCToolBuilder commentStamp: 'ar 2/11/2005 15:02' prior: 0! The MVC tool builder.! Item was added: + ----- Method: MVCToolBuilder>>buildPluggableMenu: (in category 'widgets required') ----- + buildPluggableMenu: menuSpec + "Just a very simple mapping to selection menu. It assumes that all item specs have the same receiver." + + | menu | + menu := CustomMenu new. + menuSpec items do: [:ea | + menu + add: ea label + target: ea action receiver + selector: ea action selector + argumentList: ea action arguments. + ea separator ifTrue: [menu addLine]]. + ^ menu! Item was added: + ----- Method: MVCToolBuilder>>buildPluggableMenuItem: (in category 'widgets required') ----- + buildPluggableMenuItem: itemSpec + + ^ itemSpec label! Item was changed: ----- Method: MVCToolBuilder>>buildPluggablePanel: (in category 'widgets required') ----- buildPluggablePanel: aSpec | widget children | widget := View new model: aSpec model. + widget borderWidth: 1. self register: widget id: aSpec name. children := aSpec children. children isSymbol ifTrue:[ "@@@@ FIXME: PluggablePanes need to remember their getChildrenSelector" "widget getChildrenSelector: children. widget update: children." children := #(). ]. self setFrame: aSpec frame in: widget. self buildAll: children in: widget. parent ifNotNil:[parent addSubView: widget]. self setLayout: aSpec layout in: widget. ^widget! Item was changed: ----- Method: MVCToolBuilder>>open: (in category 'opening') ----- open: anObject "Build and open the object. Answer the widget opened." | window | + window := (anObject isKindOf: View) + ifTrue: [anObject] + ifFalse: [self build: anObject]. + (window isKindOf: PopUpMenu) + ifTrue: [window invokeOn: nil]. + (window isKindOf: View) + ifTrue: [window controller open]. - window := self build: anObject. - window controller open. ^window! Item was changed: ----- Method: MVCToolBuilder>>runModal: (in category 'opening') ----- runModal: aWidget "Run the (previously opened) widget modally, e.g., do not return control to the sender before the user has responded." + ! - self error: 'Please implement me'.! |
Free forum by Nabble | Edit this page |