Reviving Pharo Morphic View

I repost, the updated core package for Pharo Morphic View. From the early Feb 2012 now refactored a bit for Pharo 3.0

http://www.squeaksource.com/PharoGoodies/PharoMorphicView-Core-App-Skrish.11.mcz

Simple framework primarily hooked on with 3 classes and some minimal support classes. ( Most support classes are add ons for more complex capabilities )

To get started:

Browse to:  AbstractSimpleImplicitMorphicView  >> #test .

Run this in workspace:

| aView  informDialogBlock |
aView := AbstractSimpleImplicitMorphicView new windowTitle: ‘Test Morphic View’ ;  windowType: #Dialog . “Try also:  #Window and #Morph”

   “Map widgetName to its morphClass”
aView createMorphsSpecs: {
‘label1’ -> #LabelMorph.
‘text1’ -> #PluggableTextMorph.
‘button1’ -> #PluggableButtonMorph.
}.

informDialogBlock := [ UIManager default inform: ‘Welcome to MorphicView Framework’ ].

“Map widgetName to creation method for model / handler etc..”
aView morphsPrimaryPropertiesSpecs: {
‘button1’ -> ( #on:getState:action:label:menu: -> { informDialogBlock . nil . #value . nil. nil } ).
}.

“Map widgetName to other properties / method to arguments”
aView morphsSecondaryPropertiesSpecs: {
‘label1’ -> { #contents: -> { ‘Have Fun With Morphs:’ }. #vResizing: -> { #rigid }. #extent: -> { 400@30}.   }.
‘button1’ -> { #hResizing: -> { #rigid }. #vResizing: -> { #rigid }. #extent: -> { 400@30}.  #label: -> { ‘Button B’ } }.
‘text1’ -> {  #setText: -> {  ‘\\    Write out a short essay below:..! ‘ withCRs } }.
}.
aView open.

*********************

Now browse through the Tests / Examples for Specs based construction with subclassing either:

* AbstractMorphicView( abstract class for view composition. )

OR

* AbstractSimpleMorphicView  ( simplified api  to provide for TableLayout aka a flow layout…)

implement the above message calls as unary methods in the subclass, with the argument from above as the return values..

#createMorphsSpecs          #morphsPrimaryPropertiesSpec            #morphsSecondaryPropertiesSpec

There are additional API/ initialize routines to leverage in the subclassed construction to make it lot more flexible and scalable.

Potentially there is no limits in components based construction of the UI, with all smaller UIs composing any nth level of complex UI

 

Lot more details are available with pdf / other information posted in early 2012 when this was developed and remained in hibernation.

A full scale MVC mode application can be developed with this framework. The advanced part is to follow through with refactoring for Pharo 3.0 due..

 

PS: Tests works fine except for LanguageTranslator.. which needs a minor refactoring, I will work through on shortly.

Will rethink on the framework though a fresh pair of eyes to make it easier, capable, scalable and easily debuggable as well as make it amenable for a simple drag n drop UI builder. The other target is if we can do a web app UI construction with the same spec..? Seems unlikely in short time but need to think.

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: