2023-06-06 07:40:40 +00:00
|
|
|
#pragma once
|
|
|
|
#include "base_text_element.hpp"
|
|
|
|
|
|
|
|
namespace lua::gui
|
|
|
|
{
|
2023-07-02 00:59:02 +02:00
|
|
|
// Lua API: Class
|
|
|
|
// Name: checkbox
|
|
|
|
// Inherit: base_text_element
|
|
|
|
// Class representing a gui checkbox.
|
2023-06-06 07:40:40 +00:00
|
|
|
class checkbox : public base_text_element
|
|
|
|
{
|
|
|
|
bool m_enabled = false;
|
|
|
|
|
|
|
|
public:
|
|
|
|
checkbox(std::string text);
|
|
|
|
|
|
|
|
void draw() override;
|
|
|
|
|
2023-07-02 00:59:02 +02:00
|
|
|
// Lua API: Function
|
|
|
|
// Class: checkbox
|
|
|
|
// Name: is_enabled
|
|
|
|
// Returns: boolean: Is the checkbox checked?
|
2023-06-06 07:40:40 +00:00
|
|
|
bool is_enabled();
|
2023-07-02 00:59:02 +02:00
|
|
|
|
|
|
|
// Lua API: Function
|
|
|
|
// Class: checkbox
|
|
|
|
// Name: set_enabled
|
|
|
|
// Param: enabled: boolean: The desired enabled state of the checkbox.
|
2023-06-06 07:40:40 +00:00
|
|
|
void set_enabled(bool enabled);
|
|
|
|
};
|
|
|
|
}
|