|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <piegraph.hpp>
Classes | |
| struct | PieGraphSegment |
Public Member Functions | |
| void | addSegment (int startAngle, int stopAngle, Color const &color) |
| void | clearSegments () |
| void | draw (Graphics *graphics) override |
| Point const & | getCenter () const |
| int | getCenterX () const |
| int | getCenterY () const |
| int | getRadius () const |
| bool | isOpaque () const |
| PieGraph & | operator= (PieGraph &&)=delete |
| PieGraph & | operator= (PieGraph const &)=delete |
| PieGraph () | |
| PieGraph (PieGraph &&)=delete | |
| PieGraph (PieGraph const &)=delete | |
| PieGraph (Point center) | |
| void | setCenter (int x, int y) |
| void | setCenter (Point const ¢er) |
| void | setCenterX (int x) |
| void | setCenterY (int y) |
| void | setOpaque (bool opaque) |
| void | setRadius (int radius) |
| 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 | addFocusListener (FocusListener *focusListener) |
| void | addKeyListener (KeyListener *keyListener) |
| void | addMouseListener (MouseListener *mouseListener) |
| void | addWidgetListener (WidgetListener *widgetListener) |
| virtual void | adjustSize () |
| virtual void | drawBorder (Graphics *graphics) |
| virtual void | drawOutline (Graphics *graphics) |
| virtual void | drawSelectionFrame (Graphics *graphics) |
| void | expandContent () |
| virtual void | expandContent (bool recursion) |
| 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 | getBorderSize () const |
| virtual Rectangle | getChildrenArea () |
| 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 | isEnabled () const |
| bool | isFixedSize () const |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| bool | isHorizontalExpand () const |
| bool | isLastPositionSet () const |
| virtual bool | isLayouted () |
| virtual bool | isModalFocusable () const |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocusable () const |
| virtual bool | isModalMouseInputFocused () const |
| bool | isSetVisible () const |
| bool | isTabInEnabled () const |
| bool | isTabOutEnabled () const |
| bool | isVerticalExpand () const |
| bool | isVisible () const |
| virtual void | logic () |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | moveToTop (Widget *widget) |
| Widget & | operator= (Widget &&)=delete |
| Widget & | operator= (Widget const &)=delete |
| virtual void | releaseModalFocus () |
| virtual void | releaseModalMouseInputFocus () |
| void | removeActionListener (ActionListener *actionListener) |
| void | removeDeathListener (DeathListener *deathListener) |
| void | removeFocusListener (FocusListener *focusListener) |
| void | removeKeyListener (KeyListener *keyListener) |
| void | removeMouseListener (MouseListener *mouseListener) |
| void | removeWidgetListener (WidgetListener *widgetListener) |
| virtual void | requestFocus () |
| virtual void | requestModalFocus () |
| virtual void | requestModalMouseInputFocus () |
| virtual void | requestMoveToBottom () |
| virtual void | requestMoveToTop () |
| void | resizeToContent () |
| virtual void | resizeToContent (bool recursion) |
| void | setActionEventId (std::string const &actionEventId) |
| virtual void | setBackgroundColor (Color const &color) |
| virtual void | setBaseColor (Color const &color) |
| virtual void | setBorderColor (Color const &color) |
| void | setBorderSize (unsigned int size) |
| void | setDimension (Rectangle const &dimension) |
| void | setEnabled (bool enabled) |
| void | setFixedSize (Size const &size) |
| void | setFocusable (bool focusable) |
| virtual void | setFont (Font *font) |
| virtual void | setForegroundColor (Color const &color) |
| 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) |
| void | setSize (int width, int height) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| virtual void | showWidgetPart (Widget *widget, Rectangle area) |
| Widget () | |
| Widget (Widget &&)=delete | |
| Widget (Widget const &)=delete | |
Additional Inherited Members | |
| Public Types inherited from fcn::Widget | |
| 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 void | setGlobalFont (Font *font) |
| static bool | widgetExists (Widget const *widget) |
| 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 | 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 () |
| 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 |
Displays data as a circular pie chart.
A pie graph is a circular graph that is divided into segments. Each segment represents a portion of the whole graph, and the size of each segment is determined by the start and stop angles of the segment.
Definition at line 26 of file piegraph.hpp.
| fcn::PieGraph::PieGraph | ( | ) |
|
explicit |
| void fcn::PieGraph::addSegment | ( | int | startAngle, |
| int | stopAngle, | ||
| Color const & | color ) |
Add a segment to the pie graph.
| startAngle | Start angle in degrees. |
| stopAngle | Stop angle in degrees. |
| color | Color to draw the segment with. |
Definition at line 66 of file piegraph.cpp.
References fcn::PieGraph::PieGraphSegment::color, m_segments, fcn::PieGraph::PieGraphSegment::startAngle, and fcn::PieGraph::PieGraphSegment::stopAngle.
| void fcn::PieGraph::clearSegments | ( | ) |
Remove all segments from the pie graph.
Definition at line 75 of file piegraph.cpp.
References m_segments.
|
overridevirtual |
Draws this widget.
Implements fcn::Widget.
Definition at line 90 of file piegraph.cpp.
References fcn::Widget::drawBorder(), fcn::Graphics::drawFillCircleSegment(), fcn::Widget::drawSelectionFrame(), fcn::Graphics::fillRectangle(), fcn::Widget::getBackgroundColor(), fcn::Widget::getBorderSize(), fcn::Widget::getHeight(), fcn::Widget::getSelectionColor(), fcn::Widget::getSelectionMode(), fcn::Widget::getWidth(), fcn::Widget::isFocused(), isOpaque(), m_center, m_radius, m_segments, and fcn::Graphics::setColor().
| Point const & fcn::PieGraph::getCenter | ( | ) | const |
Get the center point.
Definition at line 51 of file piegraph.cpp.
References m_center.
| int fcn::PieGraph::getCenterX | ( | ) | const |
Get the center x-coordinate.
Definition at line 36 of file piegraph.cpp.
References m_center.
| int fcn::PieGraph::getCenterY | ( | ) | const |
Get the center y-coordinate.
Definition at line 41 of file piegraph.cpp.
References m_center.
| int fcn::PieGraph::getRadius | ( | ) | const |
Get the radius of the pie graph.
Definition at line 61 of file piegraph.cpp.
References m_radius.
| bool fcn::PieGraph::isOpaque | ( | ) | const |
Definition at line 85 of file piegraph.cpp.
References m_opaque.
Referenced by draw().
| void fcn::PieGraph::setCenter | ( | int | x, |
| int | y ) |
Set the center coordinates.
| x | X coordinate for the center. |
| y | Y coordinate for the center. |
Definition at line 30 of file piegraph.cpp.
References m_center.
| void fcn::PieGraph::setCenter | ( | Point const & | center | ) |
Set the center using a Point.
| center | The new center. |
Definition at line 46 of file piegraph.cpp.
References m_center.
| void fcn::PieGraph::setCenterX | ( | int | x | ) |
Set the center x-coordinate.
| x | X coordinate for the center. |
Definition at line 20 of file piegraph.cpp.
References m_center.
| void fcn::PieGraph::setCenterY | ( | int | y | ) |
Set the center y-coordinate.
| y | Y coordinate for the center. |
Definition at line 25 of file piegraph.cpp.
References m_center.
| void fcn::PieGraph::setOpaque | ( | bool | opaque | ) |
Sets the opacity of the graph.
| opaque | True if opaque, false otherwise. |
Definition at line 80 of file piegraph.cpp.
References m_opaque.
| void fcn::PieGraph::setRadius | ( | int | radius | ) |
Set the radius of the pie graph.
| radius | Radius in pixels. |
Definition at line 56 of file piegraph.cpp.
References m_radius.
|
protected |
The center point of the pie graph.
Definition at line 148 of file piegraph.hpp.
Referenced by draw(), getCenter(), getCenterX(), getCenterY(), PieGraph(), setCenter(), setCenter(), setCenterX(), and setCenterY().
|
protected |
True if the pie graph is drawn opaque.
Definition at line 145 of file piegraph.hpp.
Referenced by isOpaque(), PieGraph(), PieGraph(), and setOpaque().
|
protected |
The radius of the pie graph in pixels.
Definition at line 151 of file piegraph.hpp.
Referenced by draw(), getRadius(), PieGraph(), PieGraph(), and setRadius().
|
protected |
The list of segments that make up the pie graph.
Definition at line 170 of file piegraph.hpp.
Referenced by addSegment(), clearSegments(), and draw().