libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
UIButton.hpp
Go to the documentation of this file.
1
#ifndef UIBUTTON_HPP
2
#define UIBUTTON_HPP
3
/*
4
This file is part of AlgAudio.
5
6
AlgAudio, Copyright (C) 2015 CeTA - Audiovisual Technology Center
7
8
AlgAudio is free software: you can redistribute it and/or modify
9
it under the terms of the GNU Lesser General Public License as
10
published by the Free Software Foundation, either version 3 of the
11
License, or (at your option) any later version.
12
13
AlgAudio is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public License
19
along with AlgAudio. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
#include "
UIWidget.hpp
"
22
#include "
Theme.hpp
"
23
24
namespace
AlgAudio
{
25
26
class
UIButton
:
public
UIWidget
{
27
public
:
28
static
std::shared_ptr<UIButton>
Create
(std::weak_ptr<Window> parent_window, std::string text);
29
void
SetText
(std::string);
30
void
SetColor
(
Color
background);
31
void
SetColors
(
Color
text,
Color
background);
32
virtual
void
CustomDraw
(
DrawContext
& c)
override
;
33
void
SetFontSize
(
int
fontsize);
34
void
SetBorder
(
bool
enabled);
35
void
SetInnerMargin
(
int
m);
36
private
:
37
UIButton
(std::weak_ptr<Window> parent_window, std::string text);
38
std::string text;
39
int
fontsize = 16;
40
bool
border_enabled =
true
;
41
int
inner_margin = 5;
42
std::shared_ptr<SDLTextTexture> texture;
43
Color
bg_color;
44
Color
text_color;
45
void
UpdateTexture();
46
Color
GetBgColor()
const
;
47
};
48
49
}
// namespace AlgAudio
50
51
#endif // UIBUTTON_HPP
AlgAudio::UIButton::SetColors
void SetColors(Color text, Color background)
AlgAudio::UIButton::CustomDraw
virtual void CustomDraw(DrawContext &c) override
AlgAudio::UIWidget
Definition:
UIWidget.hpp:65
AlgAudio::Color
Definition:
Color.hpp:28
AlgAudio::UIButton::SetText
void SetText(std::string)
AlgAudio::DrawContext
Definition:
DrawContext.hpp:65
AlgAudio::UIButton::SetInnerMargin
void SetInnerMargin(int m)
AlgAudio::UIButton::SetFontSize
void SetFontSize(int fontsize)
UIWidget.hpp
AlgAudio::UIButton::Create
static std::shared_ptr< UIButton > Create(std::weak_ptr< Window > parent_window, std::string text)
AlgAudio::UIButton::SetBorder
void SetBorder(bool enabled)
AlgAudio::UIButton
Definition:
UIButton.hpp:26
AlgAudio::UIButton::SetColor
void SetColor(Color background)
AlgAudio
Definition:
Alertable.hpp:26
Theme.hpp
libalgaudio
include
UI
UIButton.hpp
Generated on Fri Sep 25 2015 14:12:23 for libAlgAudio by
1.8.8