Hey Richard,

2009/2/18 Richard Ulrich <[email protected]>:
> This is probably more of a html problem than a wt one.

Not really.
CSS is a mess for layout, and IE made it even a larger mess.
And then Wt tries to clean things up, but still fails on too many
occasions... but we are improving!

> The example below works perfectly well with firefox or seamonkey on
> windows or linux. But with internet explorer 7 on windows xp I observe
> the following behavior:
> The tab widget sizes to the height of the content of the tab that's
> first visible. If I then change to a tab with larger content, the tab
> control still has the small size and a scrollbar. If I tab back and
> forth it gets even worse.
>
> Now what do I have to do to make this behave well with internet
> explorer?

First, get the latest CVS. It simplifies WTabWidget/WMenu CSS and
layout management workaround code for IE.

Next, I modified your example like this:

class Test : public Wt::WApplication
{
public:
       Test(const Wt::WEnvironment& env) : Wt::WApplication(env)
       {
               Wt::WContainerWidget *contall = root();

  // Note: applying the layout directly to root() makes sure it
behaves as a top-level layout that
  // fits contents in the browser window.

               Wt::WBorderLayout *blayout = new Wt::WBorderLayout();
               blayout->setLayoutHint("table-layout", "fixed");

  // Note: layout managers can only deal with overflow width (as
caused by your image) in IE6
  // using this hint. This hint reduces horizontal layout capabilities
in general (you cannot mix
  // colums without stretch with columns with stretch)

               contall->setLayout(blayout);

               tabw_ = new Wt::WTabWidget();
               blayout->addWidget(tabw_, Wt::WBorderLayout::Center);

  // Note: I removed the extra WContainerWidget, and directly inserted
the tabwidget in the layout.

               Wt::WContainerWidget *tab1 = new Wt::WContainerWidget();
               tabw_->addTab(tab1, "Tab1");
               Wt::WImage *img1 = new
Wt::WImage("http://www.swissleague.ch/big/sl2486.jpg";);
               tab1->addWidget(img1);

               Wt::WContainerWidget *tab2 = new Wt::WContainerWidget();
               tabw_->addTab(tab2, "Tab2");
               Wt::WImage *img2 = new
Wt::WImage("http://swissleague.ch/raw/sl2486.jpg";);
               tab2->addWidget(img2);

       }

       virtual ~Test() { }

private:
       Wt::WTabWidget *tabw_;
};

Regards,
koen

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to