The Trunk: ToolBuilder-MVC-dtl.30.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-MVC-dtl.30.mcz

commits-2
David T. Lewis uploaded a new version of ToolBuilder-MVC to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-MVC-dtl.30.mcz

==================== Summary ====================

Name: ToolBuilder-MVC-dtl.30
Author: dtl
Time: 18 February 2013, 12:27:28.584 am
UUID: 499f21e0-6d8d-46ec-a501-04438715485f
Ancestors: ToolBuilder-MVC-ul.29

Make browsers work in MVC.

Arrange for subviews (e.g. a row of buttons in a browser) to be scaled properly and to be translated to the viewport of the containing view.

View coordinate systems are transformed relative to their containing views, not to the top level view, so change MVCToolBuilder>>asWindow: to scale relative to window of the containing view.

Change MVCToolbuilder>>buildPluggablePanel to call setFrame:in: prior to building subviews so that the view window is available to subviews for scaling subview windows.

In MVCToolBuilder>>setLayout:in adjust translation in the window transformation of subviews to position correctly in their viewports.

Caution - save image before testing, other problems await.

=============== Diff against ToolBuilder-MVC-ul.29 ===============

Item was changed:
  ----- Method: MVCToolBuilder>>asWindow: (in category 'private') -----
  asWindow: aRectangle
+
+ | outer |
+ outer := parent window ifNil: [topSize].
+ ^(aRectangle origin * outer extent) truncated
+ corner: (aRectangle corner * outer extent) truncated!
- ^(aRectangle origin * topSize extent) truncated
- corner: (aRectangle corner * topSize extent) truncated!

Item was changed:
  ----- Method: MVCToolBuilder>>buildPluggablePanel: (in category 'pluggable widgets') -----
  buildPluggablePanel: aSpec
  | widget children |
  widget := View new model: aSpec model.
  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 buildAll: children in: widget.
  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>>setLayout:in: (in category 'private') -----
  setLayout: layout in: widget
+
+ "translate subviews to position viewport"
+ widget subViews ifNotNilDo: [:subViews |
+ subViews isEmpty ifFalse: [ | translation |
+ translation := widget window origin - subViews first window origin.
+ subViews do: [:v |
+ v setTransformation: (v transformation translateBy: translation)]]].
+
  layout == #proportional ifTrue:[^self].
  layout == #horizontal ifTrue:[
  | prev |
  prev := nil.
  widget subViews do:[:next|
  prev ifNotNil:[
  next align: next viewport topLeft with: prev viewport topRight.
  ].
  prev := next.
  ].
  ^self].
  layout == #vertical ifTrue:[
  | prev |
  prev := nil.
  widget subViews do:[:next|
  prev ifNotNil:[
  next align: next viewport topLeft with: prev viewport bottomLeft.
  ].
  prev := next.
  ].
  ^self].
  ^self error: 'Unknown layout: ', layout.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: ToolBuilder-MVC-dtl.30.mcz

David T. Lewis
This update brings MVC partially back to life. There are plenty of issues
remaining. For example if you blank area on a browser where the "source"
button should appear, you will get a DNU on MVCToolBuilder>>buildPluggableMenu:.
There are quite a few issues like this to be addressed, but getting the
browsers to work at all is a good step.

The next big issue for MVC is to get the debugger working.

Dave

On Mon, Feb 18, 2013 at 05:31:20AM +0000, [hidden email] wrote:

> David T. Lewis uploaded a new version of ToolBuilder-MVC to project The Trunk:
> http://source.squeak.org/trunk/ToolBuilder-MVC-dtl.30.mcz
>
> ==================== Summary ====================
>
> Name: ToolBuilder-MVC-dtl.30
> Author: dtl
> Time: 18 February 2013, 12:27:28.584 am
> UUID: 499f21e0-6d8d-46ec-a501-04438715485f
> Ancestors: ToolBuilder-MVC-ul.29
>
> Make browsers work in MVC.
>
> Arrange for subviews (e.g. a row of buttons in a browser) to be scaled properly and to be translated to the viewport of the containing view.
>
> View coordinate systems are transformed relative to their containing views, not to the top level view, so change MVCToolBuilder>>asWindow: to scale relative to window of the containing view.
>
> Change MVCToolbuilder>>buildPluggablePanel to call setFrame:in: prior to building subviews so that the view window is available to subviews for scaling subview windows.
>
> In MVCToolBuilder>>setLayout:in adjust translation in the window transformation of subviews to position correctly in their viewports.
>
> Caution - save image before testing, other problems await.
>
> =============== Diff against ToolBuilder-MVC-ul.29 ===============
>