Each time the window is resized the first div is notified. To catch this event you should create a new jQuery plugin like this:
( function($) {
$.widget("ui.sglDashboard", {
_create: function() {
var that = this;
this._setChildrenDimensions();
this.element.bind("resize", function(){
that._setChildrenDimensions();
});
},
_setChildrenDimensions: function() {
}
});
})(jQuery);
Then bind this plugin with the first div:
html div
script: html jQuery new glamourDashboard ;
with: [
html div
script: html jQuery new glamourResize ;
with: [
self render: aTabulatorPresentation on: html
]
].
In the function _setChildrenDimensions you should set a proper dimension to the inner div, and notify it(you can use $.glamour.setElementDimensions). For an example you can look at the stack renderer.
Regarding the vertical scroll bars it may be difficult to add, as at the moment you don't have a way in which to ask a presentation for its size. It may be possible to use CSS to achieve this, but it will not work all the times, especially if the dashboard contains tabbed presentation which use ajax to load their content.
Also in the current implementation the parent widget determines the available space in which the children widgets should display themselves, and there is no mechanism for a child widget to tell its parent widget it need more space.
Andrei
On Mon, Jul 18, 2011 at 3:02 PM, Cyrille Delaunay cy.delaunay@gmail.comwrote:
Yes thanks andrei, it helps me :) I played a bit with some exist script. Something that started to looks good was :
html div
with: [ html div script: html jQuery new glamourResize ; with: [ self render: aTabulatorPresentation on: html ] ].
With this script , I guess the 'inner' div is resized to display well the tabulator inside the bounds of the 'root' div. The result is good at first.
But the tabulator does not resize when I change the size of my web-browser. Ideally what would like is to always fill the horizontal space of my web-browser. For the vertical size, do not adapt but provide a scroll bar. Maybe here I have to write new scripts that do that ? In fact what would work is to perform a 'glamourResize' each time we modify root-div size (and not only one time when opening the page) (?).
2011/7/14 Stéphane Ducasse stephane.ducasse@inria.fr
Thanks for your example andrei
Stef
On Jul 14, 2011, at 5:09 PM, Andrei Vasile Chis wrote:
Hi Cyrille,
In Glamour-Seaside the layout is done using jQuery and each
presentation/browser should usually define a jQuery widget.
The tabulator(and all the widgets that can contain other widgets)
resizes the content of its children and also notifies them by sending an event.
When a child receives a resize event it can adjust its size and
propagate the event to its children(if any).
In you examples the tabulator will directly resize the content of the
first div. In the second case however, depending on the css, the inner div may not be resized properly. A possible solution may be to create a jQuery widget, bind to the resize event and set the dimensions of the inner div accordingly. As an example you can look at SGLJsLibrary>>sglStackJs or SGLJsLibrary >>sglFinderJs which do this. If you don't want to use jQuery you may be able to use just css (as a very simple example you can look at SGLMondrianPresenter).
I hope this helps you. If not let me know.
Andrei
On Thu, Jul 14, 2011 at 3:33 PM, Tudor Girba tudor@tudorgirba.com
wrote:
I cannot answer from on top of my head. But, try displaying a complex
browser and take a look at the Examples could be the MetaBrowser or the one for basic examples.
Cheers, Doru
On 14 Jul 2011, at 14:21, Cyrille Delaunay wrote:
Indeed I know that and I 'm working in an old image where things work
correctly:) My question is not related to that but about how I should render the browser using seaside , if there use some tric to use. Should I render it in a div with a specific class ('glm-something') or using a specific js script ?
2011/7/13 Tudor Girba tudor@tudorgirba.com Hi,
We know that the Seaside rendering is broken in Pharo 1.3 / Seaside.
The main problem seems to be that when we get an announcement from the Glamour model in the Seaside renderer, the renderer somehow cannot find the Seaside application context.
I do not know why. Andrei said that he will try to look into this when
he has time.
Cheers, Doru
On 13 Jul 2011, at 15:42, Cyrille Delaunay wrote:
oups,
Hello.
I currently looking at how to render the GLMDashboard in
Glamour-seaside. I already tried several things but my main problem is:
In the 'renderOn:' method of my SGLDashboardPresenter , if I write :
html div with: [ self render:
aTabulatorPresentation last on: html
] ].
the tabulator is not well rendered (the different panes are put one
over the other). Whereas if I write
self render: aTabulatorPresentation last on:
html
I think it's ok.
2011/7/13 Cyrille Delaunay cy.delaunay@gmail.com Hello.
I currently looking at how to render the GLMDashboard in
Glamour-seaside. I already tried several things but my main problem is:
In the 'renderOn:' method of my SGLDashboardPresenter , if I write :
html div with: [ self render:
(self firstColumnPanesFrom: self browser) last on: html
] ].
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Value is always contextual."
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
-- www.tudorgirba.com
"Not knowing how to do something is not an argument for how it cannot be
done."
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