nomlib
Loading...
Searching...
No Matches
UIQuestionDialogBox.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_UIQUESTION_DIALOG_BOX_HPP
30#define NOMLIB_GUI_UIQUESTION_DIALOG_BOX_HPP
31
32#include <string>
33#include <vector>
34
35#include "nomlib/config.hpp"
36#include "nomlib/math/Point2.hpp"
37#include "nomlib/math/Size2.hpp"
38#include "nomlib/gui/UIMessageBox.hpp"
39
40namespace nom {
41
47{
48 public:
49 typedef UIQuestionDialogBox self_type;
50 typedef self_type* raw_ptr;
51
57
60
63 const std::string& response_id() const;
64
67 const std::string& element_type() const;
68
69 nom::size_type num_responses() const;
70
75 int selection() const;
76
78 std::vector<std::string> responses() const;
79 std::string response( int pos ) const;
80
81 void set_response_id( const std::string& id );
82 void set_element_type( const std::string& type );
83
85 void set_selection( int pos );
86
87 private:
88 std::string response_id_;
89 std::string element_type_;
90
93};
94
95} // namespace nom
96
97#endif // include guard defined
98
UIMessageBox()
Default constructor; initialize default element IDs.
const std::string & element_type() const
The element tag to use for indexing as a possible response choice (i.e.: button).
UIQuestionDialogBox()
Default constructor; initialize default element IDs.
void set_selection(int pos)
Set the current selection index (position).
std::vector< std::string > responses() const
Get the response element IDs.
const std::string & response_id() const
The ID selector used to search for the number of children; the response elements to index,...
int selection() const
Obtain the current selection index (position) of the responses.
virtual ~UIQuestionDialogBox()
Destructor.
int selection_
Selected item, identified by its index (position).