diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-05 18:07:48 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-05 18:07:48 -0500 |
commit | 76e39eac8cee2175ec62a191f7c91ca53857e80c (patch) | |
tree | 156946f6e8f491235453aa3cbecfda43d6baa2a7 /src/user/include/cxx/raleigh/w/button.h | |
parent | 5e5e524f08ad653a7bf5d6e97f3a49f6c27d08fa (diff) | |
download | portland-os-76e39eac8cee2175ec62a191f7c91ca53857e80c.tar.gz |
more raleigh, including button and vbox widgets
Diffstat (limited to 'src/user/include/cxx/raleigh/w/button.h')
-rw-r--r-- | src/user/include/cxx/raleigh/w/button.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/user/include/cxx/raleigh/w/button.h b/src/user/include/cxx/raleigh/w/button.h new file mode 100644 index 0000000..1847cf1 --- /dev/null +++ b/src/user/include/cxx/raleigh/w/button.h @@ -0,0 +1,26 @@ +#ifndef RALEIGH_W_BUTTON_H +#define RALEIGH_W_BUTTON_H + +#include <raleigh/widget.h> + +namespace raleigh { + class button : public widget { + public: + button(widget &inner, void (*on_click)(button &), _pixel_t border_color=RGB(00, 00, 00), + _pixel_t bg_color=RGB(bf, bf, bf), _pixel_t pressed_color=RGB(9f, 9f, 9f)); + + void notify_window_change() override; + void paint(_pixel_t *pixbuf, uint32_t pitch) override; + bool try_handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override; + void notify_has_opaque_parent(widget *parent) override; + private: + widget &inner; + void (*on_click)(button &); + _pixel_t border_color; + _pixel_t bg_color; + _pixel_t pressed_color; + bool is_pressed; + }; +} + +#endif
\ No newline at end of file |