mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Initial UI in src
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include "UI_item.hpp"
|
||||
#include "UI_x_boxes.hpp"
|
||||
|
||||
#define UI_CHECKBOX_TYPE std::string("UIcheckbox")
|
||||
typedef void (*UI_checkbox_on_change) (std::string id, std::vector<std::string> selected);
|
||||
|
||||
class UI_checkbox : UI_x_boxes
|
||||
{
|
||||
public:
|
||||
UI_checkbox();
|
||||
UI_checkbox(std::string id, std::string text, Color fg_color, Color bg_color, std::vector<std::string> options, UI_checkbox_on_change on_change = nullptr);
|
||||
UI_checkbox(const json& j);
|
||||
|
||||
void toggle_selected(size_t selected);
|
||||
void toggle_selected(std::string selected);
|
||||
std::vector<bool> selected() const;
|
||||
std::vector<std::string> selected_text() const;
|
||||
|
||||
void from_json(const json& j) override;
|
||||
json to_json() const override;
|
||||
private:
|
||||
std::vector<bool> p_selected;
|
||||
|
||||
UI_checkbox_on_change p_on_change;
|
||||
};
|
||||
Reference in New Issue
Block a user