bWidgets
Core widget toolkit designed for Blender
bwCheckbox.h
Go to the documentation of this file.
1#pragma once
2
3#include "bwAbstractButton.h"
4
5namespace bWidgets {
6
8 public:
9 bwCheckbox(const std::string& text = "",
10 std::optional<unsigned int> width_hint = std::nullopt,
11 std::optional<unsigned int> height_hint = std::nullopt);
12
13 auto getTypeIdentifier() const -> std::string_view override;
14
15 void draw(class bwStyle& style) override;
16
17 auto createHandler() -> std::unique_ptr<bwScreenGraph::EventHandler> override;
18
19 auto isChecked() const -> bool;
20
21 private:
22 auto isInsideCheckbox(const bwPoint& point) const -> bool;
23
24 auto getCheckboxRectangle() const -> bwRectanglePixel;
25 auto getTextRectangle(const bwRectanglePixel& checkbox_rectangle) const -> bwRectanglePixel;
26};
27
28} // namespace bWidgets
Base class for button like widgets.
Definition: bwAbstractButton.h:17
std::string text
Definition: bwAbstractButton.h:42
Definition: bwCheckbox.h:7
auto createHandler() -> std::unique_ptr< bwScreenGraph::EventHandler > override
Definition: bwCheckbox.cc:82
bwCheckbox(const std::string &text="", std::optional< unsigned int > width_hint=std::nullopt, std::optional< unsigned int > height_hint=std::nullopt)
Definition: bwCheckbox.cc:9
auto isChecked() const -> bool
Definition: bwCheckbox.cc:45
auto getTypeIdentifier() const -> std::string_view override
Definition: bwCheckbox.cc:18
void draw(class bwStyle &style) override
Definition: bwCheckbox.cc:23
Definition: bwPoint.h:7
Definition: bwStyle.h:10
unsigned int height_hint
Definition: bwWidget.h:68
unsigned int width_hint
Definition: bwWidget.h:68
Definition: bwContext.h:3
bwRectangle< int > bwRectanglePixel
Definition: bwRectangle.h:114