Add some widget layout and ability event handling.

This commit is contained in:
jmsgrogan 2020-06-20 19:00:06 +01:00
parent b99708e7d3
commit 4e85edacc8
24 changed files with 285 additions and 31 deletions

View file

@ -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: