|
#include <Wt/WApplication>
|
|
#include <Wt/WTreeView>
|
|
#include <Wt/WText>
|
|
#include <Wt/WStandardItemModel>
|
|
|
|
using namespace std;
|
|
using namespace BitFactory::Alex::Test;
|
|
|
|
namespace
|
|
{
|
|
class TestTreeView
|
|
: public Wt::WApplication
|
|
{
|
|
public:
|
|
TestTreeView( const Wt::WEnvironment& env )
|
|
: Wt::WApplication( env )
|
|
{
|
|
setCssTheme( "polished" );
|
|
Wt::WTreeView* treeView = new Wt::WTreeView( root() );
|
|
treeView->resize( 500, 500 );
|
|
treeView->setColumnResizeEnabled( true );
|
|
Wt::WStandardItemModel* model = new Wt::WStandardItemModel( 0, 2 );
|
|
model->setHeaderData( 0, Wt::Horizontal, std::string( "xxxxxxx" ) );
|
|
model->setHeaderData( 1, Wt::Horizontal, std::string( "xxxxxxx" ) );
|
|
treeView->setModel( model );
|
|
treeView->setColumnWidth( 0, 120.5 );
|
|
treeView->setColumnWidth( 1, 120.5 );
|
|
}
|
|
};
|
|
}
|
|
|
|
Wt::WApplication* CreateTestTreeView( const Wt::WEnvironment& env )
|
|
{
|
|
return new TestTreeView( env );
|
|
}
|
|
|
|
void RunTestTreeView()
|
|
{
|
|
static int argc_ = 5;
|
|
static char* argv_[] = { "Bfx.WebUI.Test", "--http-address=0.0.0.0", "--http-port=8080", "--deploy-path=/TestSimple", "--docroot=." };
|
|
WRun( argc_, argv_, &CreateTestTreeView );
|
|
}
|