|
ZenitUI
Retained-mode C++20 UI framework
|
A push button. More...
#include <Button.hpp>
Public Member Functions | |
| Button (std::function< void()> cb) | |
| Construct a button with the given click handler. | |
| std::string | text () const |
| Return the current label text, or "" if no Text child exists. | |
| void | setText (const std::string &s) |
| Update the label text, creating a "btn-text" Text child if none exists. | |
| Public Member Functions inherited from ZenitUI::TLayout< Button, Panel > | |
| TLayout (Args &&...args) | |
Forward constructor arguments to Base. | |
| std::shared_ptr< Button > | cls (const std::string &name) |
| Fluent addClass; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | id (const std::string &node_id) |
| Fluent setId; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | withRef (const std::string &r) |
| Fluent setRef; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | size (Value w, Value h) |
| Fluent setSize; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | passThrough (bool p=true) |
| Fluent setPassThrough; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | with (std::shared_ptr< Layout > c) |
| Fluent addChild; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Button > | self () |
| Return shared_from_this() statically cast to Derived. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from ZenitUI::TLayout< Button, Panel > | |
| static std::shared_ptr< Button > | create (Args &&...args) |
| Construct a shared_ptr<Derived> and call onBuild(). | |
| Protected Member Functions inherited from ZenitUI::TLayout< Button, Panel > | |
| virtual void | onBuild () |
| Hook: called once after create() finishes constructing the object. | |
A push button.
Style tag: "Button". Inherits from Panel so it shares its raycast and chrome behaviour. Keyboard-activatable (Enter / Space fire onClick).
|
inline |
Construct a button with the given click handler.
| cb | Handler fired on click. May be empty; setText can still be used to add a label later. |