diff options
Diffstat (limited to 'src/Slit.cc')
-rw-r--r-- | src/Slit.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Slit.cc b/src/Slit.cc index 15b171f..9e69ce2 100644 --- a/src/Slit.cc +++ b/src/Slit.cc | |||
@@ -196,11 +196,11 @@ private: | |||
196 | 196 | ||
197 | class SlitDirMenuItem: public FbTk::MenuItem { | 197 | class SlitDirMenuItem: public FbTk::MenuItem { |
198 | public: | 198 | public: |
199 | SlitDirMenuItem(const char *label, Slit &slit, FbTk::RefCount<FbTk::Command> &cmd) | 199 | SlitDirMenuItem(const FbTk::FbString &label, Slit &slit, FbTk::RefCount<FbTk::Command> &cmd) |
200 | :FbTk::MenuItem(label,cmd), | 200 | :FbTk::MenuItem(label,cmd), |
201 | m_slit(slit), | 201 | m_slit(slit), |
202 | m_label(label ? label : "") { | 202 | m_label(label) { |
203 | setLabel(m_label.c_str()); // update label | 203 | setLabel(m_label); // update label |
204 | } | 204 | } |
205 | 205 | ||
206 | void click(int button, int time) { | 206 | void click(int button, int time) { |
@@ -209,19 +209,19 @@ public: | |||
209 | m_slit.setDirection(Slit::VERTICAL); | 209 | m_slit.setDirection(Slit::VERTICAL); |
210 | else | 210 | else |
211 | m_slit.setDirection(Slit::HORIZONTAL); | 211 | m_slit.setDirection(Slit::HORIZONTAL); |
212 | setLabel(m_label.c_str()); | 212 | setLabel(m_label); |
213 | FbTk::MenuItem::click(button, time); | 213 | FbTk::MenuItem::click(button, time); |
214 | } | 214 | } |
215 | 215 | ||
216 | void setLabel(const char *label) { | 216 | void setLabel(const FbTk::FbString &label) { |
217 | _FB_USES_NLS; | 217 | _FB_USES_NLS; |
218 | m_label = (label ? label : ""); | 218 | m_label = (label); |
219 | std::string reallabel = m_label + " " + | 219 | std::string reallabel = m_label + " " + |
220 | ( m_slit.direction() == Slit::HORIZONTAL ? | 220 | ( m_slit.direction() == Slit::HORIZONTAL ? |
221 | 221 | ||
222 | _FBTEXT(Align, Horizontal, "Horizontal", "Horizontal"): | 222 | _FBTEXT(Align, Horizontal, "Horizontal", "Horizontal"): |
223 | _FBTEXT(Align, Vertical, "Vertical", "Vertical")); | 223 | _FBTEXT(Align, Vertical, "Vertical", "Vertical")); |
224 | FbTk::MenuItem::setLabel(reallabel.c_str()); | 224 | FbTk::MenuItem::setLabel(reallabel); |
225 | } | 225 | } |
226 | private: | 226 | private: |
227 | Slit &m_slit; | 227 | Slit &m_slit; |
@@ -230,7 +230,7 @@ private: | |||
230 | 230 | ||
231 | class PlaceSlitMenuItem: public FbTk::MenuItem { | 231 | class PlaceSlitMenuItem: public FbTk::MenuItem { |
232 | public: | 232 | public: |
233 | PlaceSlitMenuItem(const char *label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command> &cmd): | 233 | PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command> &cmd): |
234 | FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) { | 234 | FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) { |
235 | 235 | ||
236 | } | 236 | } |
@@ -1298,7 +1298,7 @@ void Slit::setupMenu() { | |||
1298 | m_clientlist_menu.setInternalMenu(); | 1298 | m_clientlist_menu.setInternalMenu(); |
1299 | m_slitmenu.setInternalMenu(); | 1299 | m_slitmenu.setInternalMenu(); |
1300 | 1300 | ||
1301 | typedef pair<const char *, Slit::Placement> PlacementP; | 1301 | typedef pair<FbTk::FbString, Slit::Placement> PlacementP; |
1302 | typedef list<PlacementP> Placements; | 1302 | typedef list<PlacementP> Placements; |
1303 | Placements place_menu; | 1303 | Placements place_menu; |
1304 | 1304 | ||
@@ -1307,7 +1307,7 @@ void Slit::setupMenu() { | |||
1307 | place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER)); | 1307 | place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER)); |
1308 | place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT)); | 1308 | place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT)); |
1309 | place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER)); | 1309 | place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER)); |
1310 | place_menu.push_back(PlacementP((const char *)0, Slit::TOPLEFT)); | 1310 | place_menu.push_back(PlacementP("", Slit::TOPLEFT)); |
1311 | place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER)); | 1311 | place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER)); |
1312 | place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT)); | 1312 | place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT)); |
1313 | place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER)); | 1313 | place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER)); |
@@ -1316,10 +1316,10 @@ void Slit::setupMenu() { | |||
1316 | 1316 | ||
1317 | // create items in sub menu | 1317 | // create items in sub menu |
1318 | for (size_t i=0; i<9; ++i) { | 1318 | for (size_t i=0; i<9; ++i) { |
1319 | const char *str = place_menu.front().first; | 1319 | const FbTk::FbString &str = place_menu.front().first; |
1320 | Slit::Placement placement = place_menu.front().second; | 1320 | Slit::Placement placement = place_menu.front().second; |
1321 | 1321 | ||
1322 | if (str == 0) { | 1322 | if (str == "") { |
1323 | placement_menu->insert(""); | 1323 | placement_menu->insert(""); |
1324 | placement_menu->setItemEnabled(i, false); | 1324 | placement_menu->setItemEnabled(i, false); |
1325 | } else { | 1325 | } else { |