Hi,
On IE9, it seems that double header title does not appears.
I joined a test case to reproduce the behaviour and a screenshot to
illustrate.
http://imageshack.us/photo/my-images/443/doubleheaderiefirefox.jpg/
Any idea ?
Regards,
Bastien
#include <Wt/WApplication>
#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WLineEdit>
#include <Wt/WPushButton>
#include <Wt/WVBoxLayout>
#include <Wt/WText>
#include <Wt/WTableView>
#include <Wt/WStandardItemModel>
#include <Wt/WStandardItem>
#include <Wt/WStackedWidget>
#include <Wt/WLabel>
/*
Double headers test
Second line is not rendered on IE9
*/
class WidgetWTableView : public Wt::WTableView
{
public:
Wt::WWidget * createExtraHeaderWidget(int column)
{
if (!this->model())
return 0;
if (column > this->model()->columnCount())
return 0;
if ( this->model()->headerData(column, Wt::Horizontal,
Wt::UserRole).type() == typeid(Wt::WString))
{
Wt::WString name;
try
{
name =
boost::any_cast<Wt::WString>(this->model()->headerData(column, Wt::Horizontal,
Wt::UserRole));
}
catch
(...)
{
return 0;
}
Wt::WLabel * label = new Wt::WLabel(name);
label->setStyleClass("tableViewHeaders_subTitle");
return label;
}
return 0;
}
};
using namespace Wt;
class HeadersApp : public WApplication
{
public:
HeadersApp(const WEnvironment& env);
};
WStandardItemModel * model1;
WidgetWTableView * view1;
WVBoxLayout * tableLayout;
HeadersApp::HeadersApp(const WEnvironment& env)
: WApplication(env)
{
setTitle("Test");
tableLayout = new WVBoxLayout();
model1 = new WStandardItemModel(1,10);
view1 = new WidgetWTableView();
view1->setModel(model1);
view1->setHeaderHeight(40, true);
for (unsigned int ii=0; ii<10; ii++)
{
std::stringstream ss1;
std::stringstream ss2;
ss1 << "testA-" << ii;
ss2 << "sub-" << ii;
model1->setHeaderData(ii,Horizontal, WString(ss1.str()));
model1->setHeaderData(ii,Horizontal, WString(ss2.str()), UserRole);
}
std::vector<Wt::WStandardItem*> vItems;
for (unsigned int ii = 0; ii < 10; ii++) // generate items with
corresponding headers
{
std::stringstream ss1;
ss1 << "itemA-" << ii;
Wt::WStandardItem * item = new Wt::WStandardItem();
item->setData(ss1.str(), DisplayRole);
vItems.push_back(item);
}
for (unsigned int ii=0; ii<400; ii++)
{
model1->insertRow(ii, vItems); // insert new row
}
view1->setHeight(500);
view1->setWidth(800);
tableLayout->addWidget(view1,0, AlignTop);
WContainerWidget * mainContainer = new WContainerWidget(root());
tableLayout->setContentsMargins(0,0,0,0);
mainContainer->setLayout(tableLayout, AlignTop);
}
WApplication *createApplication(const WEnvironment& env)
{
return new HeadersApp(env);
}
int main(int argc, char **argv)
{
return WRun(argc, argv, &createApplication);
}
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest