nomlib
Toggle main menu visibility
Loading...
Searching...
No Matches
include
nomlib
gui
UIMessageBox.hpp
1
/******************************************************************************
2
3
nomlib - C++11 cross-platform game engine
4
5
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
10
11
1. Redistributions of source code must retain the above copyright notice, this
12
list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright notice,
14
this list of conditions and the following disclaimer in the documentation
15
and/or other materials provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
******************************************************************************/
29
#ifndef NOMLIB_GUI_UIMESSAGEBOX_HPP
30
#define NOMLIB_GUI_UIMESSAGEBOX_HPP
31
32
#include <string>
33
34
#include "export.hpp"
35
#include "nomlib/config.hpp"
36
#include "nomlib/gui/UIWidget.hpp"
37
#include "nomlib/math/Point2.hpp"
38
#include "nomlib/math/Size2.hpp"
39
#include "nomlib/math/Rect.hpp"
40
41
namespace
nom {
42
46
class
NOM_EXPORT
UIMessageBox
:
public
UIWidget
47
{
48
public
:
49
typedef
UIMessageBox
self_type;
50
51
typedef
self_type* raw_ptr;
52
// typedef std::shared_ptr<self_type> shared_ptr;
53
// typedef std::unique_ptr<self_type> unique_ptr;
54
59
UIMessageBox
();
60
62
virtual
~UIMessageBox
();
63
64
bool
enabled()
const
;
65
66
std::string title_text()
const
;
67
78
IntRect
title_bounds
()
const
;
79
80
uint32 title_alignment()
const
;
81
82
std::string message_text()
const
;
83
94
IntRect
message_bounds
()
const
;
95
96
uint32 message_alignment()
const
;
97
98
const
std::string& message_id()
const
;
99
100
void
disable();
101
void
enable();
102
106
void
set_title
(
const
std::string& text,
const
std::string& font, uint point_size );
107
109
void
set_title_text
(
const
std::string& text );
110
112
void
set_title_font
(
const
std::string& font );
113
115
void
set_title_font_size
(
int
point_size );
116
126
void
set_title_alignment
( uint32 align );
127
132
void
set_message
(
const
std::string& text,
const
std::string& font, uint point_size );
133
135
void
set_message_text
(
const
std::string& text );
136
138
void
set_message_font
(
const
std::string& font );
139
141
void
set_message_font_size
(
int
point_size );
142
152
void
set_message_alignment
( uint32 align );
153
154
void
set_message_id(
const
std::string&
id
);
155
156
private
:
157
std::string message_id_;
158
};
159
160
}
// namespace nom
161
162
#endif
// include guard defined
163
nom::UIMessageBox::set_title
void set_title(const std::string &text, const std::string &font, uint point_size)
Set the title (caption) text of the message box.
nom::UIMessageBox::~UIMessageBox
virtual ~UIMessageBox()
Destructor.
nom::UIMessageBox::UIMessageBox
UIMessageBox()
Default constructor; initialize default element IDs.
nom::UIMessageBox::set_title_alignment
void set_title_alignment(uint32 align)
Set the title (caption) text's alignment.
nom::UIMessageBox::set_title_font_size
void set_title_font_size(int point_size)
Set the title (caption) text's font size.
nom::UIMessageBox::message_bounds
IntRect message_bounds() const
Obtain the rectangle bounds of the message string.
nom::UIMessageBox::title_bounds
IntRect title_bounds() const
Obtain the rectangle bounds of the title string.
nom::UIMessageBox::set_message_alignment
void set_message_alignment(uint32 align)
Set the message text's alignment.
nom::UIMessageBox::set_message_text
void set_message_text(const std::string &text)
Set the message text label.
nom::UIMessageBox::set_message_font_size
void set_message_font_size(int point_size)
Set the message text's font size.
nom::UIMessageBox::set_message
void set_message(const std::string &text, const std::string &font, uint point_size)
Set the message text label.
nom::UIMessageBox::set_title_font
void set_title_font(const std::string &font)
Set the title (caption) text's font.
nom::UIMessageBox::set_title_text
void set_title_text(const std::string &text)
Set the title (caption) text of the message box.
nom::UIMessageBox::set_message_font
void set_message_font(const std::string &font)
Set the message text's font.
nom::UIWidget::UIWidget
UIWidget()
Default constructor; initialize default title element ID.
Generated on
for nomlib by
1.18.0