tgui::Table "vector subscript out of range"
« on: 31 January 2016, 09:20:07 »
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

Re: tgui::Table "vector subscript out of range"
« Reply #1 on: 31 January 2016, 09:51:05 »
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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: tgui::Table "vector subscript out of range"
« Reply #2 on: 31 January 2016, 13:12:16 »
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.

Re: tgui::Table "vector subscript out of range"
« Reply #3 on: 31 January 2016, 13:29:26 »
The code is almost the same as example.

Code: [Select]
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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: tgui::Table "vector subscript out of range"
« Reply #4 on: 31 January 2016, 13:32:28 »
The issue is apparently already fixed by fixing your first issue. So it should work fine with the latest version.