#include <widget.hh>
Public Member Functions | |
| void | setDeleteCallback (DW_Callback_t func, void *data) |
| Widget () | |
| ~Widget () | |
| bool | needsResize () |
| bool | needsAllocate () |
| bool | extremesChanged () |
| bool | wasAllocated () |
| bool | usesHints () |
| bool | hasContents () |
| bool | blockLevel () |
| void | setParent (Widget *parent) |
| style::Style * | getStyle () |
| Allocation * | getAllocation () |
| void | sizeRequest (Requisition *requisition) |
| This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed. | |
| void | getExtremes (Extremes *extremes) |
| Wrapper for Widget::getExtremesImpl(). | |
| void | sizeAllocate (Allocation *allocation) |
| Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed. | |
| virtual void | setWidth (int width) |
| virtual void | setAscent (int ascent) |
| virtual void | setDescent (int descent) |
| bool | intersects (Rectangle *area, Rectangle *intersection) |
| Calculates the intersection of widget->allocation and area, returned in intersection (in widget coordinates!). | |
| virtual void | draw (View *view, Rectangle *area)=0 |
| 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. the background of a table row. | |
| style::Color * | getBgColor () |
| Get the actual background 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 * | 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. | |
| Widget * | getNearestCommonAncestor (Widget *otherWidget) |
| Get the widget with the highest level, which is a direct ancestor of widget1 and widget2. | |
| Layout * | getLayout () |
| virtual Widget * | getWidgetAtPoint (int x, int y, int level) |
| Search recursively through widget. | |
| void | scrollTo (HPosition hpos, VPosition vpos, int x, int y, int width, int height) |
| virtual Iterator * | iterator (Content::Type mask, bool atEnd)=0 |
| Return an iterator for this widget. | |
| virtual void | removeChild (Widget *child) |
Public Attributes | |
| int | parentRef |
| This value is defined by the parent widget, and used for incremential resizing. | |
Static Public Attributes | |
| static int | CLASS_ID = -1 |
Protected Types | |
| enum | Flags { NEEDS_RESIZE = 1 << 0, NEEDS_ALLOCATE = 1 << 1, EXTREMES_CHANGED = 1 << 2, USES_HINTS = 1 << 3, HAS_CONTENTS = 1 << 4, WAS_ALLOCATED = 1 << 5, BLOCK_LEVEL = 1 << 6 } |
Protected Member Functions | |
| int | getHeight () |
| int | getContentWidth () |
| int | getContentHeight () |
| 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) |
| This method should be called, when a widget changes its size. | |
| virtual void | sizeRequestImpl (Requisition *requisition)=0 |
| See Sizes of Dillo Widgets. | |
| virtual void | getExtremesImpl (Extremes *extremes) |
| See Sizes of Dillo Widgets. | |
| virtual void | sizeAllocateImpl (Allocation *allocation) |
| See Sizes of Dillo Widgets. | |
| virtual void | resizeDrawImpl () |
| Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn. | |
| virtual void | markSizeChange (int ref) |
| See Sizes of Dillo Widgets. | |
| virtual void | markExtremesChange (int ref) |
| See Sizes of Dillo Widgets. | |
| 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 | selectionButtonPress (Iterator *it, int charPos, int linkNo, EventButton *event, bool withinContent) |
| bool | selectionButtonRelease (Iterator *it, int charPos, int linkNo, EventButton *event, bool withinContent) |
| bool | selectionButtonMotion (Iterator *it, int charPos, int linkNo, EventMotion *event, bool withinContent) |
| bool | selectionHandleEvent (SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event) |
Protected Attributes | |
| Allocation | allocation |
| The current allocation: size and position, always relative to the canvas. | |
| Layout * | layout |
Private Attributes | |
| Widget * | parent |
| The parent widget, NULL for top-level widgets. | |
| style::Style * | style |
| Flags | flags |
| Requisition | requisition |
| Size_request() stores the result of the last call of size_request_impl(). | |
| Extremes | extremes |
| Analogue to dw::core::Widget::requisition. | |
| style::Color * | bgColor |
| See dw::core::Widget::setBgColor(). | |
| bool | buttonSensitive |
| See dw::core::Widget::setButtonSensitive(). | |
| bool | buttonSensitiveSet |
| See dw::core::Widget::setButtonSensitive(). | |
| void * | deleteCallbackData |
| DW_Callback_t | deleteCallbackFunc |
Friends | |
| class | Layout |
enum dw::core::Widget::Flags [protected] |
| NEEDS_RESIZE | Set, when dw::core::Widget::requisition is not up to date anymore. |
| NEEDS_ALLOCATE |
Only used internally, set to enforce size allocation.
(I've forgotten the case, for which this is necessary.) |
| EXTREMES_CHANGED | Set, when dw::core::Widget::extremes is not up to date anymore. |
| USES_HINTS |
Set by the widget itself (in the constructor), when set... methods are implemented.
Will hopefully be removed, after redesigning the size model. |
| HAS_CONTENTS |
Set by the widget itself (in the constructor), when it contains some contents, e.g. an image, as opposed to a horizontal ruler.
Will hopefully be removed, after redesigning the size model. |
| WAS_ALLOCATED |
Set, when a widget was already once allocated,.
The dw::Image widget uses this flag, see dw::Image::setBuffer. |
| BLOCK_LEVEL | Set for block-level widgets (as opposed to inline widgets). |
| dw::core::Widget::Widget | ( | ) |
References allocation, dw::core::Allocation::ascent, bgColor, buttonSensitive, buttonSensitiveSet, CLASS_ID, deleteCallbackData, deleteCallbackFunc, dw::core::Allocation::descent, EXTREMES_CHANGED, flags, HAS_CONTENTS, layout, NEEDS_RESIZE, parent, lout::identity::IdentifiableObject::registerName(), style, dw::core::Allocation::width, dw::core::Allocation::x, and dw::core::Allocation::y.
Referenced by dw::Textblock::addParbreak(), dw::Table::draw(), and dw::Textblock::handOverBreak().
| dw::core::Widget::~Widget | ( | ) |
| char* dw::core::Widget::addAnchor | ( | const char * | name, | |
| int | y | |||
| ) | [inline, protected] |
References dw::core::Layout::addAnchor(), and layout.
| char* dw::core::Widget::addAnchor | ( | const char * | name | ) | [inline, protected] |
References dw::core::Layout::addAnchor(), and layout.
| bool dw::core::Widget::blockLevel | ( | ) | [inline] |
References BLOCK_LEVEL, and flags.
| bool dw::core::Widget::buttonPress | ( | EventButton * | event | ) |
| bool dw::core::Widget::buttonPressImpl | ( | EventButton * | event | ) | [protected, virtual] |
| bool dw::core::Widget::buttonRelease | ( | EventButton * | event | ) |
| bool dw::core::Widget::buttonReleaseImpl | ( | EventButton * | event | ) | [protected, virtual] |
| void dw::core::Widget::changeAnchor | ( | char * | name, | |
| int | y | |||
| ) | [inline, protected] |
References dw::core::Layout::changeAnchor(), and layout.
Referenced by dw::Textblock::sizeAllocateImpl().
Area is given in widget coordinates.
Implemented in dw::Bullet, dw::Image, dw::Ruler, dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by dw::core::Layout::draw(), and dw::Textblock::drawLine().
| void dw::core::Widget::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).
area is given in widget coordinates.
References allocation, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::drawBackground(), dw::core::style::drawBorder(), dw::core::Rectangle::height, dw::core::Rectangle::width, dw::core::Allocation::x, dw::core::Rectangle::x, dw::core::Allocation::y, and dw::core::Rectangle::y.
Referenced by dw::Table::draw(), and dw::Textblock::drawLine().
Draw borders and background of a widget.
area is given in widget coordinates.
References allocation, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::drawBackground(), dw::core::style::drawBorder(), dw::core::Layout::getBgColor(), getHeight(), dw::core::Rectangle::height, layout, parent, style, dw::core::Allocation::width, dw::core::Rectangle::width, dw::core::Allocation::x, dw::core::Rectangle::x, dw::core::Allocation::y, and dw::core::Rectangle::y.
Referenced by dw::core::ui::Embed::draw(), dw::Textblock::draw(), dw::Table::draw(), dw::Ruler::draw(), and dw::Image::draw().
| void dw::core::Widget::enterNotify | ( | EventCrossing * | event | ) |
References enterNotifyImpl().
Referenced by dw::core::Layout::enterNotify(), and dw::core::Layout::moveToWidget().
| void dw::core::Widget::enterNotifyImpl | ( | EventCrossing * | event | ) | [protected, virtual] |
Reimplemented in dw::Image, dw::Textblock, and dw::core::ui::Embed.
References getStyle(), dw::core::style::Tooltip::onEnter(), and dw::core::style::StyleAttrs::x_tooltip.
Referenced by enterNotify().
| bool dw::core::Widget::extremesChanged | ( | ) | [inline] |
References EXTREMES_CHANGED, and flags.
Referenced by dw::Table::calcColumnExtremes(), and getExtremes().
| Allocation* dw::core::Widget::getAllocation | ( | ) | [inline] |
References allocation.
Referenced by dw::core::TextIterator::getAllocation(), and dw::core::Layout::processMouseEvent().
| style::Color * dw::core::Widget::getBgColor | ( | ) |
Get the actual background of a widget.
References dw::core::style::StyleAttrs::backgroundColor, bgColor, dw::core::Layout::getBgColor(), layout, parent, and style.
Referenced by dw::Textblock::drawSpace(), and dw::Textblock::drawText().
| int dw::core::Widget::getContentHeight | ( | ) | [inline, protected] |
References dw::core::style::StyleAttrs::boxDiffHeight(), getHeight(), and style.
Referenced by dw::Image::contentY(), dw::Image::draw(), and dw::Image::setBuffer().
| int dw::core::Widget::getContentWidth | ( | ) | [inline, protected] |
References allocation, dw::core::style::StyleAttrs::boxDiffWidth(), style, and dw::core::Allocation::width.
Referenced by dw::Image::contentX(), dw::Table::draw(), dw::Image::draw(), and dw::Image::setBuffer().
| void dw::core::Widget::getExtremes | ( | Extremes * | extremes | ) |
Wrapper for Widget::getExtremesImpl().
References DBG_OBJ_SET_NUM, EXTREMES_CHANGED, extremesChanged(), getExtremesImpl(), dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, and unsetFlags().
Referenced by dw::Table::forceCalcCellSizes(), and dw::core::ui::ComplexButtonResource::getExtremes().
| void dw::core::Widget::getExtremesImpl | ( | Extremes * | extremes | ) | [protected, virtual] |
Reimplemented in dw::Table, dw::Textblock, and dw::core::ui::Embed.
References dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, requisition, sizeRequest(), and dw::core::Requisition::width.
Referenced by getExtremes().
| int dw::core::Widget::getHeight | ( | ) | [inline, protected] |
References allocation, dw::core::Allocation::ascent, and dw::core::Allocation::descent.
Referenced by dw::core::Layout::draw(), drawWidgetBox(), getContentHeight(), getWidgetAtPoint(), dw::Textblock::getWidgetAtPoint(), intersects(), queueDraw(), dw::Textblock::resizeDrawImpl(), dw::Table::resizeDrawImpl(), and dw::Image::sizeAllocateImpl().
| Layout* dw::core::Widget::getLayout | ( | ) | [inline] |
| int dw::core::Widget::getLevel | ( | ) |
Get the level of the widget within the tree.
The root widget has the level 0.
References parent.
Referenced by dw::core::DeepIterator::DeepIterator(), and getNearestCommonAncestor().
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2.
References getLevel(), and parent.
Referenced by dw::core::Layout::moveToWidget().
| Widget* dw::core::Widget::getParent | ( | ) | [inline] |
| style::Style* dw::core::Widget::getStyle | ( | ) | [inline] |
References style.
Referenced by dw::Table::apportion_percentages2(), dw::Table::apportionRowSpan(), dw::Image::buttonPressImpl(), dw::Image::buttonReleaseImpl(), dw::Textblock::calcWidgetSize(), dw::Textblock::changeLinkColor(), dw::Image::contentX(), dw::Image::contentY(), dw::Table::draw(), dw::Image::draw(), dw::Bullet::draw(), dw::Image::drawRow(), enterNotifyImpl(), dw::Image::enterNotifyImpl(), dw::Table::forceCalcCellSizes(), dw::Table::forceCalcColumnExtremes(), dw::Textblock::getExtremesImpl(), dw::Table::getExtremesImpl(), leaveNotifyImpl(), dw::Textblock::lineXOffsetWidget(), dw::Textblock::motionNotifyImpl(), dw::Image::motionNotifyImpl(), dw::Table::sizeAllocateImpl(), dw::Image::sizeAllocateImpl(), dw::Textblock::sizeRequestImpl(), dw::Table::sizeRequestImpl(), dw::Ruler::sizeRequestImpl(), dw::Image::sizeRequestImpl(), dw::Bullet::sizeRequestImpl(), and dw::Textblock::wordWrap().
| Widget * dw::core::Widget::getTopLevel | ( | ) |
Get the widget at the root of the tree, this widget is part from.
References parent.
Referenced by dw::core::Layout::moveToWidget().
| Widget * dw::core::Widget::getWidgetAtPoint | ( | int | x, | |
| int | y, | |||
| int | level | |||
| ) | [virtual] |
Search recursively through widget.
Used by dw::core::Layout:getWidgetAtPoint.
Reimplemented in dw::Textblock.
References allocation, dw::core::Iterator::getContent(), getHeight(), getWidgetAtPoint(), iterator(), dw::core::Iterator::next(), dw::core::Iterator::unref(), dw::core::Content::widget, dw::core::Content::WIDGET, dw::core::Allocation::width, dw::core::Allocation::x, and dw::core::Allocation::y.
Referenced by getWidgetAtPoint(), and dw::core::Layout::getWidgetAtPoint().
| bool dw::core::Widget::hasContents | ( | ) | [inline] |
References flags, and HAS_CONTENTS.
Calculates the intersection of widget->allocation and area, returned in intersection (in widget coordinates!).
Typically used by containers when drawing their children. Returns whether intersection is not empty.
References allocation, getHeight(), dw::core::Rectangle::height, dw::core::Rectangle::intersectsWith(), parent, dw::core::Allocation::width, dw::core::Rectangle::width, dw::core::Allocation::x, dw::core::Rectangle::x, dw::core::Allocation::y, and dw::core::Rectangle::y.
Referenced by dw::Textblock::drawLine().
| bool dw::core::Widget::isButtonSensitive | ( | ) | [inline] |
| virtual Iterator* dw::core::Widget::iterator | ( | Content::Type | mask, | |
| bool | atEnd | |||
| ) | [pure 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.
Implemented in dw::Bullet, dw::Image, dw::Ruler, dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by dw::core::CharIterator::CharIterator(), dw::core::DeepIterator::DeepIterator(), getWidgetAtPoint(), dw::core::DeepIterator::next(), dw::core::DeepIterator::prev(), dw::core::DeepIterator::searchDownward(), and dw::core::DeepIterator::searchSideward().
| void dw::core::Widget::leaveNotify | ( | EventCrossing * | event | ) |
References leaveNotifyImpl().
Referenced by dw::core::Layout::leaveNotify(), and dw::core::Layout::moveToWidget().
| void dw::core::Widget::leaveNotifyImpl | ( | EventCrossing * | event | ) | [protected, virtual] |
Reimplemented in dw::Image, dw::Textblock, and dw::core::ui::Embed.
References getStyle(), dw::core::style::Tooltip::onLeave(), and dw::core::style::StyleAttrs::x_tooltip.
Referenced by leaveNotify().
| void dw::core::Widget::markExtremesChange | ( | int | ref | ) | [protected, virtual] |
| void dw::core::Widget::markSizeChange | ( | int | ref | ) | [protected, virtual] |
| bool dw::core::Widget::motionNotify | ( | EventMotion * | event | ) |
| bool dw::core::Widget::motionNotifyImpl | ( | EventMotion * | event | ) | [protected, virtual] |
| bool dw::core::Widget::needsAllocate | ( | ) | [inline] |
| bool dw::core::Widget::needsResize | ( | ) | [inline] |
| void dw::core::Widget::queueDraw | ( | ) | [inline, protected] |
References allocation, getHeight(), queueDrawArea(), and dw::core::Allocation::width.
Referenced by dw::Image::forceMapRedraw(), resizeDrawImpl(), and setStyle().
| void dw::core::Widget::queueDrawArea | ( | int | x, | |
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) | [protected] |
References allocation, layout, dw::core::Layout::queueDraw(), dw::core::Allocation::x, and dw::core::Allocation::y.
Referenced by dw::Textblock::changeLinkColor(), dw::Image::drawRow(), queueDraw(), dw::Textblock::queueDrawRange(), dw::Textblock::resizeDrawImpl(), and dw::Table::resizeDrawImpl().
| void dw::core::Widget::queueResize | ( | int | ref, | |
| bool | extremesChanged | |||
| ) | [protected] |
This method should be called, when a widget changes its size.
References EXTREMES_CHANGED, layout, markExtremesChange(), markSizeChange(), NEEDS_ALLOCATE, NEEDS_RESIZE, parent, parentRef, dw::core::Layout::queueResize(), and setFlags().
Referenced by dw::Table::addCell(), dw::Textblock::addParbreak(), dw::Textblock::flush(), dw::core::ui::Resource::queueResize(), dw::Textblock::setAscent(), dw::Table::setAscent(), dw::Image::setBuffer(), dw::Textblock::setDescent(), dw::Table::setDescent(), dw::TableCell::setMaxValue(), dw::ListItem::setMaxValue(), setStyle(), dw::Textblock::setWidth(), and dw::Table::setWidth().
| void dw::core::Widget::removeAnchor | ( | char * | name | ) | [inline, protected] |
| void dw::core::Widget::removeChild | ( | Widget * | child | ) | [virtual] |
| virtual void dw::core::Widget::resizeDrawImpl | ( | ) | [inline, protected, virtual] |
Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn.
Reimplemented in dw::Table, and dw::Textblock.
References queueDraw().
Referenced by sizeAllocate().
| void dw::core::Widget::scrollTo | ( | HPosition | hpos, | |
| VPosition | vpos, | |||
| int | x, | |||
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) |
References allocation, layout, dw::core::Layout::scrollTo(), dw::core::Allocation::x, and dw::core::Allocation::y.
| bool dw::core::Widget::selectionButtonMotion | ( | Iterator * | it, | |
| int | charPos, | |||
| int | linkNo, | |||
| EventMotion * | event, | |||
| bool | withinContent | |||
| ) | [inline, protected] |
References dw::core::SelectionState::buttonMotion(), layout, and dw::core::Layout::selectionState.
| bool dw::core::Widget::selectionButtonPress | ( | Iterator * | it, | |
| int | charPos, | |||
| int | linkNo, | |||
| EventButton * | event, | |||
| bool | withinContent | |||
| ) | [inline, protected] |
References dw::core::SelectionState::buttonPress(), layout, and dw::core::Layout::selectionState.
| bool dw::core::Widget::selectionButtonRelease | ( | Iterator * | it, | |
| int | charPos, | |||
| int | linkNo, | |||
| EventButton * | event, | |||
| bool | withinContent | |||
| ) | [inline, protected] |
References dw::core::SelectionState::buttonRelease(), layout, and dw::core::Layout::selectionState.
| bool dw::core::Widget::selectionHandleEvent | ( | SelectionState::EventType | eventType, | |
| Iterator * | it, | |||
| int | charPos, | |||
| int | linkNo, | |||
| MousePositionEvent * | event | |||
| ) | [inline, protected] |
References dw::core::SelectionState::handleEvent(), layout, and dw::core::Layout::selectionState.
Referenced by dw::Textblock::sendSelectionEvent().
| void dw::core::Widget::setAscent | ( | int | ascent | ) | [virtual] |
Reimplemented in dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by dw::Textblock::calcWidgetSize(), dw::core::ui::ComplexButtonResource::setAscent(), and dw::core::Layout::setSizeHints().
| void dw::core::Widget::setBgColor | ( | style::Color * | bgColor | ) |
Set the background "behind" the widget, if it is not the background of the parent widget, e.g. the background of a table row.
| void dw::core::Widget::setButtonSensitive | ( | bool | buttonSensitive | ) |
References buttonSensitiveSet.
Referenced by dw::Table::Table(), dw::TableCell::TableCell(), and dw::Textblock::Textblock().
| void dw::core::Widget::setCursor | ( | style::Cursor | cursor | ) | [inline, protected] |
References layout, and dw::core::Layout::setCursor().
Referenced by dw::Textblock::motionNotifyImpl(), and dw::Image::motionNotifyImpl().
| void dw::core::Widget::setDeleteCallback | ( | DW_Callback_t | func, | |
| void * | data | |||
| ) | [inline] |
References deleteCallbackData, and deleteCallbackFunc.
| void dw::core::Widget::setDescent | ( | int | descent | ) | [virtual] |
Reimplemented in dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by dw::Textblock::calcWidgetSize(), dw::core::ui::ComplexButtonResource::setDescent(), and dw::core::Layout::setSizeHints().
| void dw::core::Widget::setFlags | ( | Flags | f | ) | [inline, protected] |
References flags.
Referenced by queueResize(), dw::Ruler::Ruler(), dw::core::ui::Embed::setUsesHints(), sizeAllocate(), dw::Table::Table(), and dw::Textblock::Textblock().
| void dw::core::Widget::setParent | ( | Widget * | parent | ) |
References buttonSensitive, buttonSensitiveSet, and layout.
Referenced by dw::Textblock::addWidget().
| void dw::core::Widget::setStyle | ( | style::Style * | style | ) | [virtual] |
Change the style of a widget.
The old style is automatically unreferred, the new is referred. If this call causes the widget to change its size, dw::core::Widget::queueResize is called.
Reimplemented in dw::core::ui::Embed.
References layout, queueDraw(), queueResize(), dw::core::style::Style::ref(), dw::core::style::StyleAttrs::sizeDiffs(), dw::core::style::Style::unref(), and dw::core::Layout::updateCursor().
Referenced by dw::Textblock::addWidget(), and dw::Textblock::changeLinkColor().
| void dw::core::Widget::setWidth | ( | int | width | ) | [virtual] |
Reimplemented in dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by dw::Textblock::calcWidgetSize(), dw::core::Layout::setSizeHints(), and dw::core::ui::ComplexButtonResource::setWidth().
| void dw::core::Widget::sizeAllocate | ( | Allocation * | allocation | ) |
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed.
References dw::core::Allocation::ascent, DBG_OBJ_SET_NUM, dw::core::Allocation::descent, layout, NEEDS_ALLOCATE, needsAllocate(), dw::core::Layout::queueDrawExcept(), resizeDrawImpl(), setFlags(), sizeAllocateImpl(), unsetFlags(), WAS_ALLOCATED, wasAllocated(), dw::core::Allocation::width, dw::core::Allocation::x, and dw::core::Allocation::y.
Referenced by dw::core::Layout::resizeIdle().
| void dw::core::Widget::sizeAllocateImpl | ( | Allocation * | allocation | ) | [protected, virtual] |
Reimplemented in dw::Image, dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by sizeAllocate().
| void dw::core::Widget::sizeRequest | ( | Requisition * | requisition | ) |
This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed.
References dw::core::Requisition::ascent, DBG_OBJ_SET_NUM, dw::core::Requisition::descent, NEEDS_RESIZE, needsResize(), sizeRequestImpl(), unsetFlags(), and dw::core::Requisition::width.
Referenced by dw::Textblock::calcWidgetSize(), getExtremesImpl(), dw::core::Layout::resizeIdle(), and dw::core::ui::ComplexButtonResource::sizeRequest().
| virtual void dw::core::Widget::sizeRequestImpl | ( | Requisition * | requisition | ) | [protected, pure virtual] |
Implemented in dw::Bullet, dw::Image, dw::Ruler, dw::Table, dw::Textblock, and dw::core::ui::Embed.
Referenced by sizeRequest().
| void dw::core::Widget::unsetFlags | ( | Flags | f | ) | [inline, protected] |
References flags.
Referenced by getExtremes(), dw::Ruler::Ruler(), sizeAllocate(), and sizeRequest().
| bool dw::core::Widget::usesHints | ( | ) | [inline] |
References flags, and USES_HINTS.
Referenced by dw::Textblock::calcWidgetSize(), and dw::core::ui::ComplexButtonResource::setEmbed().
| bool dw::core::Widget::wasAllocated | ( | ) | [inline] |
References flags, and WAS_ALLOCATED.
Referenced by dw::Textblock::addAnchor(), dw::Image::setBuffer(), and sizeAllocate().
friend class Layout [friend] |
Allocation dw::core::Widget::allocation [protected] |
The current allocation: size and position, always relative to the canvas.
Referenced by dw::Textblock::addAnchor(), dw::Textblock::changeLinkColor(), dw::core::Layout::draw(), dw::Image::draw(), dw::Bullet::draw(), drawBox(), dw::Textblock::drawSpace(), dw::Textblock::drawText(), drawWidgetBox(), getAllocation(), dw::Textblock::TextblockIterator::getAllocation(), getContentWidth(), getHeight(), getWidgetAtPoint(), dw::Textblock::getWidgetAtPoint(), intersects(), dw::Textblock::lineYOffsetCanvas(), dw::Textblock::lineYOffsetWidget(), queueDraw(), queueDrawArea(), dw::Textblock::queueDrawRange(), dw::Textblock::resizeDrawImpl(), dw::Table::resizeDrawImpl(), scrollTo(), and Widget().
style::Color* dw::core::Widget::bgColor [private] |
bool dw::core::Widget::buttonSensitive [private] |
See dw::core::Widget::setButtonSensitive().
Referenced by isButtonSensitive(), setParent(), and Widget().
bool dw::core::Widget::buttonSensitiveSet [private] |
See dw::core::Widget::setButtonSensitive().
Referenced by setButtonSensitive(), setParent(), and Widget().
int dw::core::Widget::CLASS_ID = -1 [static] |
Reimplemented in dw::AlignedTextblock, dw::Image, dw::ListItem, dw::Table, dw::TableCell, dw::Textblock, and dw::core::ui::Embed.
Referenced by Widget().
void* dw::core::Widget::deleteCallbackData [private] |
Referenced by setDeleteCallback(), Widget(), and ~Widget().
Referenced by setDeleteCallback(), Widget(), and ~Widget().
Extremes dw::core::Widget::extremes [private] |
Analogue to dw::core::Widget::requisition.
Referenced by dw::Table::apportion2(), and dw::Table::forceCalcCellSizes().
Flags dw::core::Widget::flags [private] |
Referenced by blockLevel(), extremesChanged(), hasContents(), needsAllocate(), needsResize(), setFlags(), unsetFlags(), usesHints(), wasAllocated(), and Widget().
Layout* dw::core::Widget::layout [protected] |
Referenced by addAnchor(), dw::Textblock::addText(), dw::core::Layout::addWidget(), dw::Image::buttonPressImpl(), dw::Image::buttonReleaseImpl(), dw::Textblock::calcTextSize(), changeAnchor(), dw::Textblock::changeLinkColor(), dw::Image::draw(), dw::Textblock::drawText(), drawWidgetBox(), dw::Image::enterNotifyImpl(), dw::Textblock::TextblockIterator::getAllocation(), getBgColor(), getLayout(), dw::TableCell::getValue(), dw::Textblock::leaveNotifyImpl(), dw::Image::leaveNotifyImpl(), dw::Textblock::motionNotifyImpl(), dw::Image::motionNotifyImpl(), queueDrawArea(), queueResize(), removeAnchor(), scrollTo(), selectionButtonMotion(), selectionButtonPress(), selectionButtonRelease(), selectionHandleEvent(), dw::Textblock::sendSelectionEvent(), setCursor(), setParent(), setStyle(), sizeAllocate(), dw::Image::sizeRequestImpl(), Widget(), dw::Textblock::wordWrap(), and ~Widget().
Widget* dw::core::Widget::parent [private] |
The parent widget, NULL for top-level widgets.
Referenced by drawWidgetBox(), getBgColor(), getLevel(), getNearestCommonAncestor(), getParent(), getTopLevel(), dw::Textblock::handOverBreak(), intersects(), queueResize(), Widget(), and ~Widget().
This value is defined by the parent widget, and used for incremential resizing.
See documentation for an explanation.
Referenced by dw::Textblock::addWidget(), and queueResize().
Requisition dw::core::Widget::requisition [private] |
Size_request() stores the result of the last call of size_request_impl().
Do not read this directly, but call size_request().
Referenced by dw::Textblock::calcWidgetSize(), and getExtremesImpl().
style::Style* dw::core::Widget::style [private] |
1.5.9