mirror of
https://github.com/XITRIX/NXKit.git
synced 2026-05-30 11:46:52 +00:00
30 lines
583 B
C++
30 lines
583 B
C++
//
|
|
// Created by Даниил Виноградов on 26.01.2025.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
#include <utility>
|
|
|
|
namespace NXKit {
|
|
|
|
class UIAction {
|
|
public:
|
|
explicit UIAction(std::string title = "", std::function<void()> handler = []() {});
|
|
|
|
std::string title() { return _title; }
|
|
void setTitle(std::string title) { _title = std::move(title); }
|
|
|
|
// uint identifier() { return _id; }
|
|
void perform() { _handler(); }
|
|
private:
|
|
friend class UIControl;
|
|
|
|
std::function<void()> _handler;
|
|
std::string _title;
|
|
// uint _id;
|
|
};
|
|
|
|
} |