[squeak-dev] Re: Regarding Polymorph

Gary Chambers gazzaguru2 at btinternet.com
Sat Mar 13 18:10:13 UTC 2010

OK. There are problems with MC with the way Traits are handled between... that's the worst part. in a bit.

It seems the Traits handling in Monticello differs between the old (MC 1.0) and new...

Start from latest trunk image.

First off, due to an uninitialized variable, it seems...

In FormCanvas

setFillColor: aColor
 "Install a new color used for filling."
 | screen patternWord fillColor |
 fillColor := self shadowColor ifNil:[aColor].
 fillColor ifNil:[fillColor := Color transparent].
 fillColor isColor ifFalse:[
  (fillColor isKindOf: InfiniteForm) ifFalse:[^port fillPattern: Color red; combinationRule: Form over].
  ^port fillPattern: fillColor; combinationRule: Form over].
 "Okay, so fillColor really *is* a color"
 port sourceForm: nil.
 fillColor isTranslucent ifFalse:[
  port combinationRule: Form over.
  port fillPattern: fillColor.
  self depth = 8 ifTrue:[
   "In 8 bit depth it's usually a good idea to use a stipple pattern"
   port fillColor: (form balancedPatternFor: fillColor)].
 "fillColor is some translucent color"

 self depth > 8 ifTrue:[
  "BitBlt setup for alpha masked transfer"
  port fillPattern: fillColor.
  self depth = 16
   ifTrue:[port alphaBits: fillColor privateAlpha; combinationRule: 30]
   ifFalse:[port combinationRule: Form blend].
 "Can't represent actual transparency -- use stipple pattern"
 screen := Color translucentMaskFor: fillColor alpha depth: self depth.
 patternWord := form pixelWordFor: fillColor.
 port fillPattern: (screen collect: [:maskWord | maskWord bitAnd: patternWord]).
 port combinationRule: Form paint.

That will avoid an issue with the use of Forms for the window corner grips as in trunk...

Load Polymorph-Squeak-Widgets-gvc.3 from UIEnhancements on SqueakSource.

You should be able to pick from the Universe browser, in the User Interface category...
    Polymorph ToolBuilder version 1.4
    Polymorph Widgets version 1.5

Now, from the Universes browser, in the User Inteface category, select the package for Polymorph ToolBuilder version 14. (Polymorph Widgets version will be auto selected for install as a consequence).

You'll get some debuggers due to MC trait handling...

Each one, you will need to modifiy the instance variables on the MCClassDefinition for traitComposition and classTraitComposition to not be strings... (replace the single quotes with appropriate left and righ curly braces to turn into an array with the real trait)...
Restart the "createClass" method and proceed... repeat. I sometimes with I'd not used traits at all at this point...

Where you have the one with TEasilyThemed - {theme} replace with {TEasilyThemed}.

Once loaded (hopefullly) it will complain again for obselections... reverse the above procedure, replacing the curly brackets with single quotes again (don't ask why...).

OK, should be saveable now...

To fix up the corner grips you can remove #drawOn: methods from subclasses of CornerGripMorph then revert the change made to FormCanvas>>setFillColor:

A couple of precautions before the next step...

    Add the following method to PluggableButtonMorph...

 "Defer to preferences."

 ^Preferences gradientButtonLook

and to PasteUpMorph

 "Defer to preferences."

 ^Preferences generalizedYellowButtonMenu 

Those will be fixed in the Squeak adaptations soon...(backstops for Preferences/settings difference with Pharo).

To go to latest version of Polymorph from SqueakSource...

    Load Polymorph-Squeak-Widgets-gvc.3.
    Merge Polymorph-Widgets-gvc.110.

The (sadly dysfunctional) MC merge browser won't let you do anything.
Halo, inspect model...
    Find the one conflict after a few inspects... change/save the inst var chooseRemote to false
    in the inspector, bottom pane, do "self merge"...

Should be in a useable state from here, though a potential hang with using the main docking bar...
Everything else is down to fonts and trunk changes...

Good luck, eamil directly if there's any problems (expected as done from recent memory here...)

Aside,... this is just for reference, just for Polymorph as it is, as such. I'd hope that Squeak gets into a better state where none of this is needed for future other UI stuff.

Regards, Gary

  ----- Original Message ----- 
  From: Chris Cunnington 
  To: squeak-dev at lists.squeakfoundation.org 
  Sent: Saturday, March 13, 2010 5:20 PM
  Subject: [squeak-dev] Re: Regarding Polymorph

Gary Chambers said: "For what it is worth...I have been able to load Polymorph into trunk, not the easiest (mainly due 
to MC differences wrt Traits), takes
around 5 minutes of manual fixing while loading...

Once "in", clearly shows up the areas that have changed in trunk though...

(process instructions available if desired...)"I'd like to see that. If you're offering instructions to load into the Trunk, I'd like them, please. And if you might provide an example for when it's loaded, something like Ellipse new openInWorld, or some kind of first Polymorph widget to look at. That would be great. Chris 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100313/591bdaf0/attachment.htm

More information about the Squeak-dev mailing list