Repository navigation
Expand file tree
/
Copy pathMultiInputOneComboBox.cpp
More file actions
169 lines (94 loc) · 3.15 KB
/
Copy pathMultiInputOneComboBox.cpp
File metadata and controls
169 lines (94 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/**
* @file MultiInputOneComboBox.cpp
*
* @brief File containing source code of the MultiInputOneComboBox class
*
*
* @author Hugo MARTIN
* Contact: hugo.martin.1@etu.univ-amu.fr
*
*/
#include "classes.h"
/** Constructor of the class MultiInputOneComboBox.
*
* Modification of the constructor of MultiInputOneComboBox */
vampireGameproject::MultiInputOneComboBox::MultiInputOneComboBox(){}
/** Destructor of the class MultiInputOneComboBox.
*
* Modification of the destructor of MultiInputOneComboBox */
vampireGameproject::MultiInputOneComboBox::~MultiInputOneComboBox(){}
/** Implementation of the returnSpinButton method.
*
* Implementation of the returnSpinButton method
* Method returning the reference of the SpinButton */
Gtk::SpinButton& vampireGameproject::MultiInputOneComboBox::returnSpinButton(){
return spinButton;
}
/** Implementation of the returnComboBox method.
*
* Implementation of the returnComboBox method
* Method returning the reference of the ComboBox */
Gtk::ComboBoxText& vampireGameproject::MultiInputOneComboBox::returnComboBox(){
return ComboBox;
}
/** Implementation of the setLimitSpinButton method.
*
* Implementation of the setLimitSpinButton method
* Method setting the limit of the SpinButton
*
* @param limit: limit of the SpinButton
*/
void vampireGameproject::MultiInputOneComboBox::setLimitSpinButton(int limit){
spinButton.set_range(0, limit);
spinButton.set_increments(1,1);
}
/** Implementation of the returnSpinScore method.
*
* Implementation of the returnSpinScore method
* Method returning the Spin Score from the Spin Button */
int vampireGameproject::MultiInputOneComboBox::returnSpinScore(){
return spinButton.get_value();
}
/** Implementation of the returnTextComboBox method.
*
* Implementation of the returnTextComboBox method
* Method returning the Text from ComboBox
* If nothing is set for the Combobox, then an empty string
* is returned
*/
std::string vampireGameproject::MultiInputOneComboBox::returnTextComboBox(){
if (ComboBox.get_active_text() != ""){
return ComboBox.get_active_text();
}
return "";
}
/** Implementation of the setVectorComboBox method.
*
* Implementation of the setVectorComboBox method
* Method setting the vector containing the ComboBox items
*
* @param vectorText: vector containing the items
*/
void vampireGameproject::MultiInputOneComboBox::setVectorComboBox(std::vector<std::string>& vectorText){
for(int iterator = 0; iterator < (int)vectorText.size(); iterator++){
ComboBox.append(vectorText.at(iterator));
}
}
/** Implementation of the unsetActiveText method.
*
* Implementation of the unsetActiveText method
* Method unsetting the active text of the ComboBox Text
*
*
*/
void vampireGameproject::MultiInputOneComboBox::unsetActiveText(){
ComboBox.set_active_text("");
}
/** Implementation of the resetSpinScore method.
*
* Implementation of the resetSpinScore method
* Method reseting the spin Score of a MultiInputOneComboBox Spin Button */
void vampireGameproject::MultiInputOneComboBox::resetSpinScore(){
spinButton.set_value(0);
spinButton.set_increments(0, 0);
}