|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <container.hpp>
Public Types | |
| enum class | LayoutPolicy : uint8_t { Absolute = 0 , AutoSize , Vertical , Horizontal , Circular } |
| Public Types inherited from fcn::Widget | |
| enum | BorderSide : uint8_t { BORDER_NONE = 0 , BORDER_LEFT = 1 << 0 , BORDER_TOP = 1 << 1 , BORDER_RIGHT = 1 << 2 , BORDER_BOTTOM = 1 << 3 , BORDER_ALL = BORDER_LEFT | BORDER_TOP | BORDER_RIGHT | BORDER_BOTTOM } |
| enum | BorderStyle : uint8_t { BORDER_STYLE_BEVEL = 0 , BORDER_STYLE_FLAT = 1 } |
| enum class | SelectionMode : uint8_t { None = 0 , Border = 1 , Background = 2 } |
Public Member Functions | |
| virtual void | add (Widget *widget) |
| virtual void | add (Widget *widget, int x, int y) |
| void | addContainerListener (ContainerListener *containerListener) |
| virtual void | addWidget (std::unique_ptr< Widget > widget) |
| virtual void | addWidget (std::unique_ptr< Widget > widget, int x, int y) |
| void | adjustSize () override |
| Container () | |
| Container (Container &&)=delete | |
| Container (Container const &)=delete | |
| void | draw (Graphics *graphics) override |
| void | expandContent () |
| void | expandContent (bool recursion) override |
| Widget * | findWidgetById (std::string const &id) override |
| Widget * | getBackgroundWidget () |
| Widget * | getChild (unsigned int index) const |
| Rectangle | getChildrenArea () override |
| virtual unsigned int | getHorizontalSpacing () const |
| virtual LayoutPolicy | getLayout () const |
| virtual unsigned int | getVerticalSpacing () const |
| bool | isLayouted () override |
| virtual bool | isOpaque () const |
| virtual bool | isUniformSize () const |
| Container & | operator= (Container &&)=delete |
| Container & | operator= (Container const &)=delete |
| void | remove (Widget *widget) override |
| void | removeAllChildren () override |
| void | removeContainerListener (ContainerListener *containerListener) |
| void | resizeToContent (bool recursion=true) override |
| void | setBackgroundWidget (Widget *widget) |
| virtual void | setHorizontalSpacing (unsigned int spacing) |
| virtual void | setLayout (LayoutPolicy policy) |
| virtual void | setOpacity (float opacity) |
| virtual void | setOpaque (bool opaque) |
| virtual void | setUniformSize (bool uniform) |
| virtual void | setVerticalSpacing (unsigned int spacing) |
| Public Member Functions inherited from fcn::Widget | |
| virtual void | _draw (Graphics *graphics) |
| virtual FocusHandler * | _getFocusHandler () |
| virtual std::list< FocusListener * > const & | _getFocusListeners () |
| virtual FocusHandler * | _getInternalFocusHandler () |
| virtual std::list< KeyListener * > const & | _getKeyListeners () |
| virtual std::list< MouseListener * > const & | _getMouseListeners () |
| virtual void | _logic () |
| virtual void | _setFocusHandler (FocusHandler *focusHandler) |
| virtual void | _setParent (Widget *parent) |
| void | adaptLayout () |
| virtual void | adaptLayout (bool top) |
| void | addActionListener (ActionListener *actionListener) |
| void | addDeathListener (DeathListener *deathListener) |
| void | addDropTargetListener (DropTargetListener *listener) |
| void | addFocusListener (FocusListener *focusListener) |
| void | addKeyListener (KeyListener *keyListener) |
| void | addMouseListener (MouseListener *mouseListener) |
| void | addWidgetListener (WidgetListener *widgetListener) |
| bool | captureMouse () |
| bool | contains (int x, int y) const |
| virtual void | drawBorder (Graphics *graphics) |
| void | drawBorder (Graphics *graphics, unsigned int sides) const |
| virtual void | drawOutline (Graphics *graphics) |
| virtual void | drawSelectionFrame (Graphics *graphics) |
| void | expandContent () |
| virtual void | focusNext () |
| virtual void | focusPrevious () |
| virtual void | fontChanged () |
| virtual void | getAbsolutePosition (int &x, int &y) const |
| std::string const & | getActionEventId () const |
| Color const & | getBackgroundColor () const |
| Color const & | getBaseColor () const |
| Color const & | getBorderColor () const |
| unsigned int | getBorderSides () const |
| unsigned int | getBorderSize () const |
| unsigned int | getBorderStyle () const |
| unsigned int | getChildrenCount () const |
| Rectangle const & | getDimension () const |
| Size const & | getFixedSize () const |
| Font * | getFont () const |
| Color const & | getForegroundColor () const |
| int | getHeight () const |
| std::string const & | getId () const |
| void | getLastPosition (int &x, int &y) const |
| int | getMarginBottom () const |
| int | getMarginLeft () const |
| int | getMarginRight () const |
| int | getMarginTop () const |
| Size const & | getMaxSize () const |
| Size const & | getMinSize () const |
| Color const & | getOutlineColor () const |
| unsigned int | getOutlineSize () const |
| unsigned int | getPaddingBottom () const |
| unsigned int | getPaddingLeft () const |
| unsigned int | getPaddingRight () const |
| unsigned int | getPaddingTop () const |
| virtual Widget * | getParent () const |
| Color const & | getSelectionColor () const |
| SelectionMode | getSelectionMode () const |
| virtual Widget * | getTop () const |
| unsigned int | getVisibleChildrenCount () const |
| Widget * | getWidgetAt (int x, int y) |
| virtual Widget * | getWidgetAt (int x, int y, Widget *exclude) |
| std::list< Widget * > | getWidgetsIn (Rectangle const &area) |
| virtual std::list< Widget * > | getWidgetsIn (Rectangle const &area, Widget *ignore) |
| int | getWidth () const |
| int | getX () const |
| int | getY () const |
| bool | hasMouseCapture () const |
| bool | isDescendantOf (Widget const *ancestor) const noexcept |
| bool | isEnabled () const |
| bool | isFixedSize () const |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| bool | isHorizontalExpand () const |
| bool | isInsideActiveMouseModal () const noexcept |
| bool | isLastPositionSet () const |
| virtual bool | isModalFocusable () const |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocusable () const |
| bool | isMouseInside (MouseEvent const &mouseEvent) const |
| bool | isSetVisible () const |
| bool | isTabInEnabled () const |
| bool | isTabOutEnabled () const |
| virtual bool | isUnderMouseModal () const |
| bool | isVerticalExpand () const |
| bool | isVisible () const |
| virtual void | logic () |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | moveToTop (Widget *widget) |
| virtual void | onFocusChanged () |
| virtual void | onFocusGained () |
| virtual void | onFocusLost () |
| Widget & | operator= (Widget &&)=delete |
| Widget & | operator= (Widget const &)=delete |
| void | releaseMouse () |
| void | removeActionListener (ActionListener *actionListener) |
| void | removeDeathListener (DeathListener *deathListener) |
| void | removeDropTargetListener (DropTargetListener *listener) |
| void | removeFocusListener (FocusListener *focusListener) |
| void | removeKeyListener (KeyListener *keyListener) |
| void | removeMouseListener (MouseListener *mouseListener) |
| void | removeWidgetListener (WidgetListener *widgetListener) |
| virtual void | requestFocus () |
| virtual void | requestMoveToBottom () |
| virtual void | requestMoveToTop () |
| void | setActionEventId (std::string const &actionEventId) |
| virtual void | setBackgroundColor (Color const &color) |
| virtual void | setBaseColor (Color const &color) |
| void | setBorderBottom (unsigned int size, unsigned int style) |
| virtual void | setBorderColor (Color const &color) |
| void | setBorderSides (unsigned int sides) |
| void | setBorderSize (unsigned int size) |
| void | setBorderStyle (unsigned int style) |
| void | setBorderTop (unsigned int size, unsigned int style) |
| virtual void | setDimension (Rectangle const &dimension) |
| void | setEnabled (bool enabled) |
| void | setFixedSize (Size const &size) |
| void | setFocusable (bool focusable) |
| virtual void | setFocused (bool focused) |
| virtual void | setFont (Font *font) |
| virtual void | setForegroundColor (Color const &color) |
| virtual void | setHeight (int height) |
| void | setHorizontalExpand (bool expand) |
| void | setId (std::string const &id) |
| void | setInternalFocusHandler (FocusHandler *internalFocusHandler) |
| void | setLastPosition (int x, int y) |
| void | setMargin (int margin) |
| void | setMarginBottom (int margin) |
| void | setMarginLeft (int margin) |
| void | setMarginRight (int margin) |
| void | setMarginTop (int margin) |
| void | setMaxSize (Size const &size) |
| void | setMinSize (Size const &size) |
| virtual void | setOutlineColor (Color const &color) |
| void | setOutlineSize (unsigned int size) |
| void | setPadding (unsigned int padding) |
| void | setPaddingBottom (unsigned int padding) |
| void | setPaddingLeft (unsigned int padding) |
| void | setPaddingRight (unsigned int padding) |
| void | setPaddingTop (unsigned int padding) |
| void | setPosition (int x, int y) |
| virtual void | setSelectionColor (Color const &color) |
| virtual void | setSelectionMode (SelectionMode mode) |
| virtual void | setSize (int width, int height) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| virtual void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| virtual void | showWidgetPart (Widget *widget, Rectangle area) |
| virtual void | textInput (TextInputEvent &event) |
| Widget () | |
| Widget (Widget &&)=delete | |
| Widget (Widget const &)=delete | |
Protected Types | |
| using | ContainerListenerIterator = ContainerListenerList::iterator |
| using | ContainerListenerList = std::list<ContainerListener*> |
Protected Member Functions | |
| void | distributeWidgetAddedEvent (Widget *source) |
| void | distributeWidgetRemovedEvent (Widget *source) |
| Protected Member Functions inherited from fcn::Widget | |
| void | add (Widget *widget) |
| void | calculateSize () |
| void | distributeActionEvent () |
| void | distributeAncestorHiddenEvent (Widget *ancestor) |
| void | distributeAncestorMovedEvent (Widget *ancestor) |
| void | distributeAncestorShownEvent (Widget *ancestor) |
| void | distributeDragDrop (DragEvent &event) |
| bool | distributeDragEnter (DragEvent &event) |
| void | distributeDragHover (DragEvent &event) |
| void | distributeDragLeave (DragEvent &event) |
| void | distributeHiddenEvent () |
| void | distributeMovedEvent () |
| void | distributeResizedEvent () |
| void | distributeShownEvent () |
| std::list< Widget * > const & | getChildren () const |
| void | resizeToChildren () |
Protected Attributes | |
| Widget * | mBackgroundWidget {nullptr} |
| ContainerListenerList | mContainerListeners |
| unsigned int | mHorizontalSpacing {2} |
| LayoutPolicy | mLayout {LayoutPolicy::Absolute} |
| float | mOpacity {1.0F} |
| bool | mOpaque {true} |
| bool | mUniform {false} |
| unsigned int | mVerticalSpacing {2} |
| Protected Attributes inherited from fcn::Widget | |
| std::string | mActionEventId |
| std::list< ActionListener * > | mActionListeners |
| Color | mBackgroundColor {0xf9fafb} |
| Color | mBaseColor {0xe5e7eb} |
| Color | mBorderColor {0xd1d5db} |
| unsigned int | mBorderSides {BORDER_ALL} |
| unsigned int | mBorderSize {0} |
| unsigned int | mBorderStyle {BORDER_STYLE_FLAT} |
| std::list< Widget * > | mChildren |
| Font * | mCurrentFont {nullptr} |
| std::list< DeathListener * > | mDeathListeners |
| Rectangle | mDimension |
| std::list< DropTargetListener * > | mDropTargetListeners |
| bool | mEnabled {true} |
| Size | mFixedSize {-1, -1} |
| bool | mFixedSizeUsed {false} |
| bool | mFocusable {false} |
| bool | mFocused {false} |
| FocusHandler * | mFocusHandler {nullptr} |
| std::list< FocusListener * > | mFocusListeners |
| Color | mForegroundColor {0x1f2933} |
| bool | mHExpand {false} |
| std::string | mId |
| FocusHandler * | mInternalFocusHandler {nullptr} |
| std::list< KeyListener * > | mKeyListeners |
| int | mLastX {0} |
| int | mLastY {0} |
| int | mMarginBottom {0} |
| int | mMarginLeft {0} |
| int | mMarginRight {0} |
| int | mMarginTop {0} |
| Size | mMaxSize {std::numeric_limits<int>::max(), std::numeric_limits<int>::max()} |
| Size | mMinSize {0, 0} |
| std::list< MouseListener * > | mMouseListeners |
| Rectangle | mOffsetRect |
| Color | mOutlineColor {0x9ca3af} |
| unsigned int | mOutlineSize {0} |
| unsigned int | mPaddingBottom {0} |
| unsigned int | mPaddingLeft {0} |
| unsigned int | mPaddingRight {0} |
| unsigned int | mPaddingTop {0} |
| Widget * | mParent {nullptr} |
| Color | mSelectionColor {0x3b82f6} |
| SelectionMode | mSelectionMode {SelectionMode::None} |
| bool | mTabIn {true} |
| bool | mTabOut {true} |
| bool | mVExpand {false} |
| bool | mVisible {true} |
| std::list< WidgetListener * > | mWidgetListeners |
Additional Inherited Members | |
| Static Public Member Functions inherited from fcn::Widget | |
| static DeathListener * | _getGuiDeathListener () |
| static VisibilityEventHandler * | _getVisibilityEventHandler () |
| static void | _setGuiDeathListener (DeathListener *deathListener) |
| static void | _setVisibilityEventHandler (VisibilityEventHandler *visibilityEventHandler) |
| static Widget * | getMouseCapture () |
| static void | resetGlobalFont () |
| static void | setGlobalFont (Font *font) |
| static bool | widgetExists (Widget const *widget) |
| Static Protected Attributes inherited from fcn::Widget | |
| static DefaultFont | mDefaultFont |
| static Font * | mGlobalFont = nullptr |
| static DeathListener * | mGuiDeathListener = nullptr |
| static VisibilityEventHandler * | mVisibilityEventHandler = nullptr |
| static std::list< Widget * > | mWidgetInstances |
| static Widget * | sMouseCapture = nullptr |
A composite widget capable of holding and managing child widgets.
A widget's position in the container is relative to the container itself and not the screen. A container is the most common widget to use as the GUI's top widget as makes the GUI able to contain more than one widget.
Definition at line 35 of file container.hpp.
|
protected |
Iterator for ContainerListenerList.
Definition at line 353 of file container.hpp.
|
protected |
Typdef.
Definition at line 345 of file container.hpp.
|
strong |
The layout policy of the container.
Absolute: manual positioning by user, no layout management. AutoSize: container is resized based on its children, no layout management. Vertical: children are stacked vertically, container is resized based on its children. Horizontal: children are stacked horizontally, container is resized based on its children. Circular: children are arranged in a circular pattern, container is resized based on its children.
Definition at line 49 of file container.hpp.
|
default |
Constructor.
A container is opaque as default. If you want a non-opaque container call setOpaque(false).
The default layout policy of the container is Absolute, which means that the position of the children. setLayout stores the layout policy of the container, and getLayout returns the current layout policy of the container. resizeToContent and expandContent will only have an effect if the layout policy is not Absolute. expandContent will only have an effect if the layout policy is Vertical, Horizontal or Circular.
References add(), addContainerListener(), addWidget(), adjustSize(), Container(), draw(), expandContent(), fcn::Widget::expandContent(), findWidgetById(), getChild(), getChildrenArea(), isOpaque(), remove(), removeAllChildren(), removeContainerListener(), resizeToContent(), fcn::Widget::resizeToContent(), setOpacity(), setOpaque(), and fcn::Widget::Widget().
Referenced by Container(), fcn::MenuPopup::hide(), fcn::MenuPopup::mousePressed(), fcn::ModalBackdrop::mousePressed(), and fcn::MenuPopup::show().
|
virtual |
Adds a widget to the container.
| widget | The widget to add. |
Reimplemented in fcn::AdjustingContainer.
Definition at line 93 of file container.cpp.
References fcn::Widget::add(), distributeWidgetAddedEvent(), and fcn::Widget::Widget().
Referenced by fcn::AdjustingContainer::add(), fcn::MenuPopup::addItem(), fcn::MenuBar::addMenu(), fcn::MenuPopup::addSeparator(), addWidget(), addWidget(), Container(), fcn::MenuPopup::show(), and fcn::StatusBar::StatusBar().
|
virtual |
Adds a widget to the container at a given position.
The position is relative to the container (not the screen).
| widget | The widget to add. |
| x | The x coordinate for the widget. |
| y | The y coordinate for the widget. |
Reimplemented in fcn::AdjustingContainer.
Definition at line 109 of file container.cpp.
References fcn::Widget::add(), distributeWidgetAddedEvent(), fcn::Widget::setPosition(), and fcn::Widget::Widget().
| void fcn::Container::addContainerListener | ( | ContainerListener * | containerListener | ) |
Adds a container listener to the container.
When a widget is added or removed an event will be sent to all container listeners of the container
| containerListener | The container listener to add. |
Definition at line 142 of file container.cpp.
References mContainerListeners.
Referenced by Container().
|
virtual |
Adds a widget to the container, transferring ownership.
| widget | The widget to add. |
Definition at line 99 of file container.cpp.
References add(), and fcn::Widget::Widget().
Referenced by Container().
|
virtual |
Adds a widget to the container at position, transferring ownership.
| widget | The widget to add. |
| x | X coordinate. |
| y | Y coordinate. |
Definition at line 116 of file container.cpp.
References add(), and fcn::Widget::Widget().
|
overridevirtual |
Adjust the size of the container after layout computations.
Reimplemented from fcn::Widget.
Reimplemented in fcn::HorizontalBar, fcn::Panel, fcn::Tab, and fcn::Window.
Definition at line 363 of file container.cpp.
References fcn::Widget::getBorderSize(), fcn::Widget::getHeight(), fcn::Widget::getPaddingBottom(), fcn::Widget::getPaddingLeft(), fcn::Widget::getPaddingRight(), fcn::Widget::getPaddingTop(), fcn::Widget::getWidth(), fcn::Widget::resizeToChildren(), and fcn::Widget::setSize().
Referenced by fcn::ActivityBar::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::Panel::adjustSize(), fcn::Tab::adjustSize(), and Container().
|
protected |
Distributes a widget added container event to all container listeners of the container.
| source | The source widget of the event. |
Definition at line 153 of file container.cpp.
References mContainerListeners, and fcn::Widget::Widget().
|
protected |
Distributes a widget removed container event to all container listeners of the container.
| source | The source widget of the event. |
Definition at line 163 of file container.cpp.
References mContainerListeners, and fcn::Widget::Widget().
Referenced by remove().
|
overridevirtual |
Draws the widget.
The call to draw is initiated by the widget's parent. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension. If a widget has children, the parent's draw function will always be called before the children's draw functions are called.
| graphics | A graphics object to draw with. |
Implements fcn::Widget.
Reimplemented in fcn::HorizontalBar, fcn::MenuBar, fcn::MenuPopup, fcn::ModalBackdrop, fcn::Panel, fcn::StatusBar, fcn::Tab, fcn::Tooltip, and fcn::Window.
Definition at line 25 of file container.cpp.
References fcn::Widget::drawBorder(), fcn::Widget::drawSelectionFrame(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getBorderSides(), fcn::Widget::getBorderSize(), fcn::Widget::getHeight(), fcn::Widget::getSelectionColor(), fcn::Widget::getSelectionMode(), fcn::Widget::getWidth(), fcn::Widget::isFocused(), isOpaque(), mBackgroundWidget, and fcn::Graphics::setColor().
Referenced by Container(), fcn::ActivityBar::draw(), fcn::HorizontalBar::draw(), fcn::MenuPopup::draw(), fcn::Panel::draw(), and fcn::Tooltip::draw().
|
inline |
Expands the child widgets to the size of this widget, calls recursively all childs.
This is a convenience wrapper that calls expandContent(true).
Definition at line 1597 of file widget.hpp.
|
overridevirtual |
Expand children to occupy available space in this container.
| recursion | If true, expand children recursively. |
Reimplemented from fcn::Widget.
Reimplemented in fcn::FlowContainer.
Definition at line 372 of file container.cpp.
References getChildrenArea(), getHorizontalSpacing(), fcn::Widget::getParent(), getVerticalSpacing(), fcn::Rectangle::height, fcn::Widget::isHorizontalExpand(), fcn::Widget::isVerticalExpand(), fcn::Widget::mChildren, mLayout, mUniform, fcn::Math< float >::pi(), fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by Container().
|
overridevirtual |
Finds a widget given an id.
| id | The id to find a widget by. |
Reimplemented from fcn::Widget.
Definition at line 137 of file container.cpp.
References fcn::Widget::findWidgetById(), and fcn::Widget::Widget().
Referenced by Container().
| Widget * fcn::Container::getBackgroundWidget | ( | ) |
Get the background widget if one is set.
Definition at line 760 of file container.cpp.
References mBackgroundWidget, and fcn::Widget::Widget().
| Widget * fcn::Container::getChild | ( | unsigned int | index | ) | const |
Gets child by index.
| index | Child index. |
Definition at line 173 of file container.cpp.
References fcn::Widget::getChildren(), fcn::Widget::getChildrenCount(), and fcn::Widget::Widget().
Referenced by Container(), fcn::MenuBar::keyPressed(), fcn::MenuPopup::mousePressed(), and fcn::ModalBackdrop::mousePressed().
|
overridevirtual |
Gets the area of the widget occupied by the widget's children.
By default this method returns an empty rectangle as not all widgets are containers. If you want to make a container this method should return the area where the children resides. This method is used when drawing children of a widget when computing clip rectangles for the children.
An example of a widget that overloads this method is ScrollArea. A ScrollArea has a view of its constant and that view is the children area. The size of a ScrollArea's children area might vary depending on if the scroll bars of the ScrollArea is shown or not.
Reimplemented from fcn::Widget.
Reimplemented in fcn::Tab, fcn::Tooltip, and fcn::Window.
Definition at line 710 of file container.cpp.
References fcn::Widget::getBorderSides(), fcn::Widget::getBorderSize(), fcn::Widget::getHeight(), fcn::Widget::getPaddingBottom(), fcn::Widget::getPaddingLeft(), fcn::Widget::getPaddingRight(), fcn::Widget::getPaddingTop(), fcn::Widget::getWidth(), fcn::Rectangle::height, fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::FlowContainer::adjustContent(), Container(), expandContent(), fcn::Tooltip::getChildrenArea(), and resizeToContent().
|
virtual |
Get the horizontal spacing between rows.
Definition at line 746 of file container.cpp.
References mHorizontalSpacing.
Referenced by fcn::FlowContainer::adjustContent(), expandContent(), and resizeToContent().
|
virtual |
Gets the layout of the container.
Definition at line 695 of file container.cpp.
References mLayout.
Referenced by fcn::TabbedArea::addTab(), fcn::HorizontalBar::adjustSize(), and fcn::HorizontalBar::resizeToContent().
|
virtual |
Get the vertical spacing between rows.
Definition at line 736 of file container.cpp.
References mVerticalSpacing.
Referenced by fcn::FlowContainer::adjustContent(), expandContent(), and resizeToContent().
|
inlineoverridevirtual |
Helper function to decide if we need to layout.
Reimplemented from fcn::Widget.
Definition at line 227 of file container.hpp.
References mLayout.
|
virtual |
Checks if the container is opaque or not.
Reimplemented in fcn::Window.
Definition at line 88 of file container.cpp.
References mOpaque.
Referenced by Container(), fcn::ActivityBar::draw(), draw(), fcn::HorizontalBar::draw(), fcn::MenuBar::draw(), fcn::Panel::draw(), and fcn::StatusBar::draw().
|
virtual |
True if the container tries to expand the childs to a uniform size.
Definition at line 705 of file container.cpp.
References mUniform.
Referenced by fcn::HorizontalBar::adjustSize(), and fcn::HorizontalBar::resizeToContent().
|
overridevirtual |
Removes a widget from the Container.
| widget | The widget to remove. |
| Exception | when the widget has not been added to the container. |
Reimplemented from fcn::Widget.
Definition at line 126 of file container.cpp.
References distributeWidgetRemovedEvent(), fcn::Widget::remove(), and fcn::Widget::Widget().
Referenced by Container(), and fcn::AdjustingContainer::remove().
|
overridevirtual |
Removes all widgets from the the container.
Reimplemented from fcn::Widget.
Definition at line 132 of file container.cpp.
References fcn::Widget::removeAllChildren().
Referenced by Container(), and fcn::AdjustingContainer::removeAllChildren().
| void fcn::Container::removeContainerListener | ( | ContainerListener * | containerListener | ) |
Removes a container listener from the container.
| containerListener | The container listener to remove. |
Definition at line 148 of file container.cpp.
References mContainerListeners.
Referenced by Container().
|
overridevirtual |
Resize this container to fit its children.
| recursion | If true, resize children recursively. |
Reimplemented from fcn::Widget.
Reimplemented in fcn::FlowContainer, and fcn::HorizontalBar.
Definition at line 185 of file container.cpp.
References getChildrenArea(), fcn::Widget::getDimension(), getHorizontalSpacing(), getVerticalSpacing(), fcn::Rectangle::height, fcn::Widget::mChildren, mLayout, fcn::Math< float >::pi(), fcn::Widget::setSize(), fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::MenuPopup::addItem(), fcn::MenuPopup::addSeparator(), Container(), fcn::ActivityBar::resizeToContent(), fcn::AdjustingContainer::resizeToContent(), and fcn::HorizontalBar::resizeToContent().
| void fcn::Container::setBackgroundWidget | ( | Widget * | widget | ) |
Set a widget that will be rendered behind other children as the background.
| widget | Background widget (ownership is not transferred). |
Definition at line 751 of file container.cpp.
References mBackgroundWidget, and fcn::Widget::Widget().
|
virtual |
Set the horizontal spacing between columns.
| spacing | spacing in pixels. |
Definition at line 741 of file container.cpp.
References mHorizontalSpacing.
Referenced by fcn::HorizontalBar::setSpacing().
|
virtual |
Sets the layout of the container.
| policy | The LayoutPolicy of the container. |
Reimplemented in fcn::FlowContainer.
Definition at line 690 of file container.cpp.
References mLayout.
Referenced by fcn::ActivityBar::ActivityBar(), fcn::TabbedArea::addTab(), fcn::BarSection::BarSection(), fcn::HorizontalBar::HorizontalBar(), fcn::MenuPopup::MenuPopup(), fcn::FlowContainer::setLayout(), and fcn::StatusBar::StatusBar().
|
virtual |
Sets the opacity of the container.
A container is opaque (setOpaque(true)) when it is fully opaque (opacity = 1.0). A container is transparent (setOpaque(false)) when it is fully transparent (opacity = 0.0).
| opacity | Opacity value between 0.0 (fully transparent) and 1.0 (fully opaque). |
Definition at line 72 of file container.cpp.
References mOpacity, and setOpaque().
Referenced by Container().
|
virtual |
Sets the container to be opaque or not.
If the container is opaque its background will be drawn, if it's not opaque its background will not be drawn, and thus making the container completely transparent.
| opaque | True if the container should be opaque, false otherwise. |
Reimplemented in fcn::Window.
Definition at line 83 of file container.cpp.
References mOpaque.
Referenced by fcn::ActivityBar::ActivityBar(), Container(), fcn::HorizontalBar::HorizontalBar(), fcn::MenuBar::MenuBar(), fcn::MenuPopup::MenuPopup(), fcn::ModalBackdrop::ModalBackdrop(), setOpacity(), and fcn::Tooltip::Tooltip().
|
virtual |
If enabled, the free space is distributed in a way that the size of the childrens will be equal (if possible).
Otherwise the free space will evenly distributed.
| uniform | Indicates if uniform size is enabled or not. |
Definition at line 700 of file container.cpp.
References mUniform.
Referenced by fcn::HorizontalBar::adjustSize(), and fcn::HorizontalBar::resizeToContent().
|
virtual |
Set the vertical spacing between rows.
| spacing | spacing in pixels. |
Definition at line 731 of file container.cpp.
References mVerticalSpacing.
Referenced by fcn::ActivityBar::setSpacing().
|
protected |
Optional widget that is rendered behind other children as the container background.
Definition at line 378 of file container.hpp.
Referenced by draw(), fcn::Window::draw(), getBackgroundWidget(), and setBackgroundWidget().
|
protected |
The container listeners of the container.
Definition at line 350 of file container.hpp.
Referenced by addContainerListener(), distributeWidgetAddedEvent(), distributeWidgetRemovedEvent(), and removeContainerListener().
|
protected |
HorizontalSpacing.
Definition at line 373 of file container.hpp.
Referenced by fcn::AdjustingContainer::adjustContent(), fcn::AdjustingContainer::adjustSize(), getHorizontalSpacing(), and setHorizontalSpacing().
|
protected |
Layout.
Definition at line 358 of file container.hpp.
Referenced by fcn::FlowContainer::adjustContent(), expandContent(), fcn::FlowContainer::expandContent(), getLayout(), isLayouted(), resizeToContent(), fcn::FlowContainer::resizeToContent(), and setLayout().
|
protected |
Opacity of the container, between 0.0 (fully transparent) and 1.0 (fully opaque).
Definition at line 335 of file container.hpp.
Referenced by setOpacity().
|
protected |
True if the container is opaque, false otherwise.
Definition at line 340 of file container.hpp.
Referenced by isOpaque(), fcn::Window::isOpaque(), setOpaque(), and fcn::Window::setOpaque().
|
protected |
Indicates if the childs should be expanded to a uniform size.
Definition at line 363 of file container.hpp.
Referenced by expandContent(), isUniformSize(), and setUniformSize().
|
protected |
VerticalSpacing.
Definition at line 368 of file container.hpp.
Referenced by fcn::AdjustingContainer::adjustContent(), fcn::AdjustingContainer::adjustSize(), getVerticalSpacing(), and setVerticalSpacing().