Squashed 'libraries/ZWidget/' content from commit 96501b6ef1
git-subtree-dir: libraries/ZWidget git-subtree-split: 96501b6ef11e8737cd8ccb2451395115b810dfcc
This commit is contained in:
commit
d9b2c00228
118 changed files with 26617 additions and 0 deletions
32
include/zwidget/widgets/pushbutton/pushbutton.h
Normal file
32
include/zwidget/widgets/pushbutton/pushbutton.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "../../core/widget.h"
|
||||
#include <functional>
|
||||
|
||||
class PushButton : public Widget
|
||||
{
|
||||
public:
|
||||
PushButton(Widget* parent = nullptr);
|
||||
|
||||
void SetText(const std::string& value);
|
||||
const std::string& GetText() const;
|
||||
|
||||
double GetPreferredHeight() const;
|
||||
|
||||
void Click();
|
||||
|
||||
std::function<void()> OnClick;
|
||||
|
||||
protected:
|
||||
void OnPaint(Canvas* canvas) override;
|
||||
bool OnMouseDown(const Point& pos, InputKey key) override;
|
||||
bool OnMouseUp(const Point& pos, InputKey key) override;
|
||||
void OnMouseMove(const Point& pos) override;
|
||||
void OnMouseLeave() override;
|
||||
void OnKeyDown(InputKey key) override;
|
||||
void OnKeyUp(InputKey key) override;
|
||||
|
||||
private:
|
||||
std::string text;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue