Empirical
|
#include <Table.h>
Public Types | |
using | INFO_TYPE = internal::TableInfo |
using | return_t = TableWidget |
Public Member Functions | |
Table (size_t r, size_t c, const std::string &in_id="") | |
Table (const TableWidget &in) | |
Table (const Widget &in) | |
Table (internal::TableInfo *in_info, size_t _row, size_t _col) | |
Table () | |
Table & | Clear () |
Table & | ClearStyle () |
Table & | ClearAttr () |
Table & | ClearListen () |
Table & | ClearExtras () |
Table & | ClearChildren () |
Table & | Rows (size_t r) |
Resize the number of rows in the table. More... | |
Table & | Cols (size_t c) |
Resize the number of columns in the table. More... | |
Table & | Resize (size_t r, size_t c) |
Fully resize the table (both rows and columns) More... | |
Table & | SetColSpan (size_t new_span) |
Setup the number of columns the current column group. More... | |
template<typename SETTING_TYPE > | |
Table & | RowCSS (size_t row_id, const std::string &setting, SETTING_TYPE &&value) |
Apply CSS to target row. More... | |
template<typename SETTING_TYPE > | |
Table & | CellCSS (size_t row_id, size_t col_id, const std::string &setting, SETTING_TYPE &&value) |
Apply CSS to target cell. More... | |
template<typename SETTING_TYPE > | |
Table & | RowsCSS (const std::string &setting, SETTING_TYPE &&value) |
Apply CSS to all rows. (: Should we use fancier jquery here?) More... | |
template<typename SETTING_TYPE > | |
Table & | CellsCSS (const std::string &setting, SETTING_TYPE &&value) |
Apply CSS to all cells. More... | |
size_t | GetNumCols () const |
size_t | GetNumRows () const |
size_t | GetNumCells () const |
virtual void | PrepareAppend () override |
Setup << operator to redirect to Append; option preparation can be overridden. More... | |
size_t | GetCurRow () const |
Determine which row currnetly has focus. More... | |
size_t | GetCurCol () const |
Determine which column currently has focus. More... | |
void | ClearTable () |
void | ClearRows () |
void | ClearRow (size_t r) |
void | ClearCol (size_t c) |
void | ClearRowGroup (size_t r) |
void | ClearColGroup (size_t c) |
void | ClearCells () |
void | ClearCell (size_t r, size_t c) |
TableCell | GetCell (size_t r, size_t c) |
Focus on a specifc cell in the table. More... | |
TableRow | GetRow (size_t r) |
Focus on a specifc row in the table. More... | |
TableCol | GetCol (size_t c) |
Focus on a specifc column in the table. More... | |
TableRowGroup | GetRowGroup (size_t r) |
Focus on a specifc group of rows in the table. More... | |
TableColGroup | GetColGroup (size_t c) |
Focus on a specifc group of columns in the table. More... | |
Table | GetTable () |
Focus on a the entire table. More... | |
web::Text | GetTextWidget () |
Get the TExt widget assoited with the currently active cell. More... | |
Widget | AddText (size_t r, size_t c, const std::string &text) |
Add text to a specified cell in the table. More... | |
Widget | AddHeader (size_t r, size_t c, const std::string &text) |
Set a specified cell to be a table header. More... | |
std::string | GetCSS (const std::string &setting) override |
Get a CSS value for the currently active cell. More... | |
virtual bool | OK (std::stringstream &ss, bool verbose=false, const std::string &prefix="") |
Debugging function. More... | |
return_t & | SetCSS (const std::string &setting, SETTING_TYPE &&value) |
Set a specific CSS value for this widget. More... | |
return_t & | SetCSS (const std::string &setting1, T1 &&val1, const std::string &setting2, T2 &&val2, OTHER_SETTINGS...others) |
Multiple CSS settings can be provided simultaneously. More... | |
return_t & | SetCSS (const Style &in_style) |
return_t & | SetAttr (const std::string &setting, SETTING_TYPE &&value) |
Set a specific Attribute value for this widget. More... | |
return_t & | SetAttr (const std::string &setting1, T1 &&val1, const std::string &setting2, T2 &&val2, OTHER_SETTINGS...others) |
Multiple Attributes can be provided simultaneously. More... | |
return_t & | SetAttr (const Attributes &in_attr) |
return_t & | On (const std::string &event_name, const std::function< void()> &fun) |
return_t & | On (const std::string &event_name, const std::function< void(MouseEvent evt)> &fun) |
return_t & | On (const std::string &event_name, const std::function< void(double, double)> &fun) |
return_t & | OnResize (T &&arg) |
Provide a function to be called when the window is resized. More... | |
return_t & | OnClick (T &&arg) |
Provide a function to be called when the mouse button is clicked in this Widget. More... | |
return_t & | OnDoubleClick (T &&arg) |
Provide a function to be called when the mouse button is double clicked in this Widget. More... | |
return_t & | OnMouseDown (T &&arg) |
Provide a function to be called when the mouse button is pushed down in this Widget. More... | |
return_t & | OnMouseUp (T &&arg) |
Provide a function to be called when the mouse button is released in this Widget. More... | |
return_t & | OnMouseMove (T &&arg) |
Provide a function to be called whenever the mouse moves in this Widget. More... | |
return_t & | OnMouseOut (T &&arg) |
Provide a function to be called whenever the mouse leaves the Widget. More... | |
return_t & | OnMouseOver (T &&arg) |
Provide a function to be called whenever the mouse moves over the Widget. More... | |
return_t & | OnMouseWheel (T &&arg) |
Provide a function to be called whenever the mouse wheel moves in this Widget. More... | |
return_t & | OnKeydown (T &&arg) |
Provide a function to be called whenever a key is pressed down in this Widget. More... | |
return_t & | OnKeypress (T &&arg) |
Provide a function to be called whenever a key is pressed down and released in this Widget. More... | |
return_t & | OnKeyup (T &&arg) |
Provide a function to be called whenever a key is pressed released in this Widget. More... | |
return_t & | OnCopy (T &&arg) |
Provide a function to be called whenever text is copied in this Widget. More... | |
return_t & | OnCut (T &&arg) |
Provide a function to be called whenever text is cut in this Widget. More... | |
return_t & | OnPaste (T &&arg) |
Provide a function to be called whenever text is pasted in this Widget. More... | |
return_t & | SetWidth (double w, const std::string &unit="px") |
return_t & | SetHeight (double h, const std::string &unit="px") |
return_t & | SetSize (double w, double h, const std::string &unit="px") |
return_t & | Center () |
Move this widget to the center of its container. More... | |
return_t & | SetPosition (int x, int y, const std::string &unit="px", const std::string &pos_type="absolute", const std::string &x_anchor="left", const std::string &y_anchor="top") |
Set the x-y position of this widget within its container. More... | |
return_t & | SetPositionRT (int x, int y, const std::string &unit="px") |
Set the x-y position of this Widget within its container, using the TOP-RIGHT as an anchor. More... | |
return_t & | SetPositionRB (int x, int y, const std::string &unit="px") |
Set the x-y position of this Widget within its container, using the BOTTOM-RIGHT as an anchor. More... | |
return_t & | SetPositionLB (int x, int y, const std::string &unit="px") |
Set the x-y position of this Widget within its container, using the BOTTOM-LEFT as an anchor. More... | |
return_t & | SetPositionFixed (int x, int y, const std::string &unit="px") |
Set the x-y position of this Widget, fixed within the browser window. More... | |
return_t & | SetPositionFixedRT (int x, int y, const std::string &unit="px") |
Set the x-y position of the top-right corner this Widget, fixed within the browser window. More... | |
return_t & | SetPositionFixedRB (int x, int y, const std::string &unit="px") |
Set the x-y position of the bottom-right corner this Widget, fixed within the browser window. More... | |
return_t & | SetPositionFixedLB (int x, int y, const std::string &unit="px") |
Set the x-y position of the bottom-left corner this Widget, fixed within the browser window. More... | |
return_t & | SetFloat (const std::string &f="left") |
Set this Widget to float appropriately within its containter. More... | |
return_t & | SetOverflow (const std::string &o="auto") |
Setup how this Widget should handle overflow. More... | |
return_t & | SetScroll () |
Setup how this Widget to always have scrollbars. More... | |
return_t & | SetScrollAuto () |
Setup how this Widget to have scrollbars if needed for overflow. More... | |
return_t & | SetResizable () |
Setup how this Widget to be user-resizable. More... | |
return_t & | SetResizableX () |
Setup how this Widget for the x only to be user-resizable. More... | |
return_t & | SetResizableY () |
Setup how this Widget for the y only to be user-resizable. More... | |
return_t & | SetResizableOff () |
Setup how this Widget to NOT be resizable. More... | |
return_t & | SetFont (const Font &font) |
Provide a Font object to setup the font for this widget. More... | |
return_t & | SetFont (const std::string &font) |
Setup the Font to be used in this Widget. More... | |
return_t & | SetFontSize (int s) |
Setup the size of the Font to be used in this Widget. More... | |
return_t & | SetFontSizeVW (double s) |
Setup the size of the Font to be used in this Widget in units of % of viewport width. More... | |
return_t & | SetCenterText () |
Align text to be centered. More... | |
return_t & | SetBackground (const std::string &v) |
Set the background color of this Widget. More... | |
return_t & | SetColor (const std::string &v) |
Set the foreground color of this Widget. More... | |
return_t & | SetOpacity (double v) |
Set the opacity level of this Widget. More... | |
return_t & | SetBorder (const std::string &border_info) |
Set information about the Widget board. More... | |
return_t & | SetPadding (double p, const std::string &unit="px") |
The the number of pixels (or alternate unit) for the padding around cells (used with Tables) More... | |
bool | IsNull () const |
Test if this widget is valid. More... | |
std::string | InfoTypeName () const |
Some debugging helpers... More... | |
bool | IsInactive () const |
Test if the activity state of this widget is currently INACTIVE. More... | |
bool | IsWaiting () const |
Test if the activity state of this widget is currently WAITING. More... | |
bool | IsFrozen () const |
Test if the activity state of this widget is currently FROZEN. More... | |
bool | IsActive () const |
Test if the activity state of this widget is currently ACTIVE. More... | |
bool | AppendOK () const |
Is it okay to add more internal Widgets into this one? More... | |
void | PreventAppend () |
Disallow further appending to this Widget. More... | |
bool | IsButton () const |
Is this Widget a Button? More... | |
bool | IsCanvas () const |
Is this Widget a Canvas? More... | |
bool | IsImage () const |
Is this Widget an Image? More... | |
bool | IsSelector () const |
Is this Widget a Selector? More... | |
bool | IsDiv () const |
Is this Widget a Div? More... | |
bool | IsTable () const |
Is this Widget a Table? More... | |
bool | IsText () const |
Is this Widget a Text? More... | |
const std::string & | GetID () const |
What is the HTML string ID for this Widget? More... | |
virtual bool | HasCSS (const std::string &setting) |
Determine is a CSS trait has been set on this Widget. More... | |
virtual std::string | GetAttr (const std::string &setting) |
Retrieve a specific attribute associated with this Widget. More... | |
virtual bool | HasAttr (const std::string &setting) |
Determine is an attribute has been set on this Widget. More... | |
bool | operator== (const Widget &in) const |
Are two Widgets refering to the same HTML object? More... | |
bool | operator!= (const Widget &in) const |
Are two Widgets refering to differnt HTML objects? More... | |
operator bool () const | |
Conver Widget to bool (I.e., is this Widget active?) More... | |
double | GetXPos () |
Get the X-position of this Widget within its parent. More... | |
double | GetYPos () |
Get the Y-position of this Widget within its parent. More... | |
double | GetWidth () |
Get the width of this Widget on screen. More... | |
double | GetHeight () |
Get the height of this Widget on screen. More... | |
double | GetInnerWidth () |
Get the width of this Widget not including padding. More... | |
double | GetInnerHeight () |
Get the height of this Widget not including padding. More... | |
double | GetOuterWidth () |
Get the width of this Widget including all padding. More... | |
double | GetOuterHeight () |
Get the height of this Widget including all padding. More... | |
void | Activate () |
Make this widget live, so changes occur immediately (once document is ready) More... | |
void | Freeze () |
Record changes internally, but keep static screen until Activate() is called. More... | |
virtual void | Deactivate (bool top_level=true) |
bool | ToggleActive () |
Doggle between Active and Deactivated. More... | |
void | Redraw () |
Clear and redraw the current widget on the screen. More... | |
Widget & | Find (const std::string &test_name) |
Look up previously created elements, by type. More... | |
Widget & | AddDependant (const Widget &w) |
Add a dependant to this Widget that should be redrawn when it is. More... | |
template<typename IN_TYPE > | |
Widget | operator<< (IN_TYPE &&in_val) |
std::string | GetInfoType () const |
Debug... More... | |
Protected Types | |
using | parent_t = internal::WidgetFacet< TableWidget > |
enum | ActivityState { INACTIVE, WAITING, FROZEN, ACTIVE } |
using | WidgetInfo = internal::WidgetInfo |
Protected Member Functions | |
internal::TableInfo * | Info () |
Get a properly cast version of info. More... | |
const internal::TableInfo * | Info () const |
void | DoCSS (const std::string &setting, const std::string &value) override |
Apply CSS to appropriate component based on current state. More... | |
void | DoAttr (const std::string &setting, const std::string &value) override |
Apply CSS to appropriate component based on current state. More... | |
void | DoListen (const std::string &event_name, size_t fun_id) override |
Apply CSS to appropriate component based on current state. More... | |
template<typename FWD_TYPE > | |
Widget & | ForwardAppend (FWD_TYPE &&arg) |
If an Append doesn't work with current class, forward it to the parent and try there. More... | |
Widget & | SetInfo (WidgetInfo *in_info) |
Set the information associated with this widget. More... | |
WidgetInfo * | operator-> () |
Internally, we can treat a Widget as a pointer to its WidgetInfo. More... | |
Static Protected Member Functions | |
static WidgetInfo * | Info (const Widget &w) |
Give derived classes the ability to access widget info. More... | |
Protected Attributes | |
size_t | cur_row |
size_t | cur_col |
WidgetInfo * | info |
Information associated with this widget. More... | |
Static Protected Attributes | |
static const std::string | no_name = "(none)" |
Default name for un-initialized widgets. More... | |
|
inherited |
|
protectedinherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inherited |
Make this widget live, so changes occur immediately (once document is ready)
Add a dependant to this Widget that should be redrawn when it is.
|
inherited |
Set a specified cell to be a table header.
|
inherited |
Add text to a specified cell in the table.
|
inherited |
Is it okay to add more internal Widgets into this one?
|
inline |
Apply CSS to target cell.
|
inline |
Apply CSS to all cells.
|
inlineinherited |
Move this widget to the center of its container.
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inline |
Resize the number of columns in the table.
|
virtualinherited |
Record changes internally and REMOVE from screen until Activate is called. (Argument is for recursive, internal use only.)
Reimplemented in emp::web::Div.
|
inlineoverrideprotectedvirtualinherited |
Apply CSS to appropriate component based on current state.
Reimplemented from emp::web::internal::WidgetFacet< TableWidget >.
|
inlineoverrideprotectedvirtualinherited |
Apply CSS to appropriate component based on current state.
Reimplemented from emp::web::internal::WidgetFacet< TableWidget >.
|
inlineoverrideprotectedvirtualinherited |
Apply CSS to appropriate component based on current state.
Reimplemented from emp::web::internal::WidgetFacet< TableWidget >.
|
inherited |
Look up previously created elements, by type.
|
protectedinherited |
If an Append doesn't work with current class, forward it to the parent and try there.
|
inherited |
Record changes internally, but keep static screen until Activate() is called.
|
virtualinherited |
Retrieve a specific attribute associated with this Widget.
|
inherited |
Focus on a specifc cell in the table.
|
inherited |
Focus on a specifc column in the table.
|
inherited |
Focus on a specifc group of columns in the table.
|
inlineoverridevirtualinherited |
Get a CSS value for the currently active cell.
Reimplemented from emp::web::Widget.
|
inlineinherited |
Determine which column currently has focus.
|
inlineinherited |
Determine which row currnetly has focus.
|
inherited |
Get the height of this Widget on screen.
|
inherited |
What is the HTML string ID for this Widget?
|
inherited |
Debug...
|
inherited |
Get the height of this Widget not including padding.
|
inherited |
Get the width of this Widget not including padding.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Get the height of this Widget including all padding.
|
inherited |
Get the width of this Widget including all padding.
|
inherited |
Focus on a specifc row in the table.
|
inherited |
Focus on a specifc group of rows in the table.
|
inherited |
Focus on a the entire table.
|
inlineinherited |
Get the TExt widget assoited with the currently active cell.
|
inherited |
Get the width of this Widget on screen.
|
inherited |
Get the X-position of this Widget within its parent.
|
inherited |
Get the Y-position of this Widget within its parent.
|
virtualinherited |
Determine is an attribute has been set on this Widget.
|
virtualinherited |
Determine is a CSS trait has been set on this Widget.
|
inlinestaticprotectedinherited |
Give derived classes the ability to access widget info.
|
inlineprotectedinherited |
Get a properly cast version of info.
|
inlineprotectedinherited |
|
inherited |
Some debugging helpers...
|
inherited |
Test if the activity state of this widget is currently ACTIVE.
|
inherited |
Test if the activity state of this widget is currently FROZEN.
|
inherited |
Test if the activity state of this widget is currently INACTIVE.
|
inlineinherited |
Test if this widget is valid.
|
inherited |
Test if the activity state of this widget is currently WAITING.
|
inlinevirtualinherited |
Debugging function.
|
inlineinherited |
Provide an event and a function that will be called when that event is triggered. In this case, the function as no arguments.
|
inlineinherited |
Provide an event and a function that will be called when that event is triggered. In this case, the function takes a mouse event as an argument, with full info about mouse.
|
inlineinherited |
Provide an event and a function that will be called when that event is triggered. In this case, the function takes two doubles which will be filled in with mouse coordinates.
|
inlineinherited |
Provide a function to be called when the mouse button is clicked in this Widget.
|
inlineinherited |
Provide a function to be called whenever text is copied in this Widget.
|
inlineinherited |
Provide a function to be called whenever text is cut in this Widget.
|
inlineinherited |
Provide a function to be called when the mouse button is double clicked in this Widget.
|
inlineinherited |
Provide a function to be called whenever a key is pressed down in this Widget.
|
inlineinherited |
Provide a function to be called whenever a key is pressed down and released in this Widget.
|
inlineinherited |
Provide a function to be called whenever a key is pressed released in this Widget.
|
inlineinherited |
Provide a function to be called when the mouse button is pushed down in this Widget.
|
inlineinherited |
Provide a function to be called whenever the mouse moves in this Widget.
|
inlineinherited |
Provide a function to be called whenever the mouse leaves the Widget.
|
inlineinherited |
Provide a function to be called whenever the mouse moves over the Widget.
|
inlineinherited |
Provide a function to be called when the mouse button is released in this Widget.
|
inlineinherited |
Provide a function to be called whenever the mouse wheel moves in this Widget.
|
inlineinherited |
Provide a function to be called whenever text is pasted in this Widget.
|
inlineinherited |
Provide a function to be called when the window is resized.
|
inlineinherited |
|
inlineinherited |
Are two Widgets refering to differnt HTML objects?
|
inlineprotectedinherited |
Internally, we can treat a Widget as a pointer to its WidgetInfo.
|
inherited |
|
inlineinherited |
Are two Widgets refering to the same HTML object?
|
inlineoverridevirtualinherited |
Setup << operator to redirect to Append; option preparation can be overridden.
Reimplemented from emp::web::Widget.
|
inherited |
Disallow further appending to this Widget.
|
inherited |
Clear and redraw the current widget on the screen.
|
inline |
Fully resize the table (both rows and columns)
|
inline |
Apply CSS to target row.
|
inline |
Resize the number of rows in the table.
|
inline |
Apply CSS to all rows. (: Should we use fancier jquery here?)
|
inlineinherited |
Set a specific Attribute value for this widget.
|
inlineinherited |
Multiple Attributes can be provided simultaneously.
|
inlineinherited |
Allow multiple Attr settings to be provided as a single object. (still go through DoAttr given need for virtual re-routing.)
|
inlineinherited |
Set the background color of this Widget.
|
inlineinherited |
Set information about the Widget board.
|
inlineinherited |
Align text to be centered.
|
inlineinherited |
Set the foreground color of this Widget.
|
inline |
Setup the number of columns the current column group.
|
inlineinherited |
Set a specific CSS value for this widget.
|
inlineinherited |
Multiple CSS settings can be provided simultaneously.
|
inlineinherited |
Allow multiple CSS settings to be provided as a single object. (still go through DoCSS given need for virtual re-routing.)
|
inlineinherited |
Set this Widget to float appropriately within its containter.
|
inlineinherited |
Provide a Font object to setup the font for this widget.
|
inlineinherited |
Setup the Font to be used in this Widget.
|
inlineinherited |
Setup the size of the Font to be used in this Widget.
|
inlineinherited |
Setup the size of the Font to be used in this Widget in units of % of viewport width.
|
inlineinherited |
Update the height of this Widget.
unit | defaults to pixels ("px"), but can also be a measured distance (e.g, "inches") or a percentage("%") |
|
protectedinherited |
Set the information associated with this widget.
|
inlineinherited |
Set the opacity level of this Widget.
|
inlineinherited |
Setup how this Widget should handle overflow.
|
inlineinherited |
The the number of pixels (or alternate unit) for the padding around cells (used with Tables)
|
inlineinherited |
Set the x-y position of this widget within its container.
|
inlineinherited |
Set the x-y position of this Widget, fixed within the browser window.
|
inlineinherited |
Set the x-y position of the bottom-left corner this Widget, fixed within the browser window.
|
inlineinherited |
Set the x-y position of the bottom-right corner this Widget, fixed within the browser window.
|
inlineinherited |
Set the x-y position of the top-right corner this Widget, fixed within the browser window.
|
inlineinherited |
Set the x-y position of this Widget within its container, using the BOTTOM-LEFT as an anchor.
|
inlineinherited |
Set the x-y position of this Widget within its container, using the BOTTOM-RIGHT as an anchor.
|
inlineinherited |
Set the x-y position of this Widget within its container, using the TOP-RIGHT as an anchor.
|
inlineinherited |
Setup how this Widget to be user-resizable.
|
inlineinherited |
Setup how this Widget to NOT be resizable.
|
inlineinherited |
Setup how this Widget for the x only to be user-resizable.
|
inlineinherited |
Setup how this Widget for the y only to be user-resizable.
|
inlineinherited |
Setup how this Widget to always have scrollbars.
|
inlineinherited |
Setup how this Widget to have scrollbars if needed for overflow.
|
inlineinherited |
Update the size (width and height) of this widget.
unit | defaults to pixels ("px"), but can also be a measured distance (e.g, "inches") or a percentage("%") |
|
inlineinherited |
Update the width of this Widget.
unit | defaults to pixels ("px"), but can also be a measured distance (e.g, "inches") or a percentage("%") |
|
inherited |
Doggle between Active and Deactivated.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Information associated with this widget.
|
staticprotectedinherited |
Default name for un-initialized widgets.