nomlib
Loading...
Searching...
No Matches
UIMessageBox.hpp
1/******************************************************************************
2
3 nomlib - C++11 cross-platform game engine
4
5Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6All rights reserved.
7
8Redistribution and use in source and binary forms, with or without
9modification, are permitted provided that the following conditions are met:
10
111. Redistributions of source code must retain the above copyright notice, this
12 list of conditions and the following disclaimer.
132. 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
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24ON 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
26SOFTWARE, 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 "nomlib/config.hpp"
35#include "nomlib/gui/UIWidget.hpp"
36#include "nomlib/math/Point2.hpp"
37#include "nomlib/math/Size2.hpp"
38#include "nomlib/math/Rect.hpp"
39
40namespace nom {
41
46{
47 public:
48 typedef UIMessageBox self_type;
49
50 typedef self_type* raw_ptr;
51 // typedef std::shared_ptr<self_type> shared_ptr;
52 // typedef std::unique_ptr<self_type> unique_ptr;
53
59
61 virtual ~UIMessageBox();
62
63 bool enabled() const;
64
65 std::string title_text() const;
66
77 IntRect title_bounds() const;
78
79 uint32 title_alignment() const;
80
81 std::string message_text() const;
82
93 IntRect message_bounds() const;
94
95 uint32 message_alignment() const;
96
97 const std::string& message_id() const;
98
99 void disable();
100 void enable();
101
105 void set_title( const std::string& text, const std::string& font, uint point_size );
106
108 void set_title_text( const std::string& text );
109
111 void set_title_font( const std::string& font );
112
114 void set_title_font_size( int point_size );
115
125 void set_title_alignment( uint32 align );
126
131 void set_message( const std::string& text, const std::string& font, uint point_size );
132
134 void set_message_text( const std::string& text );
135
137 void set_message_font( const std::string& font );
138
140 void set_message_font_size( int point_size );
141
151 void set_message_alignment( uint32 align );
152
153 void set_message_id( const std::string& id );
154
155 private:
156 std::string message_id_;
157};
158
159} // namespace nom
160
161#endif // include guard defined
162
void set_title(const std::string &text, const std::string &font, uint point_size)
Set the title (caption) text of the message box.
virtual ~UIMessageBox()
Destructor.
UIMessageBox()
Default constructor; initialize default element IDs.
void set_title_alignment(uint32 align)
Set the title (caption) text's alignment.
void set_title_font_size(int point_size)
Set the title (caption) text's font size.
IntRect message_bounds() const
Obtain the rectangle bounds of the message string.
IntRect title_bounds() const
Obtain the rectangle bounds of the title string.
void set_message_alignment(uint32 align)
Set the message text's alignment.
void set_message_text(const std::string &text)
Set the message text label.
void set_message_font_size(int point_size)
Set the message text's font size.
void set_message(const std::string &text, const std::string &font, uint point_size)
Set the message text label.
void set_title_font(const std::string &font)
Set the title (caption) text's font.
void set_title_text(const std::string &text)
Set the title (caption) text of the message box.
void set_message_font(const std::string &font)
Set the message text's font.
UIWidget()
Default constructor; initialize default title element ID.