Hello Koen,
My reply to your email is in "waiting for moderator" state because I
attached screenshots of the test app output to show the issue I am
seeing here. The attachment size exceeded witty mailing list's 40KB
limit. Please could you unblock the stranded email and have a look at
further details on the earlier reported issue? Also the problem does
not just relate to chart. I am seeing a similar problem with a simple
app using WText (source attached). It seems there is a general problem
on how Wt handles resizing of divs when the browser window is resized
(either by using the restore/maximize buttons or by dragging the
browser window border). Wt's interpolation logic for the width and
height of divs when the browser window is resized does not always take
into consideration the size of the content encapsulated under the
divs. Also the interpolation logic loses the start height and/or width
values of the divs that the developer has explicitly specified. This
is the reason for the issue of Wt not restoring the application layout
to its original size when the browser is maximized. I think Wt should
not do the interpolation and just set the width and height to auto by
default or use whatever value the developer has specified for the
container and widgets. That way the developer has control over how the
layout pans out in all circumstances rather than being at the mercy of
the automatic interpolation during browser resize.
To recreate the issue I am seeing here, please launch the test app in
maximised browser window. Note the size and area covered by the
borders of various widgets/containers of the application. Now resize
the browser window by using the browser's restore button. Then reduce
the browser window to a very small size e.g. 100x100 px size. Note the
way the container shrinks past the content that flows vertically. Now
maximise the browser window. And look at the size of the area covered
by the borders of various widgets/containers of the application. The
containers don't always restore to their original size.
I am using FF17.0.1, Ubuntu 12.04 and Wt 3.2.3 from the upstream branch.
Let me know if there is anything wrong with this test application.
Regards,
~Plug
On Sun, Jan 6, 2013 at 4:09 AM, Plug Gulp <plug.g...@gmail.com> wrote:
>> Date: Sat, 5 Jan 2013 21:50:23 +0100
>> From: Koen Deforche <k...@emweb.be>
>> Subject: Re: [Wt-interest] Chart and fluid layout...
>> To: witty-interest@lists.sourceforge.net
>> Message-ID:
>> <caawqso0yp9vg2mpfdd0z_fnf9pyunmc6uetmxwf+615e1fs...@mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Hey,
>>
>> I tested this on a development branch of Wt and it seems to behave
>> properly. With what version are you seeing the bad behaviour ?
>>
>
> I am using the latest upstream branch (3.2.3). I am attaching
> screenshots of the issues I see. The screenshots are as follows (the
> sequence in which the screenshots are listed below is the same
> sequence I performed the browser resizing actions after launching my
> test application):
>
> 1. BrowserStartApp.png: This is the screenshot of what I see in the
> web browser when I open the application. Note that there is no chart
> visible, where as I expect to see a chart filled in it's container
> (the container has blue colour border).
> 2. BrowserRestoreResized.png: The chart is now visible after resizing
> the browser window using the "Restore" button of the browser.
> 3. BrowserDragResized.png: The chart resizes, as expected, to fill
> it's container automatically if the browser window is now resized by
> dragging the browser's border.
> 4. BrowserMaximized.png: Now this is what I see when I maximize the
> browser window using the "Maximize" button of the browser. Note that
> the chart has not resized to fit it's container. I expect the chart to
> resize automatically to fill it's container.
>
> So the issue is with the output shown in 1, 2, and 4 above.
>
> Thanks and regards,
>
> ~Plug
>
>
>> Regards,
>> koen
>>
>>
>> 2013/1/4 Plug Gulp <plug.g...@gmail.com>
>>
>>> Hello,
>>>
>>> I am writing a simple test application to understand Tables and Charts
>>> in Wt. Please find the test code attached with this post. I have
>>> tested this code only on FF 17.0.1 on Ubuntu 12.04. I am seeing the
>>> following anomaly with the output of this program:
>>>
>>> 1. The chart is not visible when the application is opened. The
>>> browser is required to be resized to make the chart visible i.e. it is
>>> only visible when the browser is resized.
>>> 2. When the browser is maximised then the chart does not resize to the
>>> size of its fluid container i.e. the chart remains at the same size
>>> that was before resizing.
>>>
>>> What am I doing wrong in the attached code?
>>>
>>> Thanks and regards,
>>>
>>> ~Plug
>>>
#include <Wt/WText>
#include <Wt/WHBoxLayout>
#include <Wt/WVBoxLayout>
#include <Wt/WApplication>
#include <Wt/WContainerWidget>
using namespace Wt;
class Widget1 : public WContainerWidget
{
public:
Widget1(WContainerWidget *pParent = 0)
: WContainerWidget(pParent)
{
// Set the border to see visually the effect of resizing on this container.
decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(128, 128, 0)));
// Set the size to 100% minimum. This is to see, in FireBug, the effect of restoring, resizing
// and maximizing the browser window on this container's width and height values.
setMaximumSize(WLength(100, WLength::Percentage), WLength::Auto);
setMinimumSize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
WHBoxLayout *h = new WHBoxLayout(this);
WVBoxLayout *v = new WVBoxLayout();
WText *t = new WText("Text 1");
t->decorationStyle().font().setWeight(WFont::Bolder);
t->decorationStyle().font().setSize(WFont::XXLarge);
// Set the border to see visually the effect of resizing on this container.
t->decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(0, 128, 128)));
v->addWidget(t, 1);
t = new WText("Text 2");
t->decorationStyle().font().setWeight(WFont::Bolder);
t->decorationStyle().font().setSize(WFont::Large);
// Set the border to see visually the effect of resizing on this container.
t->decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(0, 128, 128)));
v->addWidget(t, 1);
h->addLayout(v, 1);
v = new WVBoxLayout();
t = new WText("Text 3");
t->decorationStyle().font().setWeight(WFont::Bold);
t->decorationStyle().setTextDecoration(WCssDecorationStyle::Underline);
// Set the border to see visually the effect of resizing on this container.
t->decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(0, 128, 128)));
// Set the size to 100% minimum. This is to see, in FireBug, the effect of restoring, resizing
// and maximizing the browser window on this widget's width and height values.
t->setMaximumSize(WLength(100, WLength::Percentage), WLength::Auto);
t->setMinimumSize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
t->resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
v->addWidget(t, 1, AlignRight | AlignTop);
h->addLayout(v, 1);
}
};
class Widget2 : public WContainerWidget
{
public:
Widget2(WContainerWidget *pParent = 0)
: WContainerWidget(pParent)
{
// Set the border to see visually the effect of resizing on this container.
decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(128, 0, 128)));
// Set the size to 100% minimum. This is to see, in FireBug, the effect of restoring, resizing
// and maximizing the browser window on this container's width and height values.
setMaximumSize(WLength(100, WLength::Percentage), WLength::Auto);
setMinimumSize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
WVBoxLayout *v = new WVBoxLayout(this);
WText *t = new WText("Text 4");
t->decorationStyle().font().setWeight(WFont::Bolder);
t->decorationStyle().font().setSize(WFont::Large);
v->addWidget(t, 1);
}
};
class TestWidget : public WContainerWidget
{
public:
TestWidget(WContainerWidget *pParent = 0)
: WContainerWidget(pParent)
{
// Set the border to see visually the effect of resizing on this container.
decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(0, 0, 255)));
// Set the size to 100% minimum. This is to see, in FireBug, the effect of restoring, resizing
// and maximizing the browser window on this container's width and height values.
setMaximumSize(WLength(100, WLength::Percentage), WLength::Auto);
setMinimumSize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
WVBoxLayout *v = new WVBoxLayout(this);
Widget1 *w1 = new Widget1();
v->addWidget(w1, 0);
WText *w3 = new WText("Text 5");
v->addWidget(w3, 1);
Widget2 *w2 = new Widget2();
v->addWidget(w2, 0);
}
};
class TestResize : public WApplication
{
public:
TestResize(const WEnvironment& env)
: WApplication(env)
{
// Set the border to see visually the effect of resizing on this container.
root()->decorationStyle().setBorder(WBorder(WBorder::Solid, WBorder::Thin, WColor(255, 0, 0)));
// Set the size to 100% minimum. This is to see, in FireBug, the effect of restoring, resizing
// and maximizing the browser window on this container's width and height values.
root()->setMaximumSize(WLength(100, WLength::Percentage), WLength::Auto);
root()->setMinimumSize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
root()->setMargin(0);
root()->setPadding(0);
(new WVBoxLayout(root()))->addWidget(new TestWidget());
}
};
WApplication* createApplication(const WEnvironment& env)
{
return new TestResize(env);
}
int main(int iArgCount, char **ppArgs)
{
return WRun(iArgCount, ppArgs, &createApplication);
}
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest