|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <tabbedarea.hpp>
Public Member Functions | |
| void | action (ActionEvent const &actionEvent) override |
| virtual void | addTab (Tab *tab, Widget *widget) |
| void | adjustSize () override |
| virtual void | death (Event const &event) |
| void | draw (Graphics *graphics) override |
| void | expandContent () |
| void | expandContent (bool recursion) override |
| Widget * | getBackgroundWidget () |
| Rectangle | getChildrenArea () override |
| virtual unsigned int | getHorizontalSpacing () const |
| Container::LayoutPolicy | getLayout () const |
| int | getNumberOfTabs () const |
| Tab * | getSelectedTab () const |
| virtual int | getSelectedTabIndex () const |
| virtual unsigned int | getVerticalSpacing () const |
| bool | isOpaque () const |
| virtual bool | isTabSelected (Tab *tab) const |
| virtual bool | isTabSelected (unsigned int index) const |
| virtual bool | isUniformSize () const |
| void | keyPressed (KeyEvent &keyEvent) override |
| void | mousePressed (MouseEvent &mouseEvent) override |
| TabbedArea & | operator= (TabbedArea &&)=delete |
| TabbedArea & | operator= (TabbedArea const &)=delete |
| virtual void | removeTab (Tab *tab) |
| virtual void | removeTabWithIndex (unsigned int index) |
| void | resizeToContent (bool recursion=true) override |
| void | setBackgroundWidget (Widget *widget) |
| void | setBaseColor (Color const &color) override |
| void | setDimension (Rectangle const &dimension) override |
| void | setHeight (int height) override |
| virtual void | setHorizontalSpacing (unsigned int spacing) |
| void | setLayout (Container::LayoutPolicy policy) |
| void | setOpaque (bool opaque) |
| virtual void | setSelectedTab (Tab *tab) |
| virtual void | setSelectedTab (unsigned int index) |
| void | setSize (int width, int height) override |
| virtual void | setUniformSize (bool uniform) |
| virtual void | setVerticalSpacing (unsigned int spacing) |
| void | setWidth (int width) override |
| TabbedArea (TabbedArea &&)=delete | |
| TabbedArea (TabbedArea const &)=delete | |
| Public Member Functions inherited from fcn::ActionListener | |
| ActionListener (ActionListener &&)=delete | |
| ActionListener (ActionListener const &)=delete | |
| ActionListener & | operator= (ActionListener &&)=delete |
| ActionListener & | operator= (ActionListener const &)=delete |
| Public Member Functions inherited from fcn::KeyListener | |
| KeyListener (KeyListener &&)=default | |
| KeyListener (KeyListener const &)=default | |
| virtual void | keyReleased (KeyEvent &keyEvent) |
| KeyListener & | operator= (KeyListener &&)=default |
| KeyListener & | operator= (KeyListener const &)=default |
| Public Member Functions inherited from fcn::MouseListener | |
| virtual void | mouseClicked (MouseEvent &mouseEvent) |
| virtual void | mouseDragged (MouseEvent &mouseEvent) |
| virtual void | mouseEntered (MouseEvent &mouseEvent) |
| virtual void | mouseExited (MouseEvent &mouseEvent) |
| MouseListener (MouseListener &&)=default | |
| MouseListener (MouseListener const &)=default | |
| virtual void | mouseMoved (MouseEvent &mouseEvent) |
| virtual void | mouseReleased (MouseEvent &mouseEvent) |
| virtual void | mouseWheelMovedDown (MouseEvent &mouseEvent) |
| virtual void | mouseWheelMovedLeft (MouseEvent &mouseEvent) |
| virtual void | mouseWheelMovedRight (MouseEvent &mouseEvent) |
| virtual void | mouseWheelMovedUp (MouseEvent &mouseEvent) |
| MouseListener & | operator= (MouseListener &&)=default |
| MouseListener & | operator= (MouseListener const &)=default |
| 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 | isLayouted () |
| 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) |
| 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) |
| 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) |
| 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) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| 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 Member Functions | |
| void | adjustTabPositions () |
| Protected Member Functions inherited from fcn::ActionListener | |
| ActionListener ()=default | |
| Protected Member Functions inherited from fcn::KeyListener | |
| KeyListener ()=default | |
| Protected Member Functions inherited from fcn::MouseListener | |
| MouseListener ()=default | |
| 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 () |
| virtual Widget * | findWidgetById (std::string const &id) |
| std::list< Widget * > const & | getChildren () const |
| virtual void | remove (Widget *widget) |
| virtual void | removeAllChildren () |
| void | resizeToChildren () |
Protected Attributes | |
| bool | mOpaque {false} |
| Tab * | mSelectedTab {nullptr} |
| Container * | mTabContainer |
| std::vector< std::pair< Tab *, Widget * > > | mTabs |
| std::vector< std::unique_ptr< Tab > > | mTabsToDelete |
| Container * | mWidgetContainer |
| 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 |
Friends | |
| class | Tab |
Additional Inherited Members | |
| 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 } |
| 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 container organizing content into selectable tabs.
A tabbed area where a user can display a widget by selecting a tab.
Definition at line 36 of file tabbedarea.hpp.
| fcn::TabbedArea::TabbedArea | ( | ) |
Definition at line 23 of file tabbedarea.cpp.
|
override |
Definition at line 39 of file tabbedarea.cpp.
|
overridevirtual |
Handles an action event emitted by a widget.
Invoked when a widget triggers an action, providing details about the event via the ActionEvent object.
| actionEvent | The action event data. |
Implements fcn::ActionListener.
Definition at line 454 of file tabbedarea.cpp.
References action(), fcn::Event::getSource(), setSelectedTab(), fcn::throwException(), and fcn::Widget::Widget().
Referenced by action().
|
virtual |
Adds a tab to the tabbed area.
The tab will not be deleted by the tabbed area when it is removed.
| tab | The tab widget for the tab. |
| widget | The widget to view when the tab is selected. |
Definition at line 48 of file tabbedarea.cpp.
References fcn::Widget::adaptLayout(), fcn::Widget::addActionListener(), addTab(), fcn::Widget::getBaseColor(), fcn::Container::getLayout(), getLayout(), mSelectedTab, mTabContainer, mTabs, fcn::Widget::setBaseColor(), fcn::Container::setLayout(), setSelectedTab(), fcn::Tab::setTabbedArea(), and fcn::Widget::Widget().
Referenced by addTab().
|
overridevirtual |
Adjusts the size of the tab container and the widget container.
Reimplemented from fcn::Widget.
Definition at line 284 of file tabbedarea.cpp.
References adjustSize(), fcn::Widget::getHeight(), getLayout(), fcn::Widget::getWidth(), mTabContainer, mTabs, and mWidgetContainer.
Referenced by adjustSize(), expandContent(), resizeToContent(), setDimension(), setHeight(), setSize(), and setWidth().
|
protected |
Adjusts the positions of the tabs.
Definition at line 311 of file tabbedarea.cpp.
References adjustTabPositions(), fcn::Widget::getHeight(), getLayout(), fcn::Widget::getWidth(), mTabs, and fcn::Widget::setPosition().
Referenced by adjustTabPositions(), expandContent(), and resizeToContent().
|
virtual |
DeathListener callback invoked when a child widget dies.
Definition at line 443 of file tabbedarea.cpp.
References death(), and removeTab().
Referenced by death().
|
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.
Definition at line 214 of file tabbedarea.cpp.
References fcn::Color::a, draw(), fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), isOpaque(), mSelectedTab, mTabContainer, and fcn::Graphics::setColor().
Referenced by 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 |
Expands child widgets to fit this widget's size.
| recursion | If true, call expandContent recursively on children. |
Reimplemented from fcn::Widget.
Definition at line 274 of file tabbedarea.cpp.
References adjustSize(), adjustTabPositions(), expandContent(), mTabContainer, and mWidgetContainer.
Referenced by expandContent().
| Widget * fcn::TabbedArea::getBackgroundWidget | ( | ) |
Get the background widget, or nullptr if none is set.
Definition at line 209 of file tabbedarea.cpp.
References getBackgroundWidget(), mTabContainer, and fcn::Widget::Widget().
Referenced by getBackgroundWidget().
|
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.
Definition at line 253 of file tabbedarea.cpp.
References fcn::Widget::getBorderSize(), getChildrenArea(), 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 getChildrenArea().
|
virtual |
Get the horizontal spacing between rows.
Definition at line 511 of file tabbedarea.cpp.
References getHorizontalSpacing(), and mTabContainer.
Referenced by getHorizontalSpacing().
| Container::LayoutPolicy fcn::TabbedArea::getLayout | ( | ) | const |
Gets the layout of the tabbedarea.
Definition at line 481 of file tabbedarea.cpp.
References getLayout(), and mTabContainer.
Referenced by addTab(), adjustSize(), adjustTabPositions(), and getLayout().
| int fcn::TabbedArea::getNumberOfTabs | ( | ) | const |
Returns the number of tabs in this tabbed area.
Definition at line 117 of file tabbedarea.cpp.
References getNumberOfTabs(), and mTabs.
Referenced by getNumberOfTabs().
| Tab * fcn::TabbedArea::getSelectedTab | ( | ) | const |
Gets the selected tab.
Definition at line 188 of file tabbedarea.cpp.
References getSelectedTab(), and mSelectedTab.
Referenced by getSelectedTab().
|
virtual |
Gets the index of the selected tab.
Definition at line 175 of file tabbedarea.cpp.
References getSelectedTabIndex(), mSelectedTab, and mTabs.
Referenced by getSelectedTabIndex(), keyPressed(), and removeTab().
|
virtual |
Get the vertical spacing between rows.
Definition at line 501 of file tabbedarea.cpp.
References getVerticalSpacing(), and mTabContainer.
Referenced by getVerticalSpacing().
| bool fcn::TabbedArea::isOpaque | ( | ) | const |
Checks if the tabbed area is opaque or not.
Definition at line 198 of file tabbedarea.cpp.
References isOpaque(), and mOpaque.
Referenced by draw(), and isOpaque().
|
virtual |
Checks if a tab is selected or not.
| tab | The tab to check. |
Definition at line 131 of file tabbedarea.cpp.
References isTabSelected(), and mSelectedTab.
|
virtual |
Checks if a tab given an index is selected or not.
| index | The index of the tab to check. |
Definition at line 122 of file tabbedarea.cpp.
References isTabSelected(), mSelectedTab, mTabs, and fcn::throwException().
Referenced by isTabSelected(), and isTabSelected().
|
virtual |
True if the tab container tries to expand the childs to a uniform size.
Definition at line 491 of file tabbedarea.cpp.
References isUniformSize(), and mTabContainer.
Referenced by isUniformSize().
|
overridevirtual |
Called if a key is pressed when the widget has keyboard focus.
If a key is held down the widget will generate multiple key presses.
| keyEvent | Describes the event. |
Reimplemented from fcn::KeyListener.
Definition at line 387 of file tabbedarea.cpp.
References fcn::InputEvent::consume(), fcn::KeyEvent::getKey(), getSelectedTabIndex(), fcn::InputEvent::isConsumed(), fcn::Widget::isFocused(), keyPressed(), mTabs, and setSelectedTab().
Referenced by keyPressed().
|
overridevirtual |
Called when a mouse button has been pressed down on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 418 of file tabbedarea.cpp.
References fcn::MouseEvent::getButton(), fcn::Event::getSource(), fcn::MouseEvent::getX(), fcn::MouseEvent::getY(), fcn::Widget::isFocusable(), mousePressed(), mTabContainer, fcn::Widget::requestFocus(), setSelectedTab(), and fcn::Widget::Widget().
Referenced by mousePressed().
|
virtual |
Removes a tab from the tabbed area.
| tab | The tab to remove. |
Definition at line 75 of file tabbedarea.cpp.
References fcn::Widget::adaptLayout(), getSelectedTabIndex(), mSelectedTab, mTabContainer, mTabs, mTabsToDelete, mWidgetContainer, removeTab(), and setSelectedTab().
Referenced by death(), removeTab(), and removeTabWithIndex().
|
virtual |
Removes a tab from the tabbed area.
| index | The index of the tab to remove. |
Definition at line 66 of file tabbedarea.cpp.
References mTabs, removeTab(), removeTabWithIndex(), and fcn::throwException().
Referenced by removeTabWithIndex().
|
overridevirtual |
Resizes the widget's size to fit the content exactly, calls recursively all childs.
The default value true allows callers to use resizeToContent() without argument.
| recursion | If true, perform the resize operation recursively on children. |
Reimplemented from fcn::Widget.
Definition at line 263 of file tabbedarea.cpp.
References adjustSize(), adjustTabPositions(), mTabContainer, mWidgetContainer, fcn::Widget::resizeToChildren(), and resizeToContent().
Referenced by resizeToContent().
| void fcn::TabbedArea::setBackgroundWidget | ( | Widget * | widget | ) |
Set the background widget which is drawn behind tabs.
Definition at line 203 of file tabbedarea.cpp.
References mTabContainer, mWidgetContainer, setBackgroundWidget(), and fcn::Widget::Widget().
Referenced by setBackgroundWidget().
|
overridevirtual |
Set the base/background color used for the tabbed area.
Reimplemented from fcn::Widget.
Definition at line 466 of file tabbedarea.cpp.
References mTabContainer, mTabs, mWidgetContainer, setBaseColor(), and fcn::Widget::setBaseColor().
Referenced by setBaseColor().
|
overridevirtual |
Set the area dimension for the tabbed area.
Reimplemented from fcn::Widget.
Definition at line 375 of file tabbedarea.cpp.
References adjustSize(), fcn::Widget::mDimension, setDimension(), and fcn::Widget::setDimension().
Referenced by setDimension().
|
overridevirtual |
Set the height of the tabbed area in pixels.
Reimplemented from fcn::Widget.
Definition at line 350 of file tabbedarea.cpp.
References adjustSize(), fcn::Widget::mDimension, setHeight(), and fcn::Widget::setHeight().
Referenced by setHeight().
|
virtual |
Set the horizontal spacing between columns.
| spacing | spacing in pixels. |
Definition at line 506 of file tabbedarea.cpp.
References mTabContainer, and setHorizontalSpacing().
Referenced by setHorizontalSpacing().
| void fcn::TabbedArea::setLayout | ( | Container::LayoutPolicy | policy | ) |
Sets the layout of the tabbedarea.
| policy | The LayoutPolicy of the tabbedarea. |
Definition at line 476 of file tabbedarea.cpp.
References mTabContainer, and setLayout().
Referenced by setLayout().
| void fcn::TabbedArea::setOpaque | ( | bool | opaque | ) |
Sets the tabbed area to be opaque or not.
If the tabbed area is opaque its background will be drawn, if it's not opaque its background will not be drawn. By default, a tabbed area is not opaque.
The tabbed area's background is normally only visible behind the tabs, since the container holding the tab contents is opaque by default.
| opaque | True if the tabbed area should be opaque, false otherwise. |
Definition at line 193 of file tabbedarea.cpp.
References mOpaque, and setOpaque().
Referenced by setOpaque().
|
virtual |
Sets a tab to be selected or not.
| tab | The tab to be selected. |
Definition at line 145 of file tabbedarea.cpp.
References fcn::Widget::adaptLayout(), mSelectedTab, mTabs, mWidgetContainer, and setSelectedTab().
|
virtual |
Sets a tab given an index to be selected.
| index | The index of the tab to be selected. |
Definition at line 136 of file tabbedarea.cpp.
References mTabs, setSelectedTab(), and fcn::throwException().
Referenced by action(), addTab(), keyPressed(), mousePressed(), removeTab(), setSelectedTab(), and setSelectedTab().
|
overridevirtual |
Set the size (width and height) of the tabbed area in pixels.
Reimplemented from fcn::Widget.
Definition at line 362 of file tabbedarea.cpp.
References adjustSize(), fcn::Widget::mDimension, setSize(), and fcn::Widget::setSize().
Referenced by setSize().
|
virtual |
Enables or disables uniform sizing of child elements.
When enabled, available space is distributed so that all children have equal size, if possible. When disabled, free space is distributed evenly without enforcing equal sizes.
| uniform | True to enforce uniform child sizes; false otherwise. |
Definition at line 486 of file tabbedarea.cpp.
References mTabContainer, and setUniformSize().
Referenced by setUniformSize().
|
virtual |
Set the vertical spacing between rows.
| spacing | spacing in pixels. |
Definition at line 496 of file tabbedarea.cpp.
References mTabContainer, and setVerticalSpacing().
Referenced by setVerticalSpacing().
|
overridevirtual |
Set the width of the tabbed area in pixels.
Reimplemented from fcn::Widget.
Definition at line 338 of file tabbedarea.cpp.
References adjustSize(), fcn::Widget::mDimension, setWidth(), and fcn::Widget::setWidth().
Referenced by setWidth().
|
friend |
Definition at line 38 of file tabbedarea.hpp.
|
protected |
True if the tabbed area is opaque, false otherwise.
Definition at line 321 of file tabbedarea.hpp.
Referenced by isOpaque(), and setOpaque().
|
protected |
Holds the selected tab.
Definition at line 293 of file tabbedarea.hpp.
Referenced by addTab(), draw(), getSelectedTab(), getSelectedTabIndex(), isTabSelected(), isTabSelected(), removeTab(), and setSelectedTab().
|
protected |
Holds the container for the tabs.
Definition at line 298 of file tabbedarea.hpp.
Referenced by addTab(), adjustSize(), draw(), expandContent(), getBackgroundWidget(), getHorizontalSpacing(), getLayout(), getVerticalSpacing(), isUniformSize(), mousePressed(), removeTab(), resizeToContent(), setBackgroundWidget(), setBaseColor(), setHorizontalSpacing(), setLayout(), setUniformSize(), and setVerticalSpacing().
|
protected |
Associates each tab with the widget displayed when it is selected.
Definition at line 316 of file tabbedarea.hpp.
Referenced by addTab(), adjustSize(), adjustTabPositions(), getNumberOfTabs(), getSelectedTabIndex(), isTabSelected(), keyPressed(), removeTab(), removeTabWithIndex(), setBaseColor(), setSelectedTab(), and setSelectedTab().
|
protected |
Stores tabs owned by this instance for automatic destruction.
Contains tabs that were created internally by the tabbed area and must be deleted in the destructor.
Definition at line 311 of file tabbedarea.hpp.
Referenced by removeTab().
|
protected |
Holds the container for the widgets.
Definition at line 303 of file tabbedarea.hpp.
Referenced by adjustSize(), expandContent(), removeTab(), resizeToContent(), setBackgroundWidget(), setBaseColor(), and setSelectedTab().