tgui::Table "vector subscript out of range"

Started by billarhos, 31 January 2016, 09:20:07

billarhos

hi
i decided to replace some list boxes with table widget and here is the issue i face.

to set "setFixedColumnWidth()" must first "setHeaderColumns()". Yes, i can work around but is this a real issue?

Bill

billarhos

Also, if i have add only headers in table widget, the colors are missing after the first header title.

Photo1: I have add a row "pTable->addRow({ "Today", "Stutgard", "ADFG", "1000.00E" });"

Photo2 : I have not added any row.


texus

I didn't write the Table class and what you see in the example code is the only test that was done with the class so there will probably be more of these small issues.

I fixed the first issue but I can't reproduce the second one. Could you show the code that you are using for the Table?

Apparently I forgot to push the vertical alignment in label to github. So that feature is now in the latest version as well.

billarhos

The code is almost the same as example.


tgui::Table::Ptr pTable;

pTable = std::make_shared<tgui::Table>();
pTable->setSize({ Settings::handler()->layoutHeight(860), Settings::handler()->layoutHeight(600) });
pTable->setPosition({ 14, 40 });

pWindow->add(pTable);

pTable->removeAllWidgets();

std::vector<std::string> headers;
headers.push_back("Date");
headers.push_back("Shop");
headers.push_back("Jackpot Code");
headers.push_back("Amount");

pTable->setHeaderColumns(headers);

pTable->setBackgroundColor({ 203, 201, 207 });
pTable->setFixedColumnWidth(0, Settings::handler()->layoutWidth(140).getValue());
pTable->setFixedColumnWidth(1, Settings::handler()->layoutWidth(170).getValue());
pTable->setFixedColumnWidth(2, Settings::handler()->layoutWidth(80).getValue());
pTable->setFixedColumnWidth(3, Settings::handler()->layoutWidth(90).getValue());

pTable->setStripesRowsColor({ 246, 246, 246 }, { 233, 233, 233 });
pTable->addRow({ "Today", "Stutgard", "ADFG", "1000.00E" });



to generate this issue just remove the last line of my code

texus

The issue is apparently already fixed by fixing your first issue. So it should work fine with the latest version.