On 28 November 2013 11:01, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com>wrote:
Then maybe you should wait an answer from Igor...
heh, i can barely help with this infamous morphic layout mess. i only know that if you using proportional layout, then if you want submorphs to be laid down properly, you must use addMorph:fullFrame: instead of just addMorph: Morph>>addMorph: aMorph fullFrame: aLayoutFrame aMorph layoutFrame: aLayoutFrame asLayoutFrame. aMorph hResizing: #spaceFill; vResizing: #spaceFill. self addMorph: aMorph. (or, well, if you don't want your morph to be automagically stretched, try to set only frame (with #layoutFrame:) because the above, as you can see also sets hResizing & vResizing )
Ben
On 28 Nov 2013, at 10:59, kilon alios <kilon.alios@gmail.com> wrote:
just tried it, I see no change
self changeProportionalLayout. editButton := HypEditButton new . editButton position: 0@0. self addMorph: editButton .
On Thu, Nov 28, 2013 at 11:54 AM, Benjamin < Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
Can you try to do something like
self changeProportionalLayout before adding the morph ?
Ben
On 28 Nov 2013, at 10:51, kilon alios <kilon.alios@gmail.com> wrote:
So I have found some strange problems with my vector editor , Hyperion.
Hyperion is a Morph openInWindow. Code can be found in the class side of Hyperion>>open.
The coordinate system when detecting events (mouseOver, mouseUp and mouseDown events of the Hyperion instance) looks like it takes to account also beyond the morph as coordinates as a result events happening at the top right edge of the morph where Hyperion is rendered is 6@30( which is the size of the window's title bar plus its borders). Thats ok, I have taken these offsets to account when computing the position of the mouse. I guess it uses the global coordinated and not the local coordinates of the morph.
I am adding a button to control the edit mode of a line, when in edit mode handles for line's control points are shown and those handles can be dragged around to control the shape of the line , when off edit mode, the line will be able to be drag around (not implemented yet).
My problem is that when I add that button as morph to the existing morph of Hyperion in 0@0 , it actually appears in 0@30 in local coordinated of the Hyperion moprh which in global coordinates it 6@60 ( 0@0 + 6@30 + 0@30 = 6@60). Why is that ?
I have no clue why I am getting an offset of 0@30 in local coordinates of the Hyperion morph.
here is the picture showing a) how it looks like b) the code that set the position c) transcript showing mouse coordinates when clicked in the top left corner of Hyperion morph Hyperion coordinates problem.JPG<https://docs.google.com/file/d/0B1L74rM985aqVTZleHlmb3RmbWs/edit?usp=drive_w...>
if anyone wants to try the code himself the repo is here
http://www.smalltalkhub.com/#!/~kilon/Hyperion
To sum up, to place that button on top left, I will have to position it 0@(-30) which for me makes no sense at all.
Please note that everything is rendered with Athens.
Maybe I have messed up the code myself somewhere but I have looked it again and again I cant find a problem with my code.
-- Best regards, Igor Stasenko.