summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MenuCreator.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index 90a4386..6bf9c29 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: MenuCreator.cc,v 1.6 2004/06/07 11:46:04 rathnor Exp $ 23// $Id: MenuCreator.cc,v 1.7 2004/06/07 22:23:50 fluxgen Exp $
24 24
25#include "MenuCreator.hh" 25#include "MenuCreator.hh"
26 26
@@ -46,6 +46,8 @@
46#include "FbTk/SimpleCommand.hh" 46#include "FbTk/SimpleCommand.hh"
47#include "FbTk/StringUtil.hh" 47#include "FbTk/StringUtil.hh"
48#include "FbTk/Directory.hh" 48#include "FbTk/Directory.hh"
49#include "FbTk/MenuSeparator.hh"
50#include "FbTk/MenuIcon.hh"
49 51
50#include <iostream> 52#include <iostream>
51using namespace std; 53using namespace std;
@@ -212,14 +214,22 @@ static void translateMenuItem(Parser &parse,
212 menu.insert(str_label.c_str(), &screen->getWorkspacemenu()); 214 menu.insert(str_label.c_str(), &screen->getWorkspacemenu());
213 } 215 }
214 } else if (str_key == "separator") { 216 } else if (str_key == "separator") {
215 menu.insert("---"); //!! TODO: this will be better in the future 217 menu.insert(new FbTk::MenuSeparator());
216 } else { // ok, if we didn't find any special menu item we try with command parser 218 }/* else if (str_key == "icon") {
219 FbTk::RefCount<FbTk::Command> cmd(CommandParser::instance().parseLine(str_cmd));
220 FbTk::MenuItem *item = new FbTk::MenuIcon(str_label, str_cmd, screen_number);
221 item->setCommand(cmd);
222 menu.insert(item);
223
224 }*/
225 else { // ok, if we didn't find any special menu item we try with command parser
217 // we need to attach command with arguments so command parser can parse it 226 // we need to attach command with arguments so command parser can parse it
218 string line = str_key + " " + str_cmd; 227 string line = str_key + " " + str_cmd;
219 FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line)); 228 FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line));
220 if (*command != 0) 229 if (*command != 0)
221 menu.insert(str_label.c_str(), command); 230 menu.insert(str_label.c_str(), command);
222 } 231 }
232
223} 233}
224 234
225 235
@@ -402,7 +412,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
402 412
403 413
404 } else if (type == "separator") { 414 } else if (type == "separator") {
405 menu.insert("---"); 415 menu.insert(new FbTk::MenuSeparator());
406 } else 416 } else
407 return false; 417 return false;
408 418