Regarding Polymorph

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

Re: Regarding Polymorph

Gary Chambers-4
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)].
  ^self].
 "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].
  ^self].
 "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...
 
gradientLook
 "Defer to preferences."
 
 ^Preferences gradientButtonLook
 
 
and to PasteUpMorph
 
defaultYellowButtonMenuEnabled
 "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 -----
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 






Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Gary Chambers-4
Honestly is was five minutes for me ;-).
I can make the end-result image/changes available if required.

Regards, Gary
----- Original Message -----
Sent: Saturday, March 13, 2010 6:10 PM
Subject: Re: [squeak-dev] Re: Regarding Polymorph

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)].
  ^self].
 "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].
  ^self].
 "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...
 
gradientLook
 "Defer to preferences."
 
 ^Preferences gradientButtonLook
 
 
and to PasteUpMorph
 
defaultYellowButtonMenuEnabled
 "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 -----
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 








Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Chris Cunnington
In reply to this post by Casey Ransberger
I think I need a drink...

Thank you, Gary. That was a really great exercise. A little Talmudic, as John Markoff (What The Dormouse Said), might say, but an excellent exercise. I now have a green, mauled-font (as you pointed out) version of Polymorph in my Trunk. Very cool. There were one or two things I didn't get from your instructions, such as how to flip chooseRemote from true to false using a Halo, but I plan to do this exercise again. Maybe I could change MCConflict>#chooseRemote to false, before I start.

Here's a pic: 


I deleted the toolbar to avoid a crash. 

Chris 


Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Gary Chambers-4
Yep, looks about right...
Seems the SoftSqueak theme insists on bolding the title font through the
(old) expected mechanisms... having a bold font to start with (that
doesn't work with the scheme in terms of emp0hasis) does double up with
the boldness, to horrible effect ;-)


On the merge section... use halos to inspect the model for the (orginal
Monticello,, quaint) merge browser that bolds the #disabled... conflict.
Inspect down to the conflict itself and save "false" for the
chooseRemote instance variable.

I agree that it is not entirely pretty (c.f. changes in trunk) but not
too crashy!

Good luck in endeavours, I am happy to to help...

Regards, Gary

On Sat, 2010-03-13 at 15:45 -0500, Chris Cunnington wrote:

> I think I need a drink...
>
>
> Thank you, Gary. That was a really great exercise. A little Talmudic,
> as John Markoff (What The Dormouse Said), might say, but an excellent
> exercise. I now have a green, mauled-font (as you pointed out) version
> of Polymorph in my Trunk. Very cool. There were one or two things I
> didn't get from your instructions, such as how to flip chooseRemote
> from true to false using a Halo, but I plan to do this exercise again.
> Maybe I could change MCConflict>#chooseRemote to false, before I
> start.
>
>
> Here's a pic:
>
>
> http://www.sushistoreobject.com/polymorph.pdf 
>
>
> I deleted the toolbar to avoid a crash.
>
>
> Chris



Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Casey Ransberger
In reply to this post by Chris Cunnington
Somewhere in my big pile of images, I have a fix for the
double-bolding thing. I'll try to find it as soon as I have time.

On Sat, Mar 13, 2010 at 12:45 PM, Chris Cunnington
<[hidden email]> wrote:

> I think I need a drink...
> Thank you, Gary. That was a really great exercise. A little Talmudic, as
> John Markoff (What The Dormouse Said), might say, but an excellent exercise.
> I now have a green, mauled-font (as you pointed out) version of Polymorph in
> my Trunk. Very cool. There were one or two things I didn't get from your
> instructions, such as how to flip chooseRemote from true to false using a
> Halo, but I plan to do this exercise again. Maybe I could change
> MCConflict>#chooseRemote to false, before I start.
> Here's a pic:
> http://www.sushistoreobject.com/polymorph.pdf
> I deleted the toolbar to avoid a crash.
> Chris
>
>
>



--
Casey Ransberger

Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Chris Cunnington
In reply to this post by Casey Ransberger
CR: 
"Somewhere in my big pile of images, I have a fix for the
double-bolding thing. I'll try to find it as soon as I have time."

That'd be great. As far as I can tell that's the last missing piece. The red corner grips I fixed, as they were in Gary's instructions, but I'd glossed over them in the first pass.
Chris 


Reply | Threaded
Open this post in threaded view
|

Re: Regarding Polymorph

Andreas.Raab
In reply to this post by Gary Chambers-4
On 3/13/2010 10:10 AM, Gary Chambers wrote:
> 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...

Oops sorry for that. I broke it when making traits reloadable. It's
fixed now which means you should be able to load these packages without
manual interference.

Cheers,
   - Andreas

> 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)].
> ^self].
> "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].
> ^self].
> "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...
> gradientLook
> "Defer to preferences."
> ^Preferences gradientButtonLook
> and to PasteUpMorph
> defaultYellowButtonMenuEnabled
> "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 <mailto:[hidden email]>
>     *To:* [hidden email]
>     <mailto:[hidden email]>
>     *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
>
>
>
>     ------------------------------------------------------------------------
>
>
>
>
>


12