Robowflex  v0.1
Making MoveIt Easy
robowflex::darts::ButtonElement Class Reference

A basic push-button element. More...

#include <gui.h>

+ Inheritance diagram for robowflex::darts::ButtonElement:

Public Member Functions

 ButtonElement (const std::string &text, const ButtonCallback &callback)
 Constructor. More...
 
void render () const override
 Render method. Renders IMGUI contents. More...
 

Private Attributes

const std::string text
 Display text. More...
 
const ButtonCallback callback
 Callback. More...
 

Detailed Description

A basic push-button element.

Definition at line 289 of file gui.h.

Constructor & Destructor Documentation

◆ ButtonElement()

ButtonElement::ButtonElement ( const std::string text,
const ButtonCallback callback 
)

Constructor.

Parameters
[in]textText to display on button.
[in]callbackCallback upon press.

Definition at line 276 of file gui.cpp.

278 {
279 }
const ButtonCallback callback
Callback.
Definition: gui.h:301
const std::string text
Display text.
Definition: gui.h:300

Member Function Documentation

◆ render()

void ButtonElement::render ( ) const
overridevirtual

Render method. Renders IMGUI contents.

Implements robowflex::darts::ImGuiElement.

Definition at line 281 of file gui.cpp.

282 {
283  const auto &button = ImGui::Button(text.c_str());
284  if (button)
285  callback();
286 }
T c_str(T... args)

Member Data Documentation

◆ callback

const ButtonCallback robowflex::darts::ButtonElement::callback
private

Callback.

Definition at line 301 of file gui.h.

◆ text

const std::string robowflex::darts::ButtonElement::text
private

Display text.

Definition at line 300 of file gui.h.


The documentation for this class was generated from the following files: