31 myRowDisplayCount(25),
34 registerEventHandlers();
43 void set(
const std::vector<std::vector<std::string>> &val)
53 void set(
const std::vector<std::string> &val,
int colcount)
55 std::vector<std::vector<std::string>> vvs;
58 row < val.size() / colcount;
61 std::vector<std::string> vrow;
62 for (
int col = 0; col < colcount; col++)
70 vrow.push_back(val[row * colcount + col]);
88 myRowStart = myContents.size() - 1;
92 std::vector<std::vector<std::string>> myContents;
93 std::vector<int> myRowID;
94 int myRowDisplayCount;
101 if (!myContents.size())
104 int colCount = myContents[0].size();
107 colWidth =
size()[0];
109 colWidth =
size()[0] / (colCount - 1);
111 if (myContents.size() < 20)
114 rowStop = myContents.size();
118 if (myRowStart > myContents.size() - 20)
119 myRowStart = myContents.size() - 20;
120 rowStop = myRowStart + 30;
121 if (rowStop > myContents.size())
122 rowStop = myContents.size();
126 for (
int kr = myRowStart; kr < rowStop; kr++)
128 if (myContents[kr].
size() > colCount)
129 throw std::runtime_error(
132 for (
int kc = 0; kc < colCount; kc++)
134 auto &val = myContents[kr][kc];
144 myRowID.push_back(atoi(val.c_str()));
148 x = 50 + (kc - 1) * colWidth;
153 {x, (kr - myRowStart) * 20,
155 S.line({x + w - 1, (kr - myRowStart) * 20,
156 x + w - 1, (kr - myRowStart + 1) * 20});
161 void registerEventHandlers()
175 wex::eventMsgID::asyncReadComplete,
void click(std::function< void(void)> f, bool propogate=false)
register click event handler
Definition: wex.h:276
The base class for all windex gui elements.
Definition: wex.h:824
std::vector< int > size()
Size of window client area.
Definition: wex.h:1626
eventhandler & events()
Get event handler.
Definition: wex.h:1649
HWND handle()
get window handle
Definition: wex.h:1655
sMouse getMouseStatus()
Get mouse status.
Definition: wex.h:1171
gui()
Construct top level window with no parent.
Definition: wex.h:831
A class that offers application code methods to draw on a window.
Definition: wex.h:525
A read only table of values.
Definition: table.h:27
void rowInc(int i)
Move display window.
Definition: table.h:79
void set(const std::vector< std::string > &val, int colcount)
Set table values.
Definition: table.h:53
void set(const std::vector< std::vector< std::string >> &val)
Set table values.
Definition: table.h:43