lecui 1.0.0-alpha.20
lecui C++ user interface library
status_pane.h
1//
2// status_pane.h - status_pane container interface
3//
4// lecui user interface library, part of the liblec library
5// Copyright (c) 2019 Alec Musasa (alecmus at live dot com)
6//
7// Released under the MIT license. For full details see the
8// file LICENSE.txt
9//
10
11#pragma once
12
13#if defined(LECUI_EXPORTS)
14#include "../widgets/widget.h"
15#else
16#include <liblec/lecui/widgets/widget.h>
17#endif
18
19namespace liblec {
20 namespace lecui {
21 namespace containers {
22#if defined(LECUI_EXPORTS)
23 class side_pane;
24 class status_pane_builder;
25#endif
26
30 class lecui_api status_pane_specs {
31 public:
33 enum class pane_location {
34 bottom,
35 top,
36 left,
37 right,
38 };
39
40 private:
42 float _thickness = 32.f;
43 bool _floating = false;
44 bool _side_pane = false;
45
46#if defined(LECUI_EXPORTS)
47 friend class side_pane;
48 friend class status_pane_builder;
49#endif
50
51 public:
55 float& thickness();
56
61 status_pane_specs& thickness(const float& thickness);
62
67 bool& floating();
68
74 status_pane_specs& floating(const bool& floating);
75
79
84 };
85
87 class lecui_api status_pane_base : public containers::page {
88 public:
92 status_pane_base(form& fm, const std::string& alias);
93
96 };
97
106 class lecui_api status_pane : public status_pane_base {
107 public:
114
115 [[nodiscard]]
130
137 [[nodiscard]]
138 static containers::status_pane& get(form& fm, const std::string& alias);
139 };
140 }
141 }
142}
143
144#if defined(lecui_helper)
146#define get_status_pane(path) liblec::lecui::containers::status_pane::get(*this, path)
147#endif
Page container.
Definition: page.h:32
Side pane container. To instantiate and add to a container use the add static method.
Definition: side_pane.h:25
Base class for all status panes.
Definition: status_pane.h:87
virtual ~status_pane_base()
Base class destructor.
status_pane_base(form &fm, const std::string &alias)
Base class constructor.
Status pane container specifications.
Definition: status_pane.h:30
pane_location & location()
Get or set the location of the status pane.
bool & floating()
Get or set the floating property.
status_pane_specs & thickness(const float &thickness)
Set the pane's thickness. This will be a height for top and bottom panes, and a width for left and ri...
status_pane_specs & location(const status_pane_specs::pane_location location)
Set the location of the status pane.
pane_location
The status pane's location.
Definition: status_pane.h:33
float & thickness()
Get or set the pane's thickness. This will be a height for top and bottom panes, and a width for left...
status_pane_specs & floating(const bool &floating)
Set the floating property.
Status pane container. To instantiate and add to a container use the add static method.
Definition: status_pane.h:106
static status_pane & add(form &fm, status_pane_specs specs)
Create a status pane.
status_pane(form &fm, status_pane_specs specs)
Class constructor.
static containers::status_pane & get(form &fm, const std::string &alias)
Get a reference to an existing status pane.
Form base class. The user must inherit from this class and call one of the two constructors from its ...
Definition: form.h:122
@ right
Align text to the right.
@ left
Align text to the left edge.
@ bottom
Align paragraph to the bottom.
@ top
Align paragraph to the top.
Top level namespace for the liblec libraries.
Definition: appearance.h:19