With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed.
With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman btc@openInWorld.com wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Nice, but I think this should be dealt with by the layout. Ideally :)
Doru
On 12 Nov 2012, at 23:01, Alexandre Bergel alexandre.bergel@me.com wrote:
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman btc@openInWorld.com wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Every successful trip needs a suitable vehicle."
Nice, but I think this should be dealt with by the layout. Ideally :)
Why by the layout and not the camera? This is a problem of focus. We can add an action, subclass of ROAction, to focus at the bottom of the graph.
Alexandre
On 12 Nov 2012, at 23:01, Alexandre Bergel alexandre.bergel@me.com wrote:
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman btc@openInWorld.com wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Every successful trip needs a suitable vehicle."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi,
Ahh, I misread the mail. I thought that the problem was also about translating the nodes to the bottom of the container. But, indeed, in this case it is just about the camera and an action would be just fine for this.
Cheers, Doru
On 13 Nov 2012, at 21:55, Alexandre Bergel alexandre.bergel@me.com wrote:
Nice, but I think this should be dealt with by the layout. Ideally :)
Why by the layout and not the camera? This is a problem of focus. We can add an action, subclass of ROAction, to focus at the bottom of the graph.
Alexandre
On 12 Nov 2012, at 23:01, Alexandre Bergel alexandre.bergel@me.com wrote:
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman btc@openInWorld.com wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Every successful trip needs a suitable vehicle."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Yesterday is a fact. Tomorrow is a possibility. Today is a challenge."
Could you try changing the Visualisation window size and then running the script.
I've extended the camera to have the window size. This will enable a range of new facilities (e.g., sticking an element to a window edge)
btw, I notice that ROCamera is created in both ROAbstractCamvas>>initialize and ROView>>initialize. How do these relate?
The idea of having a camera in ROAbstractCanvas>>initialize is to not have to clutter each method with "camera ifFalse: [ ^ self]" for example. A canvas needs a camera to render things. Is the comment in this #initialize method not enough? What could be a better comment?
P.S. just to remove doubt, I don't need this to be pinned dynamically the bottom left, just to set the default position of the layout. )
A student is working on centering layouts... It should come soon.
P.P.S note that I will be wanting to use this from Glamour, and in particular in my project in the image you have previously downloaded in the mothod EpCimtest>>showClassRelationshipsSelected: just following the ROHorizontalTreeLayout (which you can leave for me to check)
Ok
Alexandre
Alexandre Bergel wrote:
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman btc@openInWorld.com wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
It should not be a problem. This is related to how the easel works.
Alexandre
On Nov 19, 2012, at 3:51 PM, Ben Coman btc@openInWorld.com wrote:
Alexandre, thanks for that chat and jumping straight onto my request. Here is a test procedure to highlight that niggle I discovered testing this from Roassal Easel. It is based off ConfigurationOfRoassal-AlexandreBergel.697.
- Add transcript debugging to ROFocusView>>bottomLeftOn: as follows...
bottomLeftOn: element "Public method"
"There is some duplication with ROLinearMove. Need to check!!!"
Transcript crShow: element view camera windowSize.
self onWithoutProcess: element offset: (0 @ (element view camera windowSize y - element height)) . "[ self onWithoutProcess: element ] fork"
- Open a new Roassal Easel and paste in the following script...
| view rawView elementToPin | rawView := ROView new. view := ROMondrianViewBuilder view: rawView.
#(1 2 2 4 5 6 7 8 9) do: "Easel script - note additional temp var elementToPin " [ :x | | element | rawView add: (element := ROElement spriteOn: x) + ROLabel. (x=5) ifTrue: [elementToPin := element]. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ]. rawView elements do: [ :el | el @ (ROMenuActivable new item: 'Stick To Bottom Left' action: [ ROConstraint stickToBottomLeft: el ]) ].
ROEaselMorphic new populateMenuOn: view. view open. ROFocusView bottomLeftOn: elementToPin.
Run the script and you will observe (500@500) in the transcript
Make the Roassal Visualization window bigger.
In the Roassal Easel Script window, type a <space> somewhere and [Accept] it to run it again
You will again observe (500@500) in the transcript - when I would expect a changed value. Note that element-5 remained where it previously was rather than the bottom left corner.
I don't know yet if this will be an issue in my application or is just to do with Easel reusing the existing window. That check will have to wait until tomorrow. Zzzzzzz.
btw, how does the size of aROView compare to the size of its canvas?
cheers, Ben
Ben Coman wrote:
Thanks Alexandre. Just managed to have a look at it. Very elegant. Sticking an element to the window border like that will have a lot of use for menus and status bars, however that wasn't quite what I needed - which was to translate the whole graph to stick an element to the bottom left. However with your template I managed to get what I needed with the following...
stickToBottomLeft: element Transcript crShow: '1> ', element view camera windowSize asString , ' -- ', element position asString, ' -- ', element model asString. "element view translateTo: ( 0 @ element view camera windowSize y - element position y - element height)." element view on: ROWindowResized do: [ :event | Transcript crShow: '2> ', event extent asString , ' -- ', element position asString, ' -- ', element model asString. element view translateTo: ( element position x negated @ (event extent y - element position y - element height )) ].
#(1 2 3 4 5 6 7 8 9) do: "Easel script - note additional temp var elementToPin " [ :x | | element | rawView add: (element := ROElement spriteOn: x) + ROLabel. (x=7) ifTrue: [elementToPin := element]. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROConstraint stickToBottomLeft: elementToPin.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ]. rawView elements do: [ :el | el @ (ROMenuActivable new item: 'Stick To Bottom Left' action: [ ROConstraint stickToBottomLeft: el ]) ].
A few additional thoughts...
- Note the second line of #stickToBottomLeft is commented-out. IT currently
has no effect. The transcript shows #windowSize incorrectly returns 0@0. If you reverse the commenting so that only this executes you will see things end up out camera. It is the windowResize event that makes it work.
- However without that second line, "ROMenuActivable new item: 'Stick To Bottom
Left' " has no effect until the window is resized.
- Actually for the ROMenuActivable to have an effect, the line "ROConstraint
stickToBottomLeft: elementToPin." needs to be commented-out. Further, activating the ROMenuActivable a second time has no effect since the first one is still active. The transcript shows two ROConstraints being handled on window resize, but the original taking precedence.
- It isn't necessarily just a single element that needs sticking. Ideally in
the Easel example above element#7 could be stuck to the left side while element#9 is stuck to the bottom - but obviously that adds more complexity.
- I don't necessarily need it to stick permanently to the bottom left, but only
on the first display.
cheers -ben
Alexandre Bergel wrote:
Could you try changing the Visualisation window size and then running the script.
I've extended the camera to have the window size. This will enable a range of new facilities (e.g., sticking an element to a window edge)
btw, I notice that ROCamera is created in both ROAbstractCamvas>>initialize and ROView>>initialize. How do these relate?
The idea of having a camera in ROAbstractCanvas>>initialize is to not have to clutter each method with "camera ifFalse: [ ^ self]" for example. A canvas needs a camera to render things. Is the comment in this #initialize method not enough? What could be a better comment?
P.S. just to remove doubt, I don't need this to be pinned dynamically the bottom left, just to set the default position of the layout. )
A student is working on centering layouts... It should come soon.
P.P.S note that I will be wanting to use this from Glamour, and in particular in my project in the image you have previously downloaded in the mothod EpCimtest>>showClassRelationshipsSelected: just following the ROHorizontalTreeLayout (which you can leave for me to check)
Ok
Alexandre
Alexandre Bergel wrote:
Something like:
#(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ].
rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ).
Cheers, Alexandre
On Nov 11, 2012, at 10:31 PM, Ben Coman
wrote:
With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. With the script below, the attached image is what I would like to see.
"-------------" #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" "-------------"
cheers -ben
<Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
On Nov 21, 2012, at 12:14 PM, Ben Coman btc@openInWorld.com wrote:
To test further, I ran this script from Workspace...
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView elements do: [ :el | el @ (ROMenuActivable new item: 'Stick To Bottom Left' action: [ ROFocusView bottomLeftOn: el. ] ) ]. rawView open.
After executing, right-clicking on the "5" element and applying the 'Stick To Bottom Left' menu action translates the view as expected. However immediately repeating the same menu action on the "5" element moves the view again, where I would expect the "5" was already in position and would not move again. Also if I manually drag the view to show the "7" element then apply the same action menu, the view is translated up rather than to the bottom left.
regards, Ben
Alexandre Bergel wrote:
It should not be a problem. This is related to how the easel works.
Alexandre
On Nov 19, 2012, at 3:51 PM, Ben Coman btc@openInWorld.com wrote:
Alexandre, thanks for that chat and jumping straight onto my request. Here is a test procedure to highlight that niggle I discovered testing this from Roassal Easel. It is based off ConfigurationOfRoassal-AlexandreBergel.697.
- Add transcript debugging to ROFocusView>>bottomLeftOn: as follows...
bottomLeftOn: element "Public method"
"There is some duplication with ROLinearMove. Need to check!!!"
Transcript crShow: element view camera windowSize.
self onWithoutProcess: element offset: (0 @ (element view camera windowSize y - element height)) . "[ self onWithoutProcess: element ] fork"
- Open a new Roassal Easel and paste in the following script...
| view rawView elementToPin | rawView := ROView new. view := ROMondrianViewBuilder view: rawView.
#(1 2 2 4 5 6 7 8 9) do: "Easel script - note additional temp var elementToPin " [ :x | | element | rawView add: (element := ROElement spriteOn: x) + ROLabel. (x=5) ifTrue: [elementToPin := element]. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ]. rawView elements do: [ :el | el @ (ROMenuActivable new item: 'Stick To Bottom Left' action: [ ROConstraint stickToBottomLeft: el ]) ].
ROEaselMorphic new populateMenuOn: view. view open. ROFocusView bottomLeftOn: elementToPin.
Run the script and you will observe (500@500) in the transcript
Make the Roassal Visualization window bigger.
In the Roassal Easel Script window, type a <space> somewhere and [Accept] it to run it again
You will again observe (500@500) in the transcript - when I would expect a changed value. Note that element-5 remained where it previously was rather than the bottom left corner.
I don't know yet if this will be an issue in my application or is just to do with Easel reusing the existing window. That check will have to wait until tomorrow. Zzzzzzz.
btw, how does the size of aROView compare to the size of its canvas?
cheers, Ben
Ben Coman wrote:
Thanks Alexandre. Just managed to have a look at it. Very elegant. Sticking an element to the window border like that will have a lot of use for menus and status bars, however that wasn't quite what I needed - which was to translate the whole graph to stick an element to the bottom left. However with your template I managed to get what I needed with the following...
stickToBottomLeft: element Transcript crShow: '1> ', element view camera windowSize asString , ' -- ', element position asString, ' -- ', element model asString. "element view translateTo: ( 0 @ element view camera windowSize y - element position y - element height)." element view on: ROWindowResized do: [ :event | Transcript crShow: '2> ', event extent asString , ' -- ', element position asString, ' -- ', element model asString. element view translateTo: ( element position x negated @ (event extent y - element position y - element height )) ].
#(1 2 3 4 5 6 7 8 9) do: "Easel script - note additional temp var elementToPin " [ :x | | element | rawView add: (element := ROElement spriteOn: x) + ROLabel. (x=7) ifTrue: [elementToPin := element]. ]. rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROConstraint stickToBottomLeft: elementToPin.
rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ]. rawView elements do: [ :el | el @ (ROMenuActivable new item: 'Stick To Bottom Left' action: [ ROConstraint stickToBottomLeft: el ]) ].
A few additional thoughts...
- Note the second line of #stickToBottomLeft is commented-out. IT currently
has no effect. The transcript shows #windowSize incorrectly returns 0@0. If you reverse the commenting so that only this executes you will see things end up out camera. It is the windowResize event that makes it work.
- However without that second line, "ROMenuActivable new item: 'Stick To Bottom
Left' " has no effect until the window is resized.
- Actually for the ROMenuActivable to have an effect, the line "ROConstraint
stickToBottomLeft: elementToPin." needs to be commented-out. Further, activating the ROMenuActivable a second time has no effect since the first one is still active. The transcript shows two ROConstraints being handled on window resize, but the original taking precedence.
- It isn't necessarily just a single element that needs sticking. Ideally in
the Easel example above element#7 could be stuck to the left side while element#9 is stuck to the bottom - but obviously that adds more complexity.
- I don't necessarily need it to stick permanently to the bottom left, but only
on the first display.
cheers -ben
Alexandre Bergel wrote:
Could you try changing the Visualisation window size and then running the script.
I've extended the camera to have the window size. This will enable a range of new facilities (e.g., sticking an element to a window edge)
btw, I notice that ROCamera is created in both ROAbstractCamvas>>initialize and ROView>>initialize. How do these relate?
The idea of having a camera in ROAbstractCanvas>>initialize is to not have to clutter each method with "camera ifFalse: [ ^ self]" for example. A canvas needs a camera to render things. Is the comment in this #initialize method not enough? What could be a better comment?
P.S. just to remove doubt, I don't need this to be pinned dynamically the bottom left, just to set the default position of the layout. )
A student is working on centering layouts... It should come soon.
P.P.S note that I will be wanting to use this from Glamour, and in particular in my project in the image you have previously downloaded in the mothod EpCimtest>>showClassRelationshipsSelected: just following the ROHorizontalTreeLayout (which you can leave for me to check)
Ok
Alexandre
Alexandre Bergel wrote:
> Something like: > > #(1 2 3 4 5 6 7 8 9) do: > [ > :x | > rawView add: (ROElement spriteOn: x) + ROLabel. > ]. > rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). > rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). > (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. > > rawView elements do: [ :el | el @ (ROMenuActivable new item: 'act' action: #inspect) ]. > > rawView translateTo: 0 @ ((rawView elements collect: [:el | el position y + el height] ) max negated + rawView camera bounds height ). > > Cheers, > Alexandre > > On Nov 11, 2012, at 10:31 PM, Ben Coman > > >
> wrote: > > > > > > >> With Roassal after applying a layout, I would like to be able to translate the graph such that the bottom left corner of the graph is displayed. Is there someway to do that already? >> I looked into ROFocusView, ROCanvas & ROCamera, but could not work it out what was needed. >> With the script below, the attached image is what I would like to see. >> >> "-------------" >> #(1 2 3 4 5 6 7 8 9) do: >> [ >> :x | >> rawView add: (ROElement spriteOn: x) + ROLabel. >> ]. >> rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements eighth). >> rawView add: (ROEdge lineFrom: rawView elements seventh to: rawView elements ninth). >> (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. >> "HERE TRANSLATE CANVAS/CAMERA TO SHOW NODES 7, 8 & 9 IN THE BOTTOM LEFT CORNER OF WINDOW PANE" >> "-------------" >> >> cheers -ben >> >> <Roassal-how-to-show-bottom-left-corner.png>_______________________________________________ >> Moose-dev mailing list >> >> >> >>
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>> >> >> >> >> > > > > > _______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open. ------------- | rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). ------------- | rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open. -------------
However when using Glamour, an #open is implicitly executed after the script, and I determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script... ------------ rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). --------------
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation. ---------------- browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1. -----------------
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted]
correction I determine ==> I cannot determine
Ben Coman wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the
#bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open.
However when using Glamour, an #open is implicitly executed after the script, and I _cannot_ determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
I will introduce an event when the window is open. You will then be able to scroll the view accordingly.
Alexandre
On Nov 22, 2012, at 12:34 PM, Ben Coman btc@openInWorld.com wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open.
However when using Glamour, an #open is implicitly executed after the script, and I determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Window sounds too specific to the UI and the way the visualization is used.
We already have now an announcement that gets triggered when the layout finished. Is that not enough?
Cheers, Doru
On Fri, Nov 23, 2012 at 12:38 PM, Alexandre Bergel alexandre.bergel@me.comwrote:
I will introduce an event when the window is open. You will then be able to scroll the view accordingly.
Alexandre
On Nov 22, 2012, at 12:34 PM, Ben Coman btc@openInWorld.com wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on
the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) +
ROLabel ].
(ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on:
rawView elements.
rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7
]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) +
ROLabel ].
(ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on:
rawView elements.
ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7
]).
rawView open.
However when using Glamour, an #open is implicitly executed after the
script, and I determine how to execute the #bottomLeftOn: after that #open.
For example, try "World > Moose > Glamorous Roassal Easel" with the
following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) +
ROLabel ].
(ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on:
rawView elements.
ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7
]).
The ultimate goal is to have something similar to the following script
that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement
spriteOn: x) + ROLabel ].
(ROHorizontalTreeLayout new verticalGap: 40;
horizontalGap:60) on: roview elements.
ROFocusView bottomLeftOn: (roview elements detect: [ :x |
x model = 7 ]).
] ].
browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized
windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Window sounds too specific to the UI and the way the visualization is used.
Well.. On some point we need to know what is the size of the displayed window or pane.
We already have now an announcement that gets triggered when the layout finished. Is that not enough?
Consider: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. roview on: ROLayoutEnd do: [ :evt | ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ])]. ] ]. browser openOn: 1. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
It does not quite work.
Cheers, Alexandre
Cheers, Doru
On Fri, Nov 23, 2012 at 12:38 PM, Alexandre Bergel alexandre.bergel@me.com wrote: I will introduce an event when the window is open. You will then be able to scroll the view accordingly.
Alexandre
On Nov 22, 2012, at 12:34 PM, Ben Coman btc@openInWorld.com wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open.
However when using Glamour, an #open is implicitly executed after the script, and I determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Every thing has its own flow"
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
I am wondering whether an event for the open view is really the right thing.
You can use ROwindowResized if you wish: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= view raw on: ROWindowResized do: [ :evt | ROFocusView new on: node view: view raw ]. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
In your example: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. roview on: ROWindowResized do: [ :evt | ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ])]. ] ]. browser openOn: 1. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cheers, Alexandre
On Nov 24, 2012, at 7:04 AM, Ben Coman btc@openInWorld.com wrote:
I ended up thinking along the same line. Looking forward to it.
cheers -ben
Alexandre Bergel wrote:
I will introduce an event when the window is open. You will then be able to scroll the view accordingly.
Alexandre
On Nov 22, 2012, at 12:34 PM, Ben Coman btc@openInWorld.com wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open.
However when using Glamour, an #open is implicitly executed after the script, and I determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Is this still an issue?
Cheers, Alexandre
On Nov 23, 2012, at 12:38 PM, Alexandre Bergel alexandre.bergel@me.com wrote:
I will introduce an event when the window is open. You will then be able to scroll the view accordingly.
Alexandre
On Nov 22, 2012, at 12:34 PM, Ben Coman btc@openInWorld.com wrote:
Whoops, I spoke too soon. Just a bit more to go.
It is working well when manually executing the context menu action on the element after the window has opened. However I am having trouble using it from glamour inside my application. For background info, in Workspace compare the following two scripts. The first one works while the second one doesn't. The requirement is that the #bottomLeftOn: must executed after the #open.
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. rawView open. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
| rawView | rawView := ROView new @ RODraggable. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]). rawView open.
However when using Glamour, an #open is implicitly executed after the script, and I determine how to execute the #bottomLeftOn: after that #open. For example, try "World > Moose > Glamorous Roassal Easel" with the following script...
rawView := view view. #(1 2 3 4 5 6 7 8 9) do: [ :x | rawView add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: rawView elements. ROFocusView bottomLeftOn: (rawView elements detect: [ :x | x model = 7 ]).
The ultimate goal is to have something similar to the following script that works within my application. Note that currently "element-7" is displayed sitting just above 0@0, which is the returned size of the window used for calculation.
browser := GLMTabulator new. browser column: #testtab. browser transmit to: #testtab; andShow: [ :a | a roassal title: 'TestTab' ; painting: [ :moview :selection | |roview| roview := moview view. #(1 2 3 4 5 6 7 8 9) do: [ :x | roview add: (ROElement spriteOn: x) + ROLabel ]. (ROHorizontalTreeLayout new verticalGap: 40; horizontalGap:60) on: roview elements. ROFocusView bottomLeftOn: (roview elements detect: [ :x | x model = 7 ]). ] ]. browser openOn: 1.
Hopefully you have some magic to get the last one to work.
cheers -ben
Ben Coman wrote:
Thanks Alexandre. That works really well now - including with resized windows.
cheers -ben
Alexandre Bergel wrote:
Hi Ben,
Can you try with the last version? This should be solved now
Alexandre
[lots deleted] _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev