31 void data(
const std::vector<std::vector<std::string>> &vvdata)
40 for (
int krow = 0; krow < vvdata.size(); krow++)
42 std::vector<wex::editbox *> ebrow;
43 for (
int kcol = 0; kcol < vvdata[0].size(); kcol++)
45 auto &eb = wex::maker::make<wex::editbox>(*
this);
47 eb.text(vvdata[krow][kcol]);
58 void rowLabels(
const std::vector<std::string> &vRowLabels)
60 if (vRowLabels.size() != vEB.size())
67 for (
int krow = 0; krow < vRowLabels.size(); krow++)
69 auto &lb = wex::maker::make<wex::label>(*
this);
70 lb.move(10, y, w, 40);
71 lb.text(vRowLabels[krow]);
77 void colLabels(
const std::vector<std::string> &vColLabels)
79 if (vColLabels.size() != vEB[0].size())
85 for (
int kcol = 0; kcol < vColLabels.size(); kcol++)
87 auto &lb = wex::maker::make<wex::label>(*
this);
88 lb.move(x, 10, w, 40);
89 lb.text(vColLabels[kcol]);
97 std::vector<std::string>
dataRow(
int row)
const
99 std::vector<std::string> ret;
100 for(
auto* v : vEB[row] )
101 ret.push_back( v->text() );
106 std::vector<std::vector<wex::editbox *>> vEB;
A read/write table of values.
Definition: datasheet.h:21
std::vector< std::string > dataRow(int row) const
get data in a row
Definition: datasheet.h:97
void colLabels(const std::vector< std::string > &vColLabels)
set column labels
Definition: datasheet.h:77
void rowLabels(const std::vector< std::string > &vRowLabels)
set row labels
Definition: datasheet.h:58
void data(const std::vector< std::vector< std::string >> &vvdata)
set the data
Definition: datasheet.h:31
The base class for all windex gui elements.
Definition: wex.h:900
gui()
Construct top level window with no parent.
Definition: wex.h:907