// -*- C++ -*- // #ifndef NEWMAPWIN_H #define NEWMAPWIN_H class NewMapWin; #include #include #include #include #include ///This class is responsible for creating a window, ///on which the parameters of a new map can be set. class NewMapWin : public Gtk::Dialog { MainWin & mainwin; public: struct tree_node { char ch; tree_node * left_child; tree_node * right_child; }; ///Constructor of NewMapWin creates the widgets shown in NewMapWin. NewMapWin(const std::string& title, MainWin &, bool itisedge=true, bool edgenode=true); ///Signal on button is connected to this function, ///Therefore this function determines whether to ///call the map/creatort function, and if yes, it //tells it the attributes.(name, default value) virtual void on_response(int response_id); virtual bool closeIfEscapeIsPressed(GdkEventKey*); ///Function that creates a tree from an appropriately manipulated string tree_node * weightedString2Tree(std::string, std::vector &, int); ///Function that creates a string from a tree by postorder reading. std::string postOrder(tree_node *); std::string string2Polishform(std::string, bool); bool validVariable(std::string, bool); std::map ch2var; Gtk::Entry name, default_value; Gtk::Table * table; Gtk::Label * label; Gtk::RadioButton node, edge; }; #endif //NEWMAPWIN_H