31 myRowDisplayCount(25),
36 registerEventHandlers();
45 void set(
const std::vector<std::vector<std::string>> &val)
55 void set(
const std::vector<std::string> &val,
int colcount)
57 std::vector<std::vector<std::string>> vvs;
60 row < val.size() / colcount;
63 std::vector<std::string> vrow;
64 for (
int col = 0; col < colcount; col++)
72 vrow.push_back(val[row * colcount + col]);
90 myRowStart = myContents.size() - 1;
93 void rowHiLit(
int k )
99 std::vector<std::vector<std::string>> myContents;
100 std::vector<int> myRowID;
101 int myRowDisplayCount;
109 if (!myContents.size())
112 int colCount = myContents[0].size();
115 colWidth =
size()[0];
117 colWidth =
size()[0] / (colCount - 1);
119 if (myContents.size() < 20)
122 rowStop = myContents.size();
126 if (myRowStart > myContents.size() - 20)
127 myRowStart = myContents.size() - 20;
128 rowStop = myRowStart + 30;
129 if (rowStop > myContents.size())
130 rowStop = myContents.size();
134 for (
int kr = myRowStart; kr < rowStop; kr++)
136 if (myContents[kr].
size() > colCount)
137 throw std::runtime_error(
140 if( kr == myRowHiLit )
145 for (
int kc = 0; kc < colCount; kc++)
147 auto &val = myContents[kr][kc];
157 myRowID.push_back(atoi(val.c_str()));
161 x = 50 + (kc - 1) * colWidth;
166 {x, (kr - myRowStart) * 20,
168 int xline = x + w - 10;
169 S.line({xline, (kr - myRowStart) * 20,
170 xline, (kr - myRowStart + 1) * 20});
175 void registerEventHandlers()
189 wex::eventMsgID::asyncReadComplete,
void click(std::function< void(void)> f, bool propogate=false)
register click event handler
Definition: wex.h:280
The base class for all windex gui elements.
Definition: wex.h:900
std::vector< int > size()
Size of window client area.
Definition: wex.h:1719
eventhandler & events()
Get event handler.
Definition: wex.h:1742
HWND handle()
get window handle
Definition: wex.h:1748
sMouse getMouseStatus()
Get mouse status.
Definition: wex.h:1247
gui()
Construct top level window with no parent.
Definition: wex.h:907
A class that offers application code methods to draw on a window.
Definition: wex.h:529
A read only table of values.
Definition: table.h:27
void rowInc(int i)
Move display window.
Definition: table.h:81
void set(const std::vector< std::string > &val, int colcount)
Set table values.
Definition: table.h:55
void set(const std::vector< std::vector< std::string >> &val)
Set table values.
Definition: table.h:45