Squashed 'libraries/ZWidget/' changes from 02da8cdc0e..cecd34301d
cecd34301d Delay load DPI-related functions bfc172f702 Added exception to some unimplemented functions 7c8d469bcb Added item modifications functions 847d0e6d9e Improved keyboard navigation 8c4270e0f8 Dropdown can now be closed by re-selecting it 91402c31ec Fix dropdown positioning in x11 and win32 git-subtree-dir: libraries/ZWidget git-subtree-split: cecd34301d369400227eb0f27bad2ab41ad756d2
This commit is contained in:
parent
2ef2243f7f
commit
6356d87438
7868 changed files with 492 additions and 1691650 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