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