diff options
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r-- | src/MenuCreator.cc | 27 |
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 | ||
146 | class MenuContext: public LayerObject { | ||
147 | public: | ||
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 | ||
147 | static void translateMenuItem(Parser &parse, ParseItem &item); | 160 | static 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(), |