Add some widget layout and ability event handling.
This commit is contained in:
parent
b99708e7d3
commit
4e85edacc8
24 changed files with 285 additions and 31 deletions
|
@ -1,11 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "Widget.h"
|
||||
#include <functional>
|
||||
|
||||
class Button : public Widget
|
||||
{
|
||||
private:
|
||||
using clickFunc = std::function<void()>;
|
||||
std::string mLabel;
|
||||
clickFunc mClickFunc;
|
||||
|
||||
public:
|
||||
Button();
|
||||
|
@ -14,6 +17,8 @@ public:
|
|||
|
||||
void SetLabel(const std::string& text);
|
||||
|
||||
void SetOnClickFunction(clickFunc func);
|
||||
|
||||
void OnPaintEvent(const PaintEvent* event) override;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue