[Pharo-project] Polymorph - TabIndex and layoutFrames questions
1- How i can change the #position or #extent of a Morph with a layoutFrame setted ? for example, i have a button "anchored" to top and right; if i set the #position: of that button the position don´t change. Then i try override the #position: accessor of my button; first set #layoutframe: to nil, later do the set normally of #position: and later set again the old value of #layoutFrame: , for remain the original anchors. But don´t works. Well, if I execute the code in a WorkSpace, line to line, then works! but don´t if execute all code. I don´t understand :| 2- How works the tab index mechanism in Polymorph? in some of my Views i have controls with unordered tab order in controls. How i can change the order? I don´t see nothing for start. 3- Exists the possibility of change the position of cursor of a textbox? Regards, and thanks for the help -- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
BTW I was thinking about your work (I still have to play with it). IN MC UI they build the UI useing spec look at buildWindow buildWindow | window | window := SystemWindow labelled: self label. window model: self. self widgetSpecs do: [:spec | | send fractions offsets | send := spec first. fractions := spec at: 2 ifAbsent: [#(0 0 1 1)]. offsets := spec at: 3 ifAbsent: [#(0 0 0 0)]. window addMorph: (self perform: send first withArguments: send allButFirst) fullFrame: (LayoutFrame fractions: ((fractions first)@(fractions second) corner: (fractions third)@(fractions fourth)) offsets: ((offsets first)@(offsets second) corner: (offsets third)@(offsets fourth)))]. ^ window buttonSpecs ^ #((Invert invert 'Show the reverse set of changes') (Export export 'Export the changes as a change set')) widgetSpecs ^ { #((listMorph:selection:menu:keystroke: list selection methodListMenu: methodListKey:from:) (0 0 1 0.4) (0 0 0 0)). { #(textMorph: annotations). #(0 0.4 1 0.4). { 0. 0. 0. self defaultAnnotationPaneHeight. } }. { #(textMorph: text). #(0 0.4 1 1). { 0. self defaultAnnotationPaneHeight. 0. 0. } }. } this is minimal and not optimal but this is nice to have an array of literal to describe a UI Stef On Sep 13, 2009, at 10:48 PM, nullPointer wrote:
1- How i can change the #position or #extent of a Morph with a layoutFrame setted ?
for example, i have a button "anchored" to top and right; if i set the #position: of that button the position don´t change. Then i try override the #position: accessor of my button; first set #layoutframe: to nil, later do the set normally of #position: and later set again the old value of #layoutFrame: , for remain the original anchors. But don´t works. Well, if I execute the code in a WorkSpace, line to line, then works! but don´t if execute all code. I don´t understand :|
2- How works the tab index mechanism in Polymorph?
in some of my Views i have controls with unordered tab order in controls. How i can change the order? I don´t see nothing for start.
3- Exists the possibility of change the position of cursor of a textbox?
Regards, and thanks for the help
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I don´t know how do that. Seems very complicated for me. I did think in each widgets implements a method where return his state. The code will be more readable ( i believe ) and seems more easy of implement ( i believe too ) regards 2009/9/14 Stéphane Ducasse-2 (via Nabble) < ml-user+179910-225159042@n2.nabble.com<ml-user%2B179910-225159042@n2.nabble.com>
BTW I was thinking about your work (I still have to play with it).
IN MC UI they build the UI useing spec look at buildWindow buildWindow | window | window := SystemWindow labelled: self label. window model: self. self widgetSpecs do: [:spec | | send fractions offsets | send := spec first. fractions := spec at: 2 ifAbsent: [#(0 0 1 1)]. offsets := spec at: 3 ifAbsent: [#(0 0 0 0)]. window addMorph: (self perform: send first withArguments: send allButFirst) fullFrame: (LayoutFrame fractions: ((fractions first)@(fractions second) corner: (fractions third)@(fractions fourth)) offsets: ((offsets first)@(offsets second) corner: (offsets third)@(offsets fourth)))]. ^ window
buttonSpecs ^ #((Invert invert 'Show the reverse set of changes') (Export export 'Export the changes as a change set')) widgetSpecs ^ { #((listMorph:selection:menu:keystroke: list selection methodListMenu: methodListKey:from:) (0 0 1 0.4) (0 0 0 0)). { #(textMorph: annotations). #(0 0.4 1 0.4). { 0. 0. 0. self defaultAnnotationPaneHeight. } }. { #(textMorph: text). #(0 0.4 1 1). { 0. self defaultAnnotationPaneHeight. 0. 0. } }. }
this is minimal and not optimal but this is nice to have an array of literal to describe a UI
Stef
On Sep 13, 2009, at 10:48 PM, nullPointer wrote:
1- How i can change the #position or #extent of a Morph with a layoutFrame setted ?
for example, i have a button "anchored" to top and right; if i set the #position: of that button the position don´t change. Then i try override the #position: accessor of my button; first set #layoutframe: to nil, later do the set normally of #position: and later set again the old value of #layoutFrame: , for remain the original anchors. But don´t works. Well, if I execute the code in a WorkSpace, line to line, then works! but don´t if execute all code. I don´t understand :|
2- How works the tab index mechanism in Polymorph?
in some of my Views i have controls with unordered tab order in controls. How i can change the order? I don´t see nothing for start.
3- Exists the possibility of change the position of cursor of a textbox?
Regards, and thanks for the help
-- View this message in context:
http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041...
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3640028&i=0> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3640028&i=1> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------ View message @ http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... To unsubscribe from Polymorph - TabIndex and layoutFrames questions, click here< (link removed) >.
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
I gave you the code in the mail ;) Nothing more or very little is required more than that. Stef On Sep 14, 2009, at 9:38 AM, nullPointer wrote:
I donôt know how do that. Seems very complicated for me.
I did think in each widgets implements a method where return his state. The code will be more readable ( i believe ) and seems more easy of implement ( i believe too )
regards
2009/9/14 Stéphane Ducasse-2 (via Nabble) <[hidden email]> BTW I was thinking about your work (I still have to play with it).
IN MC UI they build the UI useing spec look at buildWindow buildWindow à à à à | window | à à à à window := SystemWindow labelled: self label. à à à à window model: self. à à à à self widgetSpecs do: [:spec | à à à à à à à à | send fractions offsets | à à à à à à à à send := spec first. à à à à à à à à fractions := spec at: 2 ifAbsent: [#(0 0 1 1)]. à à à à à à à à offsets := spec at: 3 ifAbsent: [#(0 0 0 0)]. à à à à à à à à window à à à à à à à à à à à à addMorph: (self perform: send first withArguments: send allButFirst) à à à à à à à à à à à à fullFrame: à à à à à à à à à à à à à à à à (LayoutFrame à à à à à à à à à à à à à à à à à à à à fractions: à à à à à à à à à à à à à à à à à à à à à à à à ((fractions first)@(fractions second) corner: à à à à à à à à à à à à à à à à à à à à à à à à à à à à (fractions third)@(fractions fourth)) à à à à à à à à à à à à à à à à à à à à offsets: à à à à à à à à à à à à à à à à à à à à à à à à ((offsets first)@(offsets second) à corner: à à à à à à à à à à à à à à à à à à à à à à à à à à à à (offsets third)@(offsets fourth)))]. à à à à ^ window
buttonSpecs à à à à ^ #((Invert invert 'Show the reverse set of changes') à à à à à à à à à (Export export 'Export the changes as a change set')) widgetSpecs à à à à ^ { à à à à à à à à #((listMorph:selection:menu:keystroke: list selection à methodListMenu: methodListKey:from:) (0 0 1 0.4) (0 0 0 0)). à à à à à à à à { #(textMorph: annotations). #(0 0.4 1 0.4). { 0. 0. 0. self à defaultAnnotationPaneHeight. } }. à à à à à à à à { #(textMorph: text). #(0 0.4 1 1). { 0. self à defaultAnnotationPaneHeight. 0. 0. } }. à à à à à à à à }
this is minimal and not optimal but this is nice to have an array of à literal to describe a UI
Stef
On Sep 13, 2009, at 10:48 PM, nullPointer wrote:
1- How i can change the #position or #extent of a Morph with a à layoutFrame setted ?
for example, i have a button "anchored" to top and right; if i set
the
#position: of that button the position donôt change. Then i try à override the #position: accessor of my button; first set #layoutframe: to nil, à later do the set normally of #position: à and later set again the old value of #layoutFrame: , for remain the original anchors. But donôt works. à Well, if I execute the code in a WorkSpace, line to line, then works! but donà ´t à if execute all code. I donôt understand :|
2- How works the tab index mechanism in Polymorph?
in some of my Views i have controls with unordered tab order in à controls. How i can change the order? I donôt see nothing for start.
3- Exists the possibility of change the position of cursor of a à textbox?
Regards, and thanks for the help
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com. _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.) 2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow. Regards, Gary ----- Original Message ----- From: "nullPointer" <epicfan@gmail.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1- How i can change the #position or #extent of a Morph with a layoutFrame setted ?
for example, i have a button "anchored" to top and right; if i set the #position: of that button the position don´t change. Then i try override the #position: accessor of my button; first set #layoutframe: to nil, later do the set normally of #position: and later set again the old value of #layoutFrame: , for remain the original anchors. But don´t works. Well, if I execute the code in a WorkSpace, line to line, then works! but don´t if execute all code. I don´t understand :|
2- How works the tab index mechanism in Polymorph?
in some of my Views i have controls with unordered tab order in controls. How i can change the order? I don´t see nothing for start.
3- Exists the possibility of change the position of cursor of a textbox?
Regards, and thanks for the help
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner? 2. Then i understand than changing the order of submorphs that works? I will probe. Regards and many thanks. 2009/9/14 Gary Chambers (via Nabble) < ml-user+180091-2119438362@n2.nabble.com<ml-user%2B180091-2119438362@n2.nabble.com>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the
fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=0>>
To: <[hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=1>>
Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1- How i can change the #position or #extent of a Morph with a
layoutFrame
setted ?
for example, i have a button "anchored" to top and right; if i set the #position: of that button the position don´t change. Then i try override the #position: accessor of my button; first set #layoutframe: to nil, later do the set normally of #position: and later set again the old value of #layoutFrame: , for remain the original anchors. But don´t works. Well, if I execute the code in a WorkSpace, line to line, then works! but don´t if execute all code. I don´t understand :|
2- How works the tab index mechanism in Polymorph?
in some of my Views i have controls with unordered tab order in controls.
How i can change the order? I don´t see nothing for start.
3- Exists the possibility of change the position of cursor of a textbox?
Regards, and thanks for the help
-- View this message in context:
http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041...
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=2> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=3> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------ View message @ http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... To unsubscribe from Polymorph - TabIndex and layoutFrames questions, click here< (link removed) >.
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
1. "Fixed" positioning can be achived by setting the fractions to 0@0 for top-left and bottom-right then using the offsets. Regards, Gary ----- Original Message ----- From: nullPointer To: pharo-project@lists.gforge.inria.fr Sent: Monday, September 14, 2009 12:03 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions 1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner? 2. Then i understand than changing the order of submorphs that works? I will probe. Regards and many thanks. 2009/9/14 Gary Chambers (via Nabble) <[hidden email]> 1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.) 2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow. Regards, Gary ----- Original Message ----- From: "nullPointer" <[hidden email]> To: <[hidden email]> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions > > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project ------------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
i´m already using fractions and offsets, through my class CLDecorMorph... http://paste.lisp.org/display/87049 (Note: in that class properties as #position or #top, #left etc be relatives to owner) I´m use the owner always with ProportionalLayout and the "anchors" with the fractions-offsets mechanism. The problem is when I try set the #position: or #extent: accessors. Don´t works. Gary Chambers wrote:
1. "Fixed" positioning can be achived by setting the fractions to 0@0 for top-left and bottom-right then using the offsets.
Regards, Gary
----- Original Message ----- From: nullPointer To: pharo-project@lists.gforge.inria.fr Sent: Monday, September 14, 2009 12:03 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner?
2. Then i understand than changing the order of submorphs that works? I will probe.
Regards and many thanks.
2009/9/14 Gary Chambers (via Nabble) <[hidden email]>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email]> To: <[hidden email]> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
> > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
since I cannot give you feedback on the morphic internal I will give you some smalltalk ones anchorToLeft: toLeft toRight: toRight toTop: toTop toBottom: toBottom morph owner notNil ifTrue: [| fractionsRectangle offsetsRectangle owner | owner := morph owner. anchoredToLeft := toLeft. anchoredToRight := toRight. anchoredToTop := toTop. anchoredToBottom := toBottom. ((anchoredToLeft not) and: [anchoredToRight not] and:[anchoredToBottom not] and:[anchoredToTop not ]) ifTrue: [owner addMorph: morph fullFrame: nil.] ifFalse: [ fractionsRectangle := self pvtBuildFractionsRectangle. offsetsRectangle := self pvtBuildOffsetsRectangle: fractionsRectangle. owner addMorph: morph fullFrame: (LayoutFrame fractions: fractionsRectangle offsets: offsetsRectangle)]]. looks more smalltalkish to me BTW for the ((anchoredToLeft not) and: [anchoredToRight not] and:[anchoredToBottom not] and:[anchoredToTop not ]) it may be more efficient to use &&
Bufff, I hate that "format". Kill me :) I don´t see the message #&& . I have image Pharo dev 10418 BETA. && works as #and: ? is a lazy comparison? Regards 2009/9/14 Stéphane Ducasse-2 (via Nabble) < ml-user+179910-225159042@n2.nabble.com<ml-user%2B179910-225159042@n2.nabble.com>
since I cannot give you feedback on the morphic internal I will give you some smalltalk ones
anchorToLeft: toLeft toRight: toRight toTop: toTop toBottom: toBottom
morph owner notNil ifTrue: [| fractionsRectangle offsetsRectangle owner | owner := morph owner. anchoredToLeft := toLeft. anchoredToRight := toRight. anchoredToTop := toTop. anchoredToBottom := toBottom. ((anchoredToLeft not) and: [anchoredToRight not] and:[anchoredToBottom not] and:[anchoredToTop not ]) ifTrue: [owner addMorph: morph fullFrame: nil.] ifFalse: [ fractionsRectangle := self pvtBuildFractionsRectangle. offsetsRectangle := self pvtBuildOffsetsRectangle:
fractionsRectangle. owner addMorph: morph fullFrame: (LayoutFrame fractions: fractionsRectangle offsets: offsetsRectangle)]].
looks more smalltalkish to me BTW for the ((anchoredToLeft not) and: [anchoredToRight not] and:[anchoredToBottom not] and:[anchoredToTop not ]) it may be more efficient to use &&
_______________________________________________ Pharo-project mailing list [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3642989&i=0> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------ View message @ http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... To unsubscribe from Re: Polymorph - TabIndex and layoutFrames questions, click here< (link removed) >.
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
nullPointer skrev:
I don´t see the message #&& . I have image Pharo dev 10418 BETA.
&& works as #and: ? is a lazy comparison?
Regards
I think Steph meant &, which does not compare lazily (but these are boolean values already so not exactly alot of computation overhead, and no subtle sideeffects...). Alternatively you could use or: or: or: / | | |, drop the not's, and switch the ifTrue:ifFalse: blocks. That way, the "interesting" case comes on top too :). Personally, I'd also use ifNotNil:, and temps moved to their enclosing scope in this method, but as you say, preferences differ. :) Cheers, Henry
#position: and #extent: etc. won't work since the owner is laying out as per the layout frame. You'll need to adjust the offsets instead... Regards, Gary ----- Original Message ----- From: "nullPointer" <epicfan@gmail.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Monday, September 14, 2009 3:37 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
i´m already using fractions and offsets, through my class CLDecorMorph... http://paste.lisp.org/display/87049
(Note: in that class properties as #position or #top, #left etc be relatives to owner)
I´m use the owner always with ProportionalLayout and the "anchors" with the fractions-offsets mechanism. The problem is when I try set the #position: or #extent: accessors. Don´t works.
Gary Chambers wrote:
1. "Fixed" positioning can be achived by setting the fractions to 0@0 for top-left and bottom-right then using the offsets.
Regards, Gary
----- Original Message ----- From: nullPointer To: pharo-project@lists.gforge.inria.fr Sent: Monday, September 14, 2009 12:03 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner?
2. Then i understand than changing the order of submorphs that works? I will probe.
Regards and many thanks.
2009/9/14 Gary Chambers (via Nabble) <[hidden email]>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email]> To: <[hidden email]> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
> > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I´m surely have a lack of knowledge. Can you orient to me a place where that problem is explained (a web page or resource)? Very thanks for the help. Gary Chambers wrote:
#position: and #extent: etc. won't work since the owner is laying out as per the layout frame. You'll need to adjust the offsets instead...
Regards, Gary
----- Original Message ----- From: "nullPointer" <epicfan@gmail.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Monday, September 14, 2009 3:37 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
i´m already using fractions and offsets, through my class CLDecorMorph... http://paste.lisp.org/display/87049
(Note: in that class properties as #position or #top, #left etc be relatives to owner)
I´m use the owner always with ProportionalLayout and the "anchors" with the fractions-offsets mechanism. The problem is when I try set the #position: or #extent: accessors. Don´t works.
Gary Chambers wrote:
1. "Fixed" positioning can be achived by setting the fractions to 0@0 for top-left and bottom-right then using the offsets.
Regards, Gary
----- Original Message ----- From: nullPointer To: pharo-project@lists.gforge.inria.fr Sent: Monday, September 14, 2009 12:03 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner?
2. Then i understand than changing the order of submorphs that works? I will probe.
Regards and many thanks.
2009/9/14 Gary Chambers (via Nabble) <[hidden email]>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email]> To: <[hidden email]> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
> > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
It is not a problem, as such. Just the wau layouts work. There used to be a good description on Bob's Super Swiki, though that seems to have vanished. Try here http://www.visoracle.com/squeak/faq/morphic_.html instead. Regards, Gary ----- Original Message ----- From: "nullPointer" <epicfan@gmail.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Monday, September 14, 2009 10:23 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
I´m surely have a lack of knowledge. Can you orient to me a place where that problem is explained (a web page or resource)?
Very thanks for the help.
Gary Chambers wrote:
#position: and #extent: etc. won't work since the owner is laying out as per the layout frame. You'll need to adjust the offsets instead...
Regards, Gary
----- Original Message ----- From: "nullPointer" <epicfan@gmail.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Monday, September 14, 2009 3:37 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
i´m already using fractions and offsets, through my class CLDecorMorph... http://paste.lisp.org/display/87049
(Note: in that class properties as #position or #top, #left etc be relatives to owner)
I´m use the owner always with ProportionalLayout and the "anchors" with the fractions-offsets mechanism. The problem is when I try set the #position: or #extent: accessors. Don´t works.
Gary Chambers wrote:
1. "Fixed" positioning can be achived by setting the fractions to 0@0 for top-left and bottom-right then using the offsets.
Regards, Gary
----- Original Message ----- From: nullPointer To: pharo-project@lists.gforge.inria.fr Sent: Monday, September 14, 2009 12:03 PM Subject: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner?
2. Then i understand than changing the order of submorphs that works? I will probe.
Regards and many thanks.
2009/9/14 Gary Chambers (via Nabble) <[hidden email]>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email]> To: <[hidden email]> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
> > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- View this message in context: http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
1. Here's the (I believe) equivalent LayoutFrames settings: #anchorRight - rightFraction: 1 rightOffset: -pixelsToRight #anchorBottom - bottomFraction: 1 bottomOffset: -pixelsToBottom #anchorLeft - leftFraction: 0 leftOfffset: pixelsToLeft #anchorTop - topFraction: 0 topOffset: pixelsToTop The problem with having just those four options is they don't work well with resizing when you have more than one widget (try placing two side by side and locking left + right)... In those cases you usually want a fraction somewhere between 0/1 for at least one of the edges, and adjust those a couple of pixels to make a constant size border between morphs, like this: Morph1 - leftFraction: 0 leftOffset: 5 rightFraction: 0.5 rightOffset: -2 Morph2 - leftFraction: 0.5 leftOffset: 2 rightFraction: 1 rightOffset: -5 2. Yes, I believe so. Note, this might also modifiy their rendering order (I haven't checked though), which could be important if you have partially overlapping morphs Cheers, Henry nullPointer skrev:
1. I have always work with owners in ProportionalLayout, don´t let work with another layoutPolicy in the canvas designer. In view designer exists the possibility of "anchor" a widget to top, left, down and right. That is all need the user ( for the moment ) for anchor a widget, but fails to change size and position.Exists the possibility of do it in ProportionalLayout on owner?
2. Then i understand than changing the order of submorphs that works? I will probe.
Regards and many thanks.
2009/9/14 Gary Chambers (via Nabble) <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641368&i=0>>
1. position/extent depends on how thae morph is laid out in its owner. LayoutFrame is used when the owner specified a proportional layout, use the fractions to pin corners and the offsets to.. offset. If the owner specifies no layout then postion/extent work as expected. For table layouts things are more complicated (see hResizing/vResizing etc.)
2. Tab order (keyboard navigation) follows the order of the submorphs at present. Add your morphs (using addMorphback: or via the Polymorph row/column type stuff) in the order you want navigation to follow.
Regards, Gary
----- Original Message ----- From: "nullPointer" <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=0>> To: <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=1>> Sent: Sunday, September 13, 2009 9:48 PM Subject: [Pharo-project] Polymorph - TabIndex and layoutFrames questions
> > > 1- How i can change the #position or #extent of a Morph with a layoutFrame > setted ? > > for example, i have a button "anchored" to top and right; if i set the > #position: of that button the position don´t change. Then i try override > the > #position: accessor of my button; first set #layoutframe: to nil, later do > the set normally of #position: and later set again the old value of > #layoutFrame: , for remain the original anchors. But don´t works. Well, if > I > execute the code in a WorkSpace, line to line, then works! but don´t if > execute all code. I don´t understand :| > > > 2- How works the tab index mechanism in Polymorph? > > in some of my Views i have controls with unordered tab order in controls. > How i can change the order? I don´t see nothing for start. > > 3- Exists the possibility of change the position of cursor of a textbox? > > > Regards, and thanks for the help > > -- > View this message in context: > http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041... > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > _______________________________________________ > Pharo-project mailing list > [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=2> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3641268&i=3> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
------------------------------------------------------------------------ View this message in context: Re: [Pharo-project] Polymorph - TabIndex and layoutFrames questions <http://n2.nabble.com/Polymorph-TabIndex-and-layoutFrames-questions-tp3638041...> Sent from the Pharo Smalltalk mailing list archive <http://n2.nabble.com/Pharo-Smalltalk-f2305563.html> at Nabble.com. ------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (4)
-
Gary Chambers -
Henrik Johansen -
nullPointer -
Stéphane Ducasse