|
| Button (Button &&)=delete |
|
| Button (const Button &)=delete |
|
Button & | operator= (Button &&)=delete |
|
Button & | operator= (const Button &)=delete |
|
| Button (const std::string &labelString, ButtonType type=ButtonType::NormalButton, int fontSize=0) |
| Constructor. More...
|
|
| Button (const Id &id, ButtonType type=ButtonType::NormalButton, int fontSize=0) |
| Constructor. More...
|
|
template<typename String > |
| Button (String labelString, ButtonType type=ButtonType::NormalButton) |
|
| Button (RoseImageId imageId, ButtonType type=ButtonType::NormalButton) |
| Construct an Icon Button. More...
|
|
void | initializeComposite () override |
| See Widget::initializeComposite()
|
|
void | setHorizontalAlignment (HorizontalAlignment alignment) override |
| Set the horizontal alignment of the text within the label. More...
|
|
void | setVerticalAlignment (VerticalAlignment alignment) override |
| Set the horizontal alignment of the text within the label. More...
|
|
void | setText (const std::string &text) override |
| Set the text of the label. More...
|
|
std::string | getText () const |
| Get the text of the label. More...
|
|
void | setFontName (std::string &fontName) |
| Set the font name. More...
|
|
void | setFontSize (int fontSize) override |
| Set the font size. More...
|
|
void | setImageId (ImageId imageId) override |
| Set the ImageId for the ButtonFrame (Label). More...
|
|
void | setRenderFlip (sdl::RenderFlip renderFlip) |
| Set RenderFlip for the ButtonFrame (Label). More...
|
|
void | setSize (Size size) override |
| See Widget::setSize()
|
|
| ButtonFrame (const ButtonFrame &)=delete |
|
| ButtonFrame (ButtonFrame &&)=delete |
|
ButtonFrame & | operator= (const ButtonFrame &)=delete |
|
ButtonFrame & | operator= (ButtonFrame &&)=delete |
|
| ButtonFrame (ButtonType buttonType) noexcept |
|
std::string_view | nodeId () const noexcept override |
|
void | setButtonCommandCallback (uint commandId, ButtonCommandCallback buttonCommandCallback) |
|
| ButtonFrame (ButtonFrame &&)=delete |
|
| ButtonFrame (const ButtonFrame &)=delete |
|
ButtonFrame & | operator= (ButtonFrame &&)=delete |
|
ButtonFrame & | operator= (const ButtonFrame &)=delete |
|
| ButtonFrame (int padding=0) |
|
| ButtonFrame (Padding padding) |
|
void | initializeComposite () override |
| See Widget::initializeComposite.
|
|
void | setSelectState (ButtonSetState state) |
| Set the button select state. More...
|
|
ButtonSetState | getSelectState () const |
| Access the button select state. More...
|
|
void | setStateId (const StateId &stateId) override |
| Set the ButtonFrame StateId.
|
|
| Frame (bool invert) noexcept |
|
| Frame (int padding) noexcept |
|
std::string_view | nodeId () const noexcept override |
|
void | drawAnimate (gm::Context &context, const Position< int > &containerPosition) |
|
void | draw (gm::Context &context, const Position< int > &containerPosition) override |
| Draw the visual.
|
|
Rectangle | layout (gm::Context &context, const Rectangle &screenRect) override |
| Layout the visual.
|
|
| Manager (const Manager &)=delete |
|
| Manager (Manager &&)=delete |
|
Manager & | operator= (const Manager &)=delete |
|
Manager & | operator= (Manager &&)=delete |
|
std::string_view | nodeId () const noexcept override |
|
void | add (const std::shared_ptr< Node > &node) override |
| Add a Node to the contents of the Manager. More...
|
|
void | draw (gm::Context &context, const Position< int > &containerPosition) override |
| Draw the manager and contents. More...
|
|
Rectangle | layout (gm::Context &context, const Rectangle &screenRect) override |
| Layout the Manager and contents. More...
|
|
void | setLayoutManager (std::unique_ptr< LayoutManager > &&layoutManager) |
| Set the layout manager. More...
|
|
std::unique_ptr< LayoutManager > & | layoutManager () |
| Get the LayoutManager. More...
|
|
| Widget (const Widget &)=delete |
|
| Widget (Widget &&)=delete |
|
Widget & | operator= (const Widget &)=delete |
|
Widget & | operator= (Widget &&)=delete |
|
std::shared_ptr< Widget > | pointerWidget (const Position< int > &position, const Position< int > &containerPosition) |
| Search for the Widget within which the position lies. More...
|
|
Position< int > | computeScreenPosition () |
| Recursively compute the Widget Position on the Screen. More...
|
|
bool | contains (const Position< int > &position) |
| Determine if a given Screen Position is within the Widget Rectangle. More...
|
|
Application & | getApplication () |
| Get a reference to the Application object. More...
|
|
Application & | getApplication () const |
| const version of getApplication()
|
|
std::shared_ptr< Window > | getWindow () |
| Get the Window ancestor of a Widget. More...
|
|
std::shared_ptr< Window > | getWindow () const |
| const version of getWindow().
|
|
bool | enterEvent () |
| Notify Widget of mouse pointer enter event. More...
|
|
void | setEnterLeaveEventCallback (EventCallback eventCallback) |
| Set the enter callback.
|
|
bool | leaveEvent () |
| Notify Widget of mouse pointer leave event. More...
|
|
void | setLeaveEventCallback (EventCallback eventCallback) |
| Set the leave callback.
|
|
bool | buttonEvent (bool pressed, uint button, uint clicks, bool passed) |
| Notify Widget of mouse button events. More...
|
|
void | setButtonEventCallback (ButtonCallback buttonCallback) |
| Set the button callback.
|
|
bool | mouseMotionEvent (bool pressed, uint button, const Position< int > &mousePos, const Position< int > &relativePos, bool passed) |
| Notify Widget of mouse motion events. More...
|
|
void | setMouseMotionEventCallback (MouseMotionCallback mouseMotionCallback) |
| Set the mouse motion callback.
|
|
bool | mouseScrollEvent (const Position< int > &deltaPos, bool passed) |
| Notify Widget of mouse scroll wheel events. More...
|
|
void | setMouseScrollEventCallback (ScrollCallback scrollCallback) |
| Set the mouse scroll callback.
|
|
bool | keyboardShortcutEvent (uint32_t shortcutCode, bool state, uint repeat) |
| Notify the Widget of a keyboard shortcut invocation. More...
|
|
void | setKeyboardShortcutCallback (KeyboardShortcutCallback keyboardShortcutCallback) |
| Set the keyboard shortcut callback.
|
|
bool | keyTextInputEvent (const std::string &text) |
| Notify the Widget of text input. More...
|
|
void | setTextInputCallback (TextInputCallback textInputCallback) |
| Set the text input callback.
|
|
bool | supportsKeyboardFocus () const |
|
bool | keyboardFocusEvent (bool hasFocus) |
| Notify the Widget when it gains or looses keyboard focus. More...
|
|
void | setKeyboardFocusCallback (KeyboardFocusCallback keyboardFocusCallback) |
| Set the keyboard focus callback.
|
|
bool | keyboardEvent (const SDL_KeyboardEvent &keyboardEvent) |
|
void | setKeyboardEvent (KeyboardEventCallback keyboardEventCallback) |
|
void | setScreenRectangle (const Position< int > &containerPosition) |
| Compute the screen rectangle from the Container screen Position. More...
|
|
Rectangle | getScreenRectangle (const Position< int > &containerPosition) const |
| Get the rectangle occupied by the Visual. More...
|
|
Position< int > | drawPadding (const Position< int > &containerPosition) |
| Pad the drawing location.
|
|
Rectangle | layoutPadding (const Rectangle &screenRect) |
| Pad the layout.
|
|
void | setSize (const Size &size) |
| Set preferred Size.
|
|
Size | getSize () const |
| Get the preferred size.
|
|
void | setPosition (const Position< int > &position) |
| Set preferred Position.
|
|
Position< int > | getPosition () const |
| Get the preferred Position.
|
|
void | setPadding (const Padding &padding) |
| Set Padding.
|
|
void | setScreenRectangle (const Rectangle &screenRect) |
| Set Screen Rectangle.
|
|
constexpr bool | isVisible () const noexcept |
| Check visibility.
|
|
void | setVisible (bool visible) noexcept |
| Set visibility.
|
|
void | setLayoutHint (const LayoutHint &hint) |
| Add a LayoutHint.
|
|
std::optional< int > | getAttachmentHint (LayoutHint::Attachment attachment) |
| Get an AttachmentHint value given a LayoutHint::Attachment. More...
|
|
std::optional< int > | getGridHint (LayoutHint::GridLayoutHint gridLayoutHint) |
| Get a GridLayoutHint value given a LayoutHint::GridLayoutHint. More...
|
|
template<size_t HintClass> |
std::optional< const ValueMap > | getHintMap () const |
|
SemanticGesture | supportedSemanticGestures () const |
| Get supported SemanticGestures.
|
|
void | remove (const std::shared_ptr< Node > &node) |
|
| Node (const std::shared_ptr< Container > &container) |
| Create a node and add it to a Container. More...
|
|
void | setId (const Id &nodeId) noexcept |
| Set Id.
|
|
std::string_view | getId () const |
| Get Id.
|
|
IdPath | getIdPath () const |
| Get the Id Path.
|
|
virtual void | addedToContainer () |
| Called when a Node is added to a Container. More...
|
|
std::shared_ptr< Container > | container () |
|
std::shared_ptr< Container > | container () const |
|
template<typename C > |
std::shared_ptr< C > | containerAs () |
|
template<typename C > |
std::shared_ptr< C > | containerAs () const |
|
std::shared_ptr< const Node > | getNode () const |
| Get a const std::shared_ptr to this node. More...
|
|
std::shared_ptr< Node > | getNode () |
| Get a std::shared_ptr to this node. More...
|
|
template<typename NodeType > |
std::shared_ptr< const Node > | getNode () const |
| Get a std::shared_ptr<const NodeType> to this node. More...
|
|
template<typename NodeType > |
std::shared_ptr< NodeType > | getNode () |
| Get a std::shared_ptr<NodeType> to this node. More...
|
|
std::shared_ptr< Node > | remove () |
|
| FrameElements (int padding) |
|
void | set (const CornerStyle cornerStyle) |
| Set the CornerStyle.
|
|
void | setState (bool state) |
| Set the state, true = inverted.
|
|
void | setAnimateColor (const color::RGBA &color) |
| Set the active color.
|
|
void | setInactiveColor (const color::RGBA &color) |
| Set the background color.
|
|
bool | getState () const |
|
void | frameSettings (const FrameSettings &frameSettings) |
|
void | setActionCurve (std::unique_ptr< ActionCurves::ActionCurve > &&actionCurve) |
|
void | setAnimationEnable (AnimationEnable animationEnable) |
|
|
using | SignalType = std::pair< bool, SignalToken > |
| The content type of ButtonFrame signals and slots.
|
|
using | ValueMap = std::map< int, int > |
| The std::map type for each hint class.
|
|
using | NodePtr = std::shared_ptr< Node > |
|
using | Callback = std::function< void(gm::Context &context, const Position< int > &, uint32_t frame)> |
|
using | Enable = std::function< void(AnimationEnable animationEnable)> |
|
template<typename NodeType > |
static std::shared_ptr< NodeType > | create () |
| Create a Node with no arguments. More...
|
|
template<typename NodeType , typename ... Args> |
static std::shared_ptr< NodeType > | create (Args ... args) |
| Create a Node with arguments. More...
|
|
template<typename NodeType , typename ContainerType , typename ... Args> |
static std::shared_ptr< NodeType > | add (ContainerType container, Args ... args) |
| Create a Node with arguments and add to a Container. More...
|
|
static gm::Texture | createBackgroundMask (gm::Context &context, Size size, int frameWidth, bool roundCorners=false) |
|
static void | colorBackgroundMask (gm::Context &context, gm::Texture &mask, const color::RGBA &base, const color::RGBA &active, float value) |
|
static void | setAnimation (const std::shared_ptr< Window > &window, std::shared_ptr< Animation > animation, const Position< int > &position) |
|
static void | removeAnimation (const std::shared_ptr< Window > &window, std::shared_ptr< Animation > animation) |
|
std::shared_ptr< Slot< SignalType > > | rxPushed |
| A Slot to receive Pushed signals on. More...
|
|
Signal< SignalType > | txPushed |
| A Signal to transmit Pusehd signals on. More...
|
|
std::shared_ptr< Slot< SignalType > > | rxState |
| A Slot to receive State signals on. More...
|
|
Signal< SignalType > | txState |
| A Signal to transmit.
|
|
std::map< size_t, ValueMap > | mHintsMap {} |
| The std::map of hint class to ValueMap.
|
|
std::unique_ptr< ActionCurves::ActionCurve > | mActionCurve {} |
|
static constexpr std::string_view | id = "ButtonFrame" |
|
static constexpr std::string_view | id = "Frame" |
|
static constexpr std::string_view | id = "Manager" |
|
static constexpr std::string_view | id = "Widget" |
|
static constexpr std::string_view | id = "Container" |
|
static constexpr std::string_view | id = "Node" |
|
enum | SelectedCorners : uint32_t {
NoCorners = 0,
TopLeftCorner = 0x8,
TopRightCorner = 0x4,
TopCorners = TopLeftCorner | TopRightCorner,
BottomLeftCorner = 0x2,
BottomRightCorner = 0x1,
BottomCorners = BottomLeftCorner | BottomRightCorner,
LeftCorners = TopLeftCorner | BottomLeftCorner,
RightCorners = TopRightCorner | BottomRightCorner,
AllCorners = 0xf
} |
| Specify corners selected for some process, usually drawing.
|
|
enum | SelectedSides : uint32_t {
NoSides = 0,
TopSide = 1,
BotSide = 2,
LeftSide = 4,
RightSide = 8,
AllSides = TopSide | BotSide | LeftSide | RightSide,
TabTopSides = TopSide | LeftSide | RightSide
} |
| Specify sides selected for some process, usually drawing.
|
|
bool | mouseButtonEvent (const Position &mousePos, int button, bool down, int modifiers) override |
| Handle mouse button events. More...
|
|
bool | clickTransactionCancel (const Position &mousePos, int button, bool down, int modifiers) override |
| Handle a click transaction cancel event (default implementation: propagate to children)
|
|
void | updateStateSetting (ButtonSetState state) |
| Update the button state in the Setting database.
|
|
void | renderSelectedSides (gm::Context &context, FrameElements::SelectedSides selectedSides, BorderStyle useBorder, ImageId corner, const Size &size, int extend=0) |
| Render sides as part of a border around the frame. More...
|
|
void | drawBackground (gm::Context &context, Rectangle &src, Rectangle &dst) |
| Draw the background for the Frame. More...
|
|
gm::Texture | createBackgroundTexture (gm::Context &context, Rectangle &src, Rectangle &dst, const color::RGBA &color) |
|
std::tuple< UseBorder, SelectedCorners > | decoration () |
|
void | drawFrame (gm::Context &context, Rectangle widgetRect) |
| Draw the Frame and background. More...
|
|
void | buttonDisplayStateChange (ButtonDisplayState buttonDisplayState) |
| Make visual changes to FrameElements for button display. More...
|
|
static void | trimCorners (gm::Surface &surface, color::RGBA color, FrameElements::SelectedCorners selectedCorners, Size cornerSize, Size frameSize) |
| Trim corners on a background surface to allow for rounded corners. More...
|
|
static void | renderSelectedCorners (gm::Context &context, SelectedCorners selectedCorners, ImageId corner, const Size &size) |
| Render corner images as part of a border around the frame. More...
|
|
A configurable button class.
A member of the ButtonType enumeration is used to specify the action type of the button. The execution of the button function is handled by a set of signals and slots.
Not all signals and slots are active for each type of button.
- rose::NormalButton
- A button which is depressed when a left button pressed event or finger touch event occurs and released when the corresponding button or finger release event occurs.
- On release a signal is transmitted from Button::txPushed, Frame::mInvert is inverted and the new value is transmitted on the Button::txState signal.
- On receipt of a signal on Button::rxPushed a signal is transmitted on Button::txPushed.