Dear Max,
I tried your example, and made some changes,
so the difference between tabs is visualized clearly (see attachment).
When executing this code, I'm able to switch between tabs, however.
Did you rely on some other resources, not attached in your email?
Kind regards,
Pieter
On 22 June 2010 18:04, Markus Quatember <[email protected]>wrote:
> Hi all!
>
> I think I found a bug in the usage of WTabWidget with a WContainerWidget
> containing a WGridLayout.
> When I use this three components like in the sample attached, I have the
> problem, that I cannot switch
> the tabs anymore. What am I doing wrong?
>
> By the way: If I use Ext::TabWidget instead of WTabWidget the tab
> switching is ok but I have the problem,
> that I cannot see all tabs if there is not enough space available (for
> example in an dialog)...
>
> best regards
> Max Quatember
>
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
#include <Wt/WApplication>
#include <Wt/WTabWidget>
#include <Wt/WContainerWidget>
#include <Wt/WLabel>
#include <Wt/WLineEdit>
#include <Wt/WGridLayout>
namespace
{
class TestContainer : public Wt::WContainerWidget
{
public:
TestContainer( std::string index ,Wt::WContainerWidget* parent = 0 )
: Wt::WContainerWidget( parent )
{
Wt::WGridLayout* gridLayout = new Wt::WGridLayout;
for( int i = 0; i < 20; ++i )
{
gridLayout->addWidget( new Wt::WLabel( index ), i, 0, Wt::AlignMiddle | Wt::AlignLeft );
gridLayout->addWidget( new Wt::WLineEdit( index ), i, 1, Wt::AlignMiddle | Wt::AlignLeft );
}
setLayout( gridLayout, Wt::AlignLeft );
}
};
class TestTab : public Wt::WApplication
{
public:
TestTab( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{
root()->addWidget( tab() );
}
Wt::WTabWidget* tab()
{
Wt::WTabWidget* t = new Wt::WTabWidget( 0 );
t->addTab( new TestContainer("xxx1"), "xxxxxxx1" );
t->addTab( new TestContainer("xxx2"), "xxxxxxx2" );
t->addTab( new TestContainer("xxx3"), "xxxxxxx3" );
t->addTab( new TestContainer("xxx4"), "xxxxxxx4" );
t->addTab( new TestContainer("xxx5"), "xxxxxxx5" );
t->addTab( new TestContainer("xxx6"), "xxxxxxx6" );
t->addTab( new TestContainer("xxx7"), "xxxxxxx7" );
t->addTab( new TestContainer("xxx8"), "xxxxxxx8" );
t->addTab( new TestContainer("xxx9"), "xxxxxxx9" );
//t->resize( 300, 300 );
return t;
}
};
}
Wt::WApplication* CreateTestTab( const Wt::WEnvironment& env )
{
return new TestTab( env );
}
int main(int argc, char **argv)
{
return WRun( argc, argv, &CreateTestTab );
}
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest