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 "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
41namespace nom {
42
46class 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
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
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.