Dillo v3.1.1-98-g318d1f14
|
A Widget for rendering tables. More...
#include <table.hh>
Classes | |
struct | Cell |
struct | Child |
struct | SpanSpace |
class | TableIterator |
Public Member Functions | |
Table (bool limitTextWidth) | |
~Table () | |
int | applyPerWidth (int containerWidth, core::style::Length perWidth) |
int | applyPerHeight (int containerHeight, core::style::Length perHeight) |
core::Iterator * | iterator (core::Content::Type mask, bool atEnd) |
Return an iterator for this widget. | |
void | addCell (Widget *widget, int colspan, int rowspan) |
void | addRow (core::style::Style *style) |
AlignedTableCell * | getCellRef () |
Public Member Functions inherited from dw::oof::OOFAwareWidget | |
OOFAwareWidget () | |
~OOFAwareWidget () | |
core::Requisition * | getRequisitionWithoutOOF () |
bool | doesWidgetOOFInterruptDrawing (Widget *widget) |
void | draw (core::View *view, core::Rectangle *area, core::DrawingContext *context) |
Area is given in widget coordinates. | |
virtual void | updateReference (int ref) |
Update content in flow, down from ref . | |
virtual void | widgetRefSizeChanged (int externalIndex) |
Called by an implementation of dw::oof::OutOfFlowMgr (actually only OOFPosRelMgr) for the generator of a widget out of flow, when the reference size has changed. | |
virtual void | oofSizeChanged (bool extremesChanged) |
Called by an implementation of dw::oof::OutOfFlowMgr when the size of the container has changed, typically in sizeAllocateEnd. | |
virtual int | getGeneratorX (int oofmIndex) |
Return position relative to container, not regarding margin/border/padding, Called by OOFFloatsMgr to position floats. | |
virtual int | getGeneratorY (int oofmIndex) |
Return position relative to container, not regarding margin/border/padding, Called by OOFFloatsMgr to position floats. | |
virtual int | getGeneratorWidth () |
Return width including margin/border/padding Called by OOFFloatsMgr to position floats. | |
virtual int | getMaxGeneratorWidth () |
virtual bool | usesMaxGeneratorWidth () |
virtual bool | isPossibleOOFContainer (int oofmIndex) |
virtual bool | isPossibleOOFContainerParent (int oofmIndex) |
Public Member Functions inherited from dw::core::Widget | |
void | setDeleteCallback (DW_Callback_t func, void *data) |
Widget () | |
~Widget () | |
bool | resizeQueued () |
bool | extremesQueued () |
bool | needsResize () |
bool | needsAllocate () |
bool | allocateQueued () |
bool | extremesChanged () |
bool | wasAllocated () |
void | setParent (Widget *parent) |
void | setQuasiParent (Widget *quasiParent) |
void | setGenerator (Widget *generator) |
style::Style * | getStyle () |
Allocation * | getAllocation () |
bool | inAllocation (int x, int y) |
int | boxOffsetX () |
int | boxRestWidth () |
int | boxDiffWidth () |
int | boxOffsetY () |
int | boxRestHeight () |
int | boxDiffHeight () |
virtual int | numSizeRequestReferences () |
See Sizes of Dillo Widgets (or Size requisitions depending on positions). | |
virtual Widget * | sizeRequestReference (int index) |
See Sizes of Dillo Widgets (or Size requisitions depending on positions). | |
virtual int | numGetExtremesReferences () |
See Sizes of Dillo Widgets (or Size requisitions depending on positions). | |
virtual Widget * | getExtremesReference (int index) |
See Sizes of Dillo Widgets (or Size requisitions depending on positions). | |
void | sizeRequest (Requisition *requisition, int numPos=0, Widget **references=NULL, int *x=NULL, int *y=NULL) |
This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed. | |
void | getExtremes (Extremes *extremes, int numPos=0, Widget **references=NULL, int *x=NULL, int *y=NULL) |
Wrapper for Widget::getExtremesImpl(). | |
void | sizeAllocate (Allocation *allocation) |
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed. | |
void | calcExtraSpace (int numPos, Widget **references, int *x, int *y) |
Calculates dw::core::Widget::extraSpace. | |
int | getAvailWidth (bool forceValue) |
Return available width including margin/border/padding (extraSpace?), not only the content width. | |
int | getAvailHeight (bool forceValue) |
Return available height including margin/border/padding (extraSpace?), not only the content height. | |
void | correctRequisition (Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight) |
void | correctExtremes (Extremes *extremes, bool useAdjustmentWidth) |
int | calcWidth (style::Length cssValue, int refWidth, Widget *refWidget, int limitMinWidth, bool forceValue) |
Computes a width value in pixels from cssValue. | |
void | calcFinalWidth (style::Style *style, int refWidth, Widget *refWidget, int limitMinWidth, bool forceValue, int *finalWidth) |
Computes the final width if posible and constraints it by min-width and max-width. | |
int | calcHeight (style::Length cssValue, bool usePercentage, int refHeight, Widget *refWidget, bool forceValue) |
int | getMinWidth (Extremes *extremes, bool forceValue) |
Used to evaluate Widget::adjustMinWidth. | |
virtual bool | isPossibleContainer () |
void | containerSizeChanged () |
bool | intersects (Widget *refWidget, Rectangle *area, Rectangle *intersection) |
Calculates the intersection of the visible allocation (i. | |
void | drawInterruption (View *view, Rectangle *area, DrawingContext *context) |
See Interrupted drawing for details. | |
Widget * | getWidgetAtPointInterrupted (int x, int y, GettingWidgetAtPointContext *context) |
bool | buttonPress (EventButton *event) |
bool | buttonRelease (EventButton *event) |
bool | motionNotify (EventMotion *event) |
void | enterNotify (EventCrossing *event) |
void | leaveNotify (EventCrossing *event) |
virtual void | setStyle (style::Style *style) |
Change the style of a widget. | |
void | setBgColor (style::Color *bgColor) |
Set the background "behind" the widget, if it is not the background of the parent widget, e.g. | |
style::Color * | getBgColor () |
Get the actual background of a widget. | |
style::Color * | getFgColor () |
Get the actual foreground color of a widget. | |
void | drawBox (View *view, style::Style *style, Rectangle *area, int x, int y, int width, int height, bool inverse) |
Draw borders and background of a widget part, which allocation is given by (x, y, width, height) (widget coordinates). | |
void | drawWidgetBox (View *view, Rectangle *area, bool inverse) |
Draw borders and background of a widget. | |
void | drawSelected (View *view, Rectangle *area) |
void | setButtonSensitive (bool buttonSensitive) |
bool | isButtonSensitive () |
Widget * | getParent () |
Widget * | getContainer () |
Widget * | getTopLevel () |
Get the widget at the root of the tree, this widget is part from. | |
int | getLevel () |
Get the level of the widget within the tree. | |
int | getGeneratorLevel () |
Get the level of the widget within the tree, regarting the generators, not the parents. | |
Widget * | getNearestCommonAncestor (Widget *otherWidget) |
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2. | |
WidgetReference * | getWidgetReference () |
void | setWidgetReference (WidgetReference *widgetReference) |
Widget * | getGenerator () |
Layout * | getLayout () |
void | scrollTo (HPosition hpos, VPosition vpos, int x, int y, int width, int height) |
void | getMarginArea (int *xMar, int *yMar, int *widthMar, int *heightMar) |
void | getBorderArea (int *xBor, int *yBor, int *widthBor, int *heightBor) |
void | getPaddingArea (int *xPad, int *yPad, int *widthPad, int *heightPad) |
Return the padding area (content plus padding). | |
virtual void | removeChild (Widget *child) |
Public Member Functions inherited from lout::identity::IdentifiableObject | |
IdentifiableObject () | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. | |
int | getClassId () |
Returns the class identifier. | |
const char * | getClassName () |
Return the name, under which the class of this object was registered. | |
bool | instanceOf (int otherClassId) |
Returns, whether this class is an instance of the class, given by otherClassId, or of a sub class of this class. | |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. | |
virtual int | hashValue () |
Return a hash value for the object. | |
virtual Object * | clone () |
Return an exact copy of the object. | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. | |
Static Public Attributes | |
static int | CLASS_ID = -1 |
Static Public Attributes inherited from dw::oof::OOFAwareWidget | |
static int | CLASS_ID = -1 |
Static Public Attributes inherited from dw::core::Widget | |
static int | CLASS_ID = -1 |
Protected Member Functions | |
void | sizeRequestSimpl (core::Requisition *requisition) |
Simple variant, to be implemented by widgets with sizes not depending on positions. | |
void | getExtremesSimpl (core::Extremes *extremes) |
Simple variant, to be implemented by widgets with extremes not depending on positions. | |
void | sizeAllocateImpl (core::Allocation *allocation) |
See Sizes of Dillo Widgets. | |
void | resizeDrawImpl () |
Called after sizeAllocateImpl() to redraw necessary areas. | |
bool | getAdjustMinWidth () |
int | getAvailWidthOfChild (Widget *child, bool forceValue) |
void | containerSizeChangedForChildren () |
bool | affectsSizeChangeContainerChild (Widget *child) |
bool | usesAvailWidth () |
Must be implemengted by a method returning true, when getAvailWidth() is called. | |
bool | isBlockLevel () |
void | drawLevel (core::View *view, core::Rectangle *area, int level, core::DrawingContext *context) |
Widget * | getWidgetAtPointLevel (int x, int y, int level, core::GettingWidgetAtPointContext *context) |
void | removeChild (Widget *child) |
Protected Member Functions inherited from dw::oof::OOFAwareWidget | |
bool | isParentRefOOF (int parentRef) |
int | makeParentRefInFlow (int inFlowSubRef) |
int | getParentRefInFlowSubRef (int parentRef) |
int | makeParentRefOOF (int oofmIndex, int oofmSubRef) |
int | getParentRefOOFSubRef (int parentRef) |
int | getParentRefOOFIndex (int parentRef) |
oof::OutOfFlowMgr * | getParentRefOutOfFlowMgr (int parentRef) |
bool | isWidgetOOF (Widget *widget) |
int | getWidgetInFlowSubRef (Widget *widget) |
int | getWidgetOOFSubRef (Widget *widget) |
int | getWidgetOOFIndex (Widget *widget) |
oof::OutOfFlowMgr * | getWidgetOutOfFlowMgr (Widget *widget) |
OutOfFlowMgr * | searchOutOfFlowMgr (int oofmIndex) |
void | initOutOfFlowMgrs () |
void | correctRequisitionByOOF (core::Requisition *requisition, void(*splitHeightFun)(int, int *, int *)) |
void | correctExtremesByOOF (core::Extremes *extremes) |
void | sizeAllocateStart (core::Allocation *allocation) |
void | sizeAllocateEnd () |
void | containerSizeChangedForChildrenOOF () |
void | drawOOF (core::View *view, core::Rectangle *area, core::DrawingContext *context) |
Widget * | getWidgetAtPoint (int x, int y, core::GettingWidgetAtPointContext *context) |
Widget * | getWidgetOOFAtPoint (int x, int y, core::GettingWidgetAtPointContext *context) |
void | notifySetAsTopLevel () |
This method is called after a widget has been set as the top of a widget tree. | |
void | notifySetParent () |
This method is called after a widget has been added to a parent. | |
void | removeChild (Widget *child) |
virtual bool | adjustExtraSpaceWhenCorrectingRequisitionByOOF () |
Protected Member Functions inherited from dw::core::Widget | |
int | getHeight () |
int | getContentWidth () |
int | getContentHeight () |
StackingContextMgr * | getNextStackingContextMgr () |
void | printFlag (Flags f) |
void | setFlags (Flags f) |
void | unsetFlags (Flags f) |
void | queueDraw () |
void | queueDrawArea (int x, int y, int width, int height) |
void | queueResize (int ref, bool extremesChanged) |
virtual void | sizeRequestImpl (Requisition *requisition, int numPos, Widget **references, int *x, int *y) |
See Sizes of Dillo Widgets. | |
virtual void | getExtremesImpl (Extremes *extremes, int numPos, Widget **references, int *x, int *y) |
See Sizes of Dillo Widgets. | |
virtual void | calcExtraSpaceImpl (int numPos, Widget **references, int *x, int *y) |
The actual implementation for calculating dw::core::Widget::extraSpace. | |
virtual void | markSizeChange (int ref) |
See Sizes of Dillo Widgets. | |
virtual void | markExtremesChange (int ref) |
See Sizes of Dillo Widgets. | |
virtual int | getAvailWidthOfChild (Widget *child, bool forceValue) |
Computes the content width available of a child widget. | |
virtual int | getAvailHeightOfChild (Widget *child, bool forceValue) |
virtual void | correctRequisitionOfChild (Widget *child, Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight) |
void | correctRequisitionViewport (Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight) |
Corrects a requisition to fit in the viewport. | |
void | correctReqWidthOfChild (Widget *child, Requisition *requisition, bool allowDecreaseWidth) |
Correct a child requisition to fit the parent. | |
void | correctReqHeightOfChild (Widget *child, Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseHeight) |
bool | correctReqAspectRatio (int pass, Widget *child, Requisition *requisition, bool allowDecreaseWidth, bool allowDecreaseHeight, void(*splitHeightFun)(int, int *, int *)) |
Correct a child requisition aspect ratio if needed. | |
virtual void | correctExtremesOfChild (Widget *child, Extremes *extremes, bool useAdjustmentWidth) |
virtual bool | affectedByContainerSizeChange () |
virtual bool | affectsSizeChangeContainerChild (Widget *child) |
virtual bool | usesAvailHeight () |
Must be implemengted by a method returning true, when getAvailHeight() is called. | |
virtual bool | buttonPressImpl (EventButton *event) |
virtual bool | buttonReleaseImpl (EventButton *event) |
virtual bool | motionNotifyImpl (EventMotion *event) |
virtual void | enterNotifyImpl (EventCrossing *event) |
virtual void | leaveNotifyImpl (EventCrossing *event) |
char * | addAnchor (const char *name) |
char * | addAnchor (const char *name, int y) |
void | changeAnchor (char *name, int y) |
void | removeAnchor (char *name) |
void | setCursor (style::Cursor cursor) |
bool | selectionHandleEvent (SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event) |
Protected Member Functions inherited from lout::identity::IdentifiableObject | |
void | registerName (const char *className, int *classId) |
This method must be called in the constructor for the sub class. | |
Private Types | |
enum | ExtrMod { MIN , MIN_INTR , MIN_MIN , MAX_MIN , MAX , MAX_INTR , DATA } |
Private Member Functions | |
const char * | getExtrModName (ExtrMod mod) |
int | getExtreme (core::Extremes *extremes, ExtrMod mod) |
void | setExtreme (core::Extremes *extremes, ExtrMod mod, int value) |
int | getColExtreme (int col, ExtrMod mod, void *data) |
void | setColExtreme (int col, ExtrMod mod, void *data, int value) |
bool | childDefined (int n) |
int | calcAvailWidthForDescendant (Widget *child) |
void | reallocChildren (int newNumCols, int newNumRows) |
void | calcCellSizes (bool calcHeights) |
void | forceCalcCellSizes (bool calcHeights) |
void | actuallyCalcCellSizes (bool calcHeights) |
void | apportionRowSpan () |
void | forceCalcColumnExtremes () |
Fills dw::Table::colExtremes in all cases. | |
void | calcExtremesSpanMultiCols (int col, int cs, core::Extremes *cellExtremes, ExtrMod minExtrMod, ExtrMod maxExtrMod, void *extrData) |
void | calcAdjustmentWidthSpanMultiCols (int col, int cs, core::Extremes *cellExtremes) |
void | apportion2 (int totalWidth, int firstCol, int lastCol, ExtrMod minExtrMod, ExtrMod maxExtrMod, void *extrData, lout::misc::SimpleVector< int > *dest, int destOffset) |
Actual apportionment function. | |
void | setCumHeight (int row, int value) |
Private Attributes | |
bool | limitTextWidth |
bool | rowClosed |
int | numRows |
int | numCols |
int | curRow |
int | curCol |
lout::misc::SimpleVector< Child * > * | children |
int | redrawX |
int | redrawY |
lout::misc::SimpleVector< core::Extremes > * | colExtremes |
The extremes of all columns. | |
lout::misc::SimpleVector< bool > * | colWidthSpecified |
Wether the column itself (in the future?) or at least one cell in this column or spanning over this column has CSS 'width' specified. | |
int | numColWidthSpecified |
lout::misc::SimpleVector< bool > * | colWidthPercentage |
Wether the column itself (in the future?) or at least one cell in this column or spanning over this column has CSS 'width' specified as percentage value. | |
int | numColWidthPercentage |
lout::misc::SimpleVector< int > * | colWidths |
The widths of all columns. | |
lout::misc::SimpleVector< int > * | cumHeight |
Row cumulative height array: cumHeight->size() is numRows + 1, cumHeight->get(0) is 0, cumHeight->get(numRows) is the total table height. | |
lout::misc::SimpleVector< int > * | rowSpanCells |
If a Cell has rowspan > 1, it goes into this array. | |
lout::misc::SimpleVector< int > * | baseline |
lout::misc::SimpleVector< core::style::Style * > * | rowStyle |
bool | colWidthsUpToDateWidthColExtremes |
Static Private Attributes | |
static bool | adjustTableMinWidth = true |
Friends | |
class | TableIterator |
Additional Inherited Members | |
Public Types inherited from dw::oof::OOFAwareWidget | |
enum | { SL_START , SL_BACKGROUND , SL_SC_BOTTOM , SL_IN_FLOW , SL_OOF_REF , SL_OOF_CONT , SL_SC_TOP , SL_END } |
Public Attributes inherited from dw::core::Widget | |
int | parentRef |
This value is defined by the parent widget, and used for incremential resizing. | |
Protected Types inherited from dw::oof::OOFAwareWidget | |
enum | { OOFM_FLOATS , OOFM_ABSOLUTE , OOFM_RELATIVE , OOFM_FIXED , NUM_OOFM } |
enum | { PARENT_REF_OOFM_BITS = 3 , PARENT_REF_OOFM_MASK = (1 << PARENT_REF_OOFM_BITS) - 1 } |
Protected Types inherited from dw::core::Widget | |
enum | Flags { RESIZE_QUEUED = 1 << 0 , EXTREMES_QUEUED = 1 << 1 , NEEDS_RESIZE = 1 << 2 , NEEDS_ALLOCATE = 1 << 3 , ALLOCATE_QUEUED = 1 << 4 , EXTREMES_CHANGED = 1 << 5 , WAS_ALLOCATED = 1 << 6 } |
Static Protected Member Functions inherited from dw::oof::OOFAwareWidget | |
static int | getOOFMIndex (Widget *widget) |
static bool | isOOFContainer (Widget *widget, int oofmIndex) |
Protected Attributes inherited from dw::oof::OOFAwareWidget | |
OOFAwareWidget * | oofContainer [NUM_OOFM] |
OutOfFlowMgr * | outOfFlowMgr [NUM_OOFM] |
core::Requisition | requisitionWithoutOOF |
Protected Attributes inherited from dw::core::Widget | |
WidgetImgRenderer * | widgetImgRenderer |
Allocation | allocation |
The current allocation: size and position, always relative to the canvas. | |
float | ratio |
Preferred aspect ratio of the widget. | |
Layout * | layout |
style::Box | extraSpace |
Space around the margin box. | |
StackingContextMgr * | stackingContextMgr |
Set iff this widget constitutes a stacking context, as defined by CSS. | |
Widget * | stackingContextWidget |
The bottom-most ancestor (or this) for which stackingContextMgr is set. | |
Static Protected Attributes inherited from dw::oof::OOFAwareWidget | |
static const char * | OOFM_NAME [NUM_OOFM] |
A Widget for rendering tables.
The dw::Table widget is used to render HTML tables.
Each cell is itself a separate widget. Any widget may be used, however, in dillo, only instances of dw::Textblock and dw::TableCell are used as children of dw::Table.
The following diagram shows the dependencies between the different functions, which are related to size calculation. Click on the boxes for more information.
[A] In this case, the new calculation is not forced, but only done, when necessary.
[B] In this case, the new calculation is allways necessary, since [C] is the case.
[C] Whether this function is called, depends on NEEDS_RESIZE / RESIZE_QUEUED / EXTREMES_CHANGED / EXTREMES_QUEUED.
TODO:
[cC]alcCellSizes (calcHeights = *false)
not necessary anymore?Given two array and , which represent the column minima and maxima, and a total width , apportionment means to calculate column widths , with
and
There are different algorithms for apportionment, a simple one is recommended in the HTML 4.0.1 specification (http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2.2):
This one is used currently, but another one will be used soon, which is described below. The rest of this chapter is independent of the exact apportionment algorithm.
When referring to the apportionment function, we will call it and write something like this:
It is implemented by dw::Table::apportion.
The sizes, which all other sizes depend on, are column extremes, which define, how wide a column may be at min and at max. They are calculated in the following way:
First, only cells with colspan = 1 are regarded:
only for cells with colspan = 1.
Then, (but not ) are calculated from cells with colspan > 1. (In the following formulas, the cell at always span from to .) If the minimal width of the column exceeds the sum of the column minima calculated in the last step:
then the minimal width of this cell is apportioned to the columns:
then is apportioned in a simple way:
After this, is then the maximum of all .
Finally, the maximum of both is used.
For the maxima, there is no , but it has to be assured, that the maximum is always greater than or equal to the minimum.
Generally, if absolute widths are specified, they are, instead of the results of dw::core::Widget::getExtremes, taken for the minimal and maximal width of a cell (minus the box difference, i.e. the difference between content size and widget size). If the content width specification is smaller than the minimal content width of the widget (determined by dw::core::Widget::getExtremes), the latter is used instead.
If percentage widths are specified, they are also collected, as column maxima. A similar method as for the extremes is used, for cells with colspan > 1:
The total width is
In any case, it is corrected, if it is less than the minimal width (but not if it is greater than the maximal width).
Details on differences because of styles are omitted. Below, this total width is called .
The following algorithms are used to solve collisions between different size specifications (absolute and percentage). Generally, inherent sizes and specified absolute sizes are preferred.
First, calculate the sum of the minimal widths, for columns, where no percentage width has been specified. The difference to the total width is at max available to the columns with percentage width specifications:
with only those columns with no percentage width specification.
Then, calculate the sum of the widths, which the columns with percentage width specification would allocate, when fully adhering to them:
with only those columns with a percentage width specification.
Two cases are distinguished:
: In this case, the percentage widths can be used without any modification, by setting the extremes:
for only those columns with a percentage width specification.
with
in both cases for only those columns with a percentage width specification.
( and are set temporarily here, the notation should be a bit clearer.)
The column widths are now simply calculated by applying the apportionment function.
...
The algorithm described here tends to result in more homogeneous column widths.
The following rule leads to well-defined : All columns have have the same width , except:
Furthermore, is
Of course, must be the case.
Based on an initial value , can iteratively adjusted, based on these rules.
Currently, DwTable supports only the separated borders model (see CSS specification). Borders, paddings, spacing is done by creating dw::core::style::Style structures with values equivalent to following CSS:
TABLE { border: outset table-border; border-collapse: separate; border-spacing: table-cellspacing; background-color: table-bgcolor; } TD TH { border: inset table-border; padding: table-cellspacing; background-color: td/th-bgcolor; }
Here, foo-bar refers to the attribute bar of the tag foo foo. Look at the HTML parser for more details.
|
private |
dw::Table::Table | ( | bool | limitTextWidth | ) |
Definition at line 34 of file table.cc.
References baseline, children, CLASS_ID, colExtremes, colWidthPercentage, colWidths, colWidthSpecified, colWidthsUpToDateWidthColExtremes, cumHeight, curCol, curRow, DBG_OBJ_CREATE, DBG_OBJ_SET_BOOL, DBG_OBJ_SET_NUM, limitTextWidth, numCols, numColWidthPercentage, numColWidthSpecified, numRows, redrawX, redrawY, lout::identity::IdentifiableObject::registerName(), rowClosed, rowSpanCells, rowStyle, and dw::core::Widget::setButtonSensitive().
dw::Table::~Table | ( | ) |
Definition at line 73 of file table.cc.
References baseline, dw::Table::Child::CELL, children, colExtremes, colWidthPercentage, colWidths, colWidthSpecified, cumHeight, DBG_OBJ_DELETE, rowSpanCells, rowStyle, and dw::Table::Child::SPAN_SPACE.
|
private |
Definition at line 903 of file table.cc.
References dw::core::Extremes::adjustmentWidth, apportion2(), apportionRowSpan(), dw::core::Requisition::ascent, baseline, dw::core::Widget::boxDiffWidth(), childDefined(), children, colExtremes, colWidthPercentage, colWidths, colWidthSpecified, colWidthsUpToDateWidthColExtremes, dw::core::Widget::correctRequisition(), cumHeight, DATA, DBG_IF_RTFL, DBG_OBJ_ARRSET_NUM, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSG, DBG_OBJ_MSG_END, DBG_OBJ_MSG_START, DBG_OBJ_MSGF, DBG_OBJ_SET_BOOL, DBG_OBJ_SET_NUM, dw::core::Requisition::descent, dw::core::Widget::extremes, lout::misc::SimpleVector< T >::get(), getAdjustTableMinWidth(), dw::core::Widget::getAvailWidth(), dw::core::Widget::getExtremes(), dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::hBorderSpacing, lout::misc::SimpleVector< T >::increase(), dw::core::style::LENGTH_AUTO, MAX, lout::misc::max(), MAX_MIN, MIN, lout::misc::min(), MIN_MIN, numCols, numColWidthPercentage, numColWidthSpecified, numRows, redrawX, rowSpanCells, lout::misc::SimpleVector< T >::set(), setCumHeight(), lout::misc::SimpleVector< T >::setSize(), lout::misc::SimpleVector< T >::size(), dw::core::splitHeightPreserveDescent(), and dw::core::Requisition::width.
Referenced by forceCalcCellSizes().
void dw::Table::addCell | ( | Widget * | widget, |
int | colspan, | ||
int | rowspan | ||
) |
Definition at line 468 of file table.cc.
References _MSG, addRow(), dw::Table::Child::CELL, dw::Table::Child::cell, children, dw::Table::Cell::colspanEff, dw::Table::Cell::colspanOrig, curCol, curRow, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_SET_NUM_O, dw::oof::OOFAwareWidget::makeParentRefInFlow(), lout::misc::max(), MSG, MSG_WARN, numCols, numRows, dw::core::Widget::queueResize(), reallocChildren(), rowClosed, dw::Table::Cell::rowspan, rowStyle, dw::Table::Child::SPAN_SPACE, dw::Table::Child::spanSpace, dw::Table::SpanSpace::startCol, dw::Table::SpanSpace::startRow, dw::Table::Child::type, and dw::Table::Cell::widget.
Referenced by main().
void dw::Table::addRow | ( | core::style::Style * | style | ) |
Definition at line 584 of file table.cc.
References curCol, curRow, numCols, numRows, reallocChildren(), dw::core::style::Style::ref(), rowClosed, rowStyle, and dw::core::Widget::style.
|
protected |
Definition at line 347 of file table.cc.
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, and DBG_OBJ_MSGF.
|
virtual |
Reimplemented from dw::core::Widget.
Definition at line 325 of file table.cc.
References dw::core::style::multiplyWithPerLength().
|
virtual |
Reimplemented from dw::core::Widget.
Definition at line 320 of file table.cc.
References dw::core::style::multiplyWithPerLength().
|
private |
Actual apportionment function.
Definition at line 1526 of file table.cc.
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSG, DBG_OBJ_MSGF, getColExtreme(), getExtrModName(), lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::setSize().
Referenced by actuallyCalcCellSizes(), calcAdjustmentWidthSpanMultiCols(), and calcExtremesSpanMultiCols().
|
private |
Definition at line 1230 of file table.cc.
References _MSG, dw::core::Requisition::ascent, children, cumHeight, DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, dw::core::Requisition::descent, lout::misc::SimpleVector< T >::get(), dw::core::Widget::getStyle(), MSG, numCols, numRows, rowSpanCells, setCumHeight(), lout::misc::SimpleVector< T >::size(), and dw::core::style::StyleAttrs::vBorderSpacing.
Referenced by actuallyCalcCellSizes().
|
private |
Definition at line 1501 of file table.cc.
References dw::core::Extremes::adjustmentWidth, apportion2(), colExtremes, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, lout::misc::SimpleVector< T >::get(), MAX, and MIN.
Referenced by forceCalcColumnExtremes().
|
private |
Definition at line 271 of file table.cc.
References children, colWidths, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, lout::misc::SimpleVector< T >::get(), dw::oof::OOFAwareWidget::getParentRefInFlowSubRef(), dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::hBorderSpacing, lout::misc::max(), lout::misc::min(), numCols, and dw::core::Widget::Widget().
Referenced by getAvailWidthOfChild().
|
private |
Definition at line 824 of file table.cc.
References colWidthsUpToDateWidthColExtremes, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, dw::core::Widget::extremesChanged(), dw::core::Widget::extremesQueued(), forceCalcCellSizes(), dw::core::Widget::needsResize(), and dw::core::Widget::resizeQueued().
Referenced by sizeAllocateImpl().
|
private |
Definition at line 1450 of file table.cc.
References apportion2(), DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, lout::misc::SimpleVector< T >::get(), getColExtreme(), getExtreme(), getExtrModName(), MAX, lout::misc::max(), MIN, and setColExtreme().
Referenced by forceCalcColumnExtremes().
|
inlineprivate |
Definition at line 431 of file table.hh.
References children, and dw::Table::Child::SPAN_SPACE.
Referenced by actuallyCalcCellSizes(), containerSizeChangedForChildren(), drawLevel(), forceCalcColumnExtremes(), getCellRef(), getWidgetAtPointLevel(), and sizeAllocateImpl().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 330 of file table.cc.
References childDefined(), children, dw::oof::OOFAwareWidget::containerSizeChangedForChildrenOOF(), DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, numCols, and numRows.
|
protectedvirtual |
Reimplemented from dw::oof::OOFAwareWidget.
Definition at line 379 of file table.cc.
References dw::core::style::StyleAttrs::boxOffsetX(), dw::core::style::StyleAttrs::boxOffsetY(), childDefined(), children, cumHeight, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, dw::core::Rectangle::draw(), dw::core::Widget::drawBox(), lout::misc::SimpleVector< T >::get(), dw::core::Widget::getContentWidth(), dw::core::Widget::getStyle(), dw::core::StackingContextMgr::handledByStackingContextMgr(), dw::core::style::StyleAttrs::hBorderSpacing, dw::core::Rectangle::height, numRows, rowStyle, dw::oof::OOFAwareWidget::SL_IN_FLOW, dw::oof::OOFAwareWidget::stackingLevelText(), dw::core::style::StyleAttrs::vBorderSpacing, dw::core::Widget::Widget(), dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
|
private |
Definition at line 840 of file table.cc.
References actuallyCalcCellSizes(), lout::misc::assertNotReached(), dw::Table::Child::CELL, dw::Table::Child::cell, children, colWidths, lout::misc::SimpleVector< T >::copyTo(), DBG_OBJ_ENTER, DBG_OBJ_LEAVE, lout::misc::SimpleVector< T >::get(), numCols, numRows, lout::misc::SimpleVector< T >::size(), dw::Table::Child::SPAN_SPACE, dw::Table::Child::type, dw::Table::Cell::widget, and dw::core::Widget::Widget().
Referenced by calcCellSizes(), and sizeRequestSimpl().
|
private |
Fills dw::Table::colExtremes in all cases.
Definition at line 1295 of file table.cc.
References dw::core::Extremes::adjustmentWidth, calcAdjustmentWidthSpanMultiCols(), calcExtremesSpanMultiCols(), childDefined(), children, colExtremes, colWidthPercentage, colWidthSpecified, colWidthsUpToDateWidthColExtremes, DBG_IF_RTFL, DBG_OBJ_ARRATTRSET_NUM, DBG_OBJ_ARRSET_BOOL, DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, DBG_OBJ_MSG_END, DBG_OBJ_MSG_START, DBG_OBJ_MSGF, DBG_OBJ_SET_BOOL, DBG_OBJ_SET_NUM, lout::misc::SimpleVector< T >::get(), lout::misc::SimpleVector< T >::increase(), dw::core::style::isPerLength(), dw::core::style::LENGTH_AUTO, MAX, lout::misc::max(), MAX_INTR, dw::core::Extremes::maxWidth, dw::core::Extremes::maxWidthIntrinsic, MIN, MIN_INTR, dw::core::Extremes::minWidth, dw::core::Extremes::minWidthIntrinsic, numCols, numColWidthPercentage, numColWidthSpecified, numRows, lout::misc::SimpleVector< T >::set(), lout::misc::SimpleVector< T >::setLast(), lout::misc::SimpleVector< T >::setSize(), and lout::misc::SimpleVector< T >::size().
Referenced by getExtremesSimpl().
|
inlineprotectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 472 of file table.hh.
References adjustTableMinWidth.
|
inlinestatic |
Definition at line 500 of file table.hh.
References adjustTableMinWidth.
Referenced by actuallyCalcCellSizes(), and dw::tablecell::getAdjustMinWidth().
|
protected |
Definition at line 225 of file table.cc.
References calcAvailWidthForDescendant(), DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, dw::oof::OutOfFlowMgr::dealingWithSizeOfChild(), dw::oof::OutOfFlowMgr::getAvailWidthOfChild(), dw::oof::OOFAwareWidget::getWidgetOutOfFlowMgr(), and dw::oof::OOFAwareWidget::isWidgetOOF().
AlignedTableCell * dw::Table::getCellRef | ( | ) |
Definition at line 602 of file table.cc.
References childDefined(), children, dw::AlignedTableCell::CLASS_ID, curCol, lout::identity::IdentifiableObject::instanceOf(), numCols, and numRows.
|
private |
Definition at line 701 of file table.cc.
References colExtremes, DATA, and getExtreme().
Referenced by apportion2(), and calcExtremesSpanMultiCols().
|
private |
Definition at line 648 of file table.cc.
References lout::misc::assertNotReached(), dw::core::Widget::extremes, MAX, lout::misc::max(), MAX_INTR, MAX_MIN, dw::core::Extremes::maxWidth, dw::core::Extremes::maxWidthIntrinsic, MIN, lout::misc::min(), MIN_INTR, MIN_MIN, dw::core::Extremes::minWidth, and dw::core::Extremes::minWidthIntrinsic.
Referenced by calcExtremesSpanMultiCols(), and getColExtreme().
|
protectedvirtual |
Simple variant, to be implemented by widgets with extremes not depending on positions.
Reimplemented from dw::core::Widget.
Definition at line 133 of file table.cc.
References dw::core::Extremes::adjustmentWidth, dw::core::Widget::boxDiffWidth(), colExtremes, dw::core::Widget::correctExtremes(), dw::oof::OOFAwareWidget::correctExtremesByOOF(), DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, dw::core::Widget::extremes, forceCalcColumnExtremes(), dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::hBorderSpacing, dw::core::Extremes::maxWidth, dw::core::Extremes::maxWidthIntrinsic, dw::core::Extremes::minWidth, dw::core::Extremes::minWidthIntrinsic, and numCols.
|
private |
Definition at line 618 of file table.cc.
References lout::misc::assertNotReached(), DATA, MAX, MAX_INTR, MAX_MIN, MIN, MIN_INTR, and MIN_MIN.
Referenced by apportion2(), and calcExtremesSpanMultiCols().
|
protectedvirtual |
Reimplemented from dw::oof::OOFAwareWidget.
Definition at line 425 of file table.cc.
References childDefined(), children, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, dw::core::StackingContextMgr::handledByStackingContextMgr(), dw::oof::OOFAwareWidget::SL_IN_FLOW, dw::oof::OOFAwareWidget::stackingLevelText(), and dw::core::Widget::Widget().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
|
virtual |
Return an iterator for this widget.
mask can narrow the types returned by the iterator, this can enhance performance quite much, e.g. when only searching for child widgets.
With atEnd == false, the iterator starts before the beginning, i.e. the first call of dw::core::Iterator::next will let the iterator point on the first piece of contents. Likewise, With atEnd == true, the iterator starts after the last piece of contents, call dw::core::Iterator::prev in this case.
Implements dw::core::Widget.
|
private |
Definition at line 724 of file table.cc.
References dw::Table::Child::CELL, dw::Table::Child::cell, children, colWidths, DBG_IF_RTFL, DBG_OBJ_ARRSET_NUM, DBG_OBJ_SET_NUM, DBG_OBJ_SET_NUM_O, lout::misc::SimpleVector< T >::get(), dw::oof::OOFAwareWidget::makeParentRefInFlow(), numCols, numRows, dw::core::Widget::parentRef, rowStyle, lout::misc::SimpleVector< T >::setSize(), lout::misc::SimpleVector< T >::size(), dw::Table::Child::SPAN_SPACE, dw::Table::Child::spanSpace, dw::Table::SpanSpace::startCol, dw::Table::SpanSpace::startRow, dw::Table::Child::type, and dw::Table::Cell::widget.
|
protected |
|
protectedvirtual |
Called after sizeAllocateImpl() to redraw necessary areas.
By default the whole widget is redrawn.
Reimplemented from dw::core::Widget.
Definition at line 217 of file table.cc.
References dw::core::Widget::allocation, dw::core::Widget::getHeight(), dw::core::Widget::queueDrawArea(), redrawX, redrawY, and dw::core::Allocation::width.
|
inlinestatic |
|
inlineprivate |
Definition at line 712 of file table.cc.
References colExtremes, DATA, and setExtreme().
Referenced by calcExtremesSpanMultiCols().
|
inlineprivate |
Definition at line 458 of file table.hh.
References cumHeight, lout::misc::SimpleVector< T >::get(), lout::misc::min(), redrawY, and lout::misc::SimpleVector< T >::set().
Referenced by actuallyCalcCellSizes(), and apportionRowSpan().
|
private |
Definition at line 675 of file table.cc.
References lout::misc::assertNotReached(), dw::core::Widget::extremes, MAX, MAX_INTR, dw::core::Extremes::maxWidth, dw::core::Extremes::maxWidthIntrinsic, MIN, MIN_INTR, dw::core::Extremes::minWidth, and dw::core::Extremes::minWidthIntrinsic.
Referenced by setColExtreme().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 166 of file table.cc.
References dw::core::Widget::allocation, dw::core::Allocation::ascent, dw::core::Requisition::ascent, dw::core::Widget::boxOffsetX(), dw::core::Widget::boxOffsetY(), calcCellSizes(), childDefined(), children, colWidths, cumHeight, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, dw::core::Allocation::descent, lout::misc::SimpleVector< T >::get(), dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::hBorderSpacing, numCols, numRows, dw::oof::OOFAwareWidget::sizeAllocateEnd(), dw::oof::OOFAwareWidget::sizeAllocateStart(), dw::core::style::StyleAttrs::vBorderSpacing, dw::core::Allocation::width, dw::core::Allocation::x, and dw::core::Allocation::y.
|
protectedvirtual |
Simple variant, to be implemented by widgets with sizes not depending on positions.
Reimplemented from dw::core::Widget.
Definition at line 106 of file table.cc.
References dw::core::Requisition::ascent, dw::core::Widget::boxDiffHeight(), dw::core::Widget::boxDiffWidth(), colWidths, dw::core::Widget::correctRequisition(), dw::oof::OOFAwareWidget::correctRequisitionByOOF(), cumHeight, DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, dw::core::Requisition::descent, forceCalcCellSizes(), lout::misc::SimpleVector< T >::get(), dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::hBorderSpacing, numCols, numRows, dw::core::Widget::requisition, dw::core::splitHeightPreserveDescent(), dw::core::style::StyleAttrs::vBorderSpacing, and dw::core::Requisition::width.
|
protectedvirtual |
Must be implemengted by a method returning true, when getAvailWidth() is called.
Reimplemented from dw::core::Widget.
|
friend |
|
staticprivate |
Definition at line 366 of file table.hh.
Referenced by getAdjustMinWidth(), getAdjustTableMinWidth(), and setAdjustTableMinWidth().
|
private |
Definition at line 417 of file table.hh.
Referenced by actuallyCalcCellSizes(), Table(), and ~Table().
|
private |
Definition at line 371 of file table.hh.
Referenced by actuallyCalcCellSizes(), addCell(), apportionRowSpan(), calcAvailWidthForDescendant(), childDefined(), containerSizeChangedForChildren(), drawLevel(), forceCalcCellSizes(), forceCalcColumnExtremes(), getCellRef(), dw::Table::TableIterator::getContentInFlow(), getWidgetAtPointLevel(), reallocChildren(), sizeAllocateImpl(), Table(), and ~Table().
|
private |
The extremes of all columns.
Definition at line 378 of file table.hh.
Referenced by actuallyCalcCellSizes(), calcAdjustmentWidthSpanMultiCols(), forceCalcColumnExtremes(), getColExtreme(), getExtremesSimpl(), setColExtreme(), Table(), and ~Table().
|
private |
Wether the column itself (in the future?) or at least one cell in this column or spanning over this column has CSS 'width' specified as percentage value.
Filled by forceCalcColumnExtremes(), since it is needed to calculate the column widths.
Definition at line 399 of file table.hh.
Referenced by actuallyCalcCellSizes(), forceCalcColumnExtremes(), Table(), and ~Table().
|
private |
The widths of all columns.
Definition at line 405 of file table.hh.
Referenced by actuallyCalcCellSizes(), calcAvailWidthForDescendant(), forceCalcCellSizes(), reallocChildren(), sizeAllocateImpl(), sizeRequestSimpl(), Table(), and ~Table().
|
private |
Wether the column itself (in the future?) or at least one cell in this column or spanning over this column has CSS 'width' specified.
Filled by forceCalcColumnExtremes(), since it is needed to calculate the column widths.
Definition at line 388 of file table.hh.
Referenced by actuallyCalcCellSizes(), forceCalcColumnExtremes(), Table(), and ~Table().
|
private |
Definition at line 421 of file table.hh.
Referenced by actuallyCalcCellSizes(), calcCellSizes(), forceCalcColumnExtremes(), and Table().
|
private |
Row cumulative height array: cumHeight->size() is numRows + 1, cumHeight->get(0) is 0, cumHeight->get(numRows) is the total table height.
Definition at line 412 of file table.hh.
Referenced by actuallyCalcCellSizes(), apportionRowSpan(), drawLevel(), setCumHeight(), sizeAllocateImpl(), sizeRequestSimpl(), Table(), and ~Table().
|
private |
|
private |
|
private |
|
private |
Definition at line 370 of file table.hh.
Referenced by actuallyCalcCellSizes(), addCell(), addRow(), apportionRowSpan(), calcAvailWidthForDescendant(), containerSizeChangedForChildren(), forceCalcCellSizes(), forceCalcColumnExtremes(), getCellRef(), getExtremesSimpl(), reallocChildren(), sizeAllocateImpl(), sizeRequestSimpl(), and Table().
|
private |
Definition at line 400 of file table.hh.
Referenced by actuallyCalcCellSizes(), forceCalcColumnExtremes(), and Table().
|
private |
Definition at line 389 of file table.hh.
Referenced by actuallyCalcCellSizes(), forceCalcColumnExtremes(), and Table().
|
private |
Definition at line 370 of file table.hh.
Referenced by actuallyCalcCellSizes(), addCell(), addRow(), apportionRowSpan(), containerSizeChangedForChildren(), drawLevel(), forceCalcCellSizes(), forceCalcColumnExtremes(), getCellRef(), reallocChildren(), sizeAllocateImpl(), sizeRequestSimpl(), and Table().
|
private |
Definition at line 373 of file table.hh.
Referenced by actuallyCalcCellSizes(), resizeDrawImpl(), and Table().
|
private |
Definition at line 373 of file table.hh.
Referenced by resizeDrawImpl(), setCumHeight(), and Table().
|
private |
|
private |
If a Cell has rowspan > 1, it goes into this array.
Definition at line 416 of file table.hh.
Referenced by actuallyCalcCellSizes(), apportionRowSpan(), Table(), and ~Table().
|
private |
Definition at line 419 of file table.hh.
Referenced by addCell(), addRow(), drawLevel(), reallocChildren(), Table(), and ~Table().