bWidgets
Core widget toolkit designed for Blender
bwPanel.h
Go to the documentation of this file.
1#pragma once
2
3#include "bwContainerWidget.h"
4
5namespace bWidgets {
6
7class bwPanel : public bwContainerWidget {
8 friend class bwPanelHandler;
9
10 public:
11 enum class State {
12 OPEN,
13 CLOSED,
14 };
15
17 std::string label,
18 std::optional<unsigned int> header_height_hint = std::nullopt);
19
20 auto getTypeIdentifier() const -> std::string_view override;
21
22 void draw(class bwStyle& style) override;
23
24 void registerProperties() override;
25
26 auto getLabel() const -> const std::string* override;
27 auto childrenVisible() const -> bool override;
28
29 auto createHandler() -> std::unique_ptr<bwScreenGraph::EventHandler> override;
30
31 unsigned int getHeaderHeightHint() const;
32
33 unsigned int header_height;
35
36 private:
37 void drawHeader(class bwStyle& style) const;
38 auto getHeaderRectangle() const -> bwRectanglePixel;
39 auto isCoordinateInsideHeader(const bwPoint& point) const -> bool;
40
41 std::string label;
42
43 public:
44 bool draw_separator = false;
45};
46
47} // namespace bWidgets
Definition: bwContainerWidget.h:12
const bwScreenGraph::ContainerNode & node
Definition: bwContainerWidget.h:25
Definition: bwPanel.cc:155
Definition: bwPanel.h:7
bool draw_separator
Definition: bwPanel.h:44
auto getTypeIdentifier() const -> std::string_view override
Definition: bwPanel.cc:22
State panel_state
Definition: bwPanel.h:34
auto childrenVisible() const -> bool override
Definition: bwPanel.cc:49
unsigned int getHeaderHeightHint() const
Definition: bwPanel.cc:60
auto createHandler() -> std::unique_ptr< bwScreenGraph::EventHandler > override
Definition: bwPanel.cc:170
State
Definition: bwPanel.h:11
void registerProperties() override
Definition: bwPanel.cc:38
bwPanel(const bwScreenGraph::ContainerNode &node, std::string label, std::optional< unsigned int > header_height_hint=std::nullopt)
Definition: bwPanel.cc:12
void draw(class bwStyle &style) override
Definition: bwPanel.cc:27
auto getLabel() const -> const std::string *override
Definition: bwPanel.cc:44
unsigned int header_height
Definition: bwPanel.h:33
Definition: bwPoint.h:7
Node representing a widget with children.
Definition: Node.h:167
Definition: bwStyle.h:10
Definition: bwContext.h:3