aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2005-09-14 20:28:15 (GMT)
committerfluxgen <fluxgen>2005-09-14 20:28:15 (GMT)
commit43fc6483b4bbe72bb31142b079269e219ee675d6 (patch)
tree5ed173df5c7f1f5cc7645a6ea882bfd495c255ba
parent8634b9b3ef271adc12b9d989174aaa51b394fc08 (diff)
downloadfluxbox-43fc6483b4bbe72bb31142b079269e219ee675d6.zip
fluxbox-43fc6483b4bbe72bb31142b079269e219ee675d6.tar.bz2
moved MenuContext class
-rw-r--r--src/MenuCreator.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index cb1f33c..fc427aa 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -143,6 +143,19 @@ private:
143 FbTk::Menu *m_menu; 143 FbTk::Menu *m_menu;
144}; 144};
145 145
146class MenuContext: public LayerObject {
147public:
148 void moveToLayer(int layer_number) {
149 if (WindowCmd<void>::window() == 0)
150 return;
151 WindowCmd<void>::window()->moveToLayer(layer_number);
152 }
153 int layerNumber() const {
154 if (WindowCmd<void>::window() == 0)
155 return -1;
156 return WindowCmd<void>::window()->layerItem().getLayerNum();
157 }
158};
146 159
147static void translateMenuItem(Parser &parse, ParseItem &item); 160static void translateMenuItem(Parser &parse, ParseItem &item);
148 161
@@ -532,19 +545,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
532 if (screen == 0) 545 if (screen == 0)
533 return false; 546 return false;
534 547
535 class MenuContext: public LayerObject { 548 static MenuContext context;
536 public:
537 void moveToLayer(int layer_number) {
538 if (WindowCmd<void>::window() == 0)
539 return;
540 WindowCmd<void>::window()->moveToLayer(layer_number);
541 }
542 int layerNumber() const {
543 if (WindowCmd<void>::window() == 0)
544 return -1;
545 return WindowCmd<void>::window()->layerItem().getLayerNum();
546 }
547 } static context;
548 549
549 FbTk::Menu *submenu = new LayerMenu(screen->menuTheme(), 550 FbTk::Menu *submenu = new LayerMenu(screen->menuTheme(),
550 screen->imageControl(), 551 screen->imageControl(),