Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
cell_radio.hpp
Go to the documentation of this file.
1/*
2 Copyright 2021 XITRIX
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#pragma once
18
20#include <aurore/core/bind.hpp>
21#include <aurore/core/box.hpp>
23
24namespace aurore
25{
26
27class CheckBox : public View
28{
29 public:
31 virtual void draw(NVGcontext* vg, float x, float y, float width, float height, Style style, FrameContext* ctx) override;
32
33 static View* create();
34};
35
36class RadioCell : public RecyclerCell
37{
38 public:
40
41 void setSelected(bool selected);
43
44 AURORE_BIND(Label, title, "aurore/rediocell/title");
45 AURORE_BIND(CheckBox, checkbox, "aurore/rediocell/checkbox");
46
47 static View* create();
48
49 bool setBoundText(const std::string& text) override
50 {
51 this->title->setText(text);
52 return true;
53 }
54
55 protected:
57 std::string getDefaultAccessibilityLabel() override { return this->title->getFullText(); }
58 bool getDefaultAccessibilitySelected() override { return this->selected; }
59
60 private:
61 bool selected = false;
62};
63
64} // namespace aurore
Definition cell_radio.hpp:28
virtual void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
static View * create()
Definition frame_context.hpp:30
Definition label.hpp:65
Definition cell_radio.hpp:37
std::string getDefaultAccessibilityLabel() override
A focusable box says the texts shown in it (getAccessibilityText).
Definition cell_radio.hpp:57
static View * create()
bool getDefaultAccessibilitySelected() override
Definition cell_radio.hpp:58
bool setBoundText(const std::string &text) override
Definition cell_radio.hpp:49
void setSelected(bool selected)
AccessibilityRole getDefaultAccessibilityRole() override
Definition cell_radio.hpp:56
AURORE_BIND(CheckBox, checkbox, "aurore/rediocell/checkbox")
AURORE_BIND(Label, title, "aurore/rediocell/title")
Definition recycler.hpp:66
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition view.hpp:232
Definition actions.hpp:25
AccessibilityRole
Definition view_style.hpp:78
Definition text.hpp:13