hegyi@42: // -*- C++ -*- // hegyi@42: hegyi@42: #ifndef NEWMAPWIN_H hegyi@42: #define NEWMAPWIN_H hegyi@42: hegyi@42: class NewMapWin; hegyi@42: hegyi@42: #include hegyi@42: #include hegyi@42: #include hegyi@42: #include hegyi@88: #include hegyi@42: hegyi@42: ///This class is responsible for creating a window, hegyi@42: ///on which the parameters of a new map can be set. hegyi@42: hegyi@42: class NewMapWin : public Gtk::Window hegyi@42: { hegyi@42: ///The \ref GraphDisplayerCanvas on which the graph will be drawn. hegyi@42: ///It has to be known for this class, because hegyi@42: ///when a map is created hegyi@42: ///a function of the \ref GraphDisplayerCanvas will be called. hegyi@42: GraphDisplayerCanvas & gdc; hegyi@42: hegyi@88: public: hegyi@88: struct tree_node hegyi@88: { hegyi@88: char ch; hegyi@88: tree_node * left_child; hegyi@88: tree_node * right_child; hegyi@88: }; hegyi@88: hegyi@42: ///Constructor of NewMapWin creates the widgets shown in NewMapWin. hegyi@42: NewMapWin(const std::string& title, GraphDisplayerCanvas &); hegyi@42: hegyi@88: hegyi@42: ///Signal on button is connected to this function, hegyi@42: ///Therefore this function determines whether to hegyi@42: ///call the map/creatort function, and if yes, it hegyi@42: //tells it the attributes.(name, default value) hegyi@42: virtual void buttonPressed(); hegyi@88: hegyi@85: virtual void showByPreChoose(bool); hegyi@85: hegyi@42: virtual bool closeIfEscapeIsPressed(GdkEventKey*); hegyi@42: hegyi@88: ///Function that creates a tree from an appropriately manipulated string hegyi@88: tree_node * weightedString2Tree(std::string, std::vector &, int); hegyi@88: hegyi@88: ///Function that creates a string from a tree by postorder reading. hegyi@88: std::string postOrder(tree_node *); hegyi@88: hegyi@88: std::string string2Polishform(std::string, bool); hegyi@88: hegyi@88: bool validVariable(std::string, bool); hegyi@88: hegyi@88: std::map ch2var; hegyi@88: hegyi@42: Gtk::Entry name, default_value; hegyi@42: hegyi@42: Gtk::VBox vbox; hegyi@42: hegyi@42: Gtk::Button * button; hegyi@42: hegyi@42: Gtk::Table * table; hegyi@42: Gtk::Label * label; hegyi@42: hegyi@42: Gtk::RadioButton node, edge; hegyi@42: }; hegyi@42: hegyi@42: #endif //NEWMAPWIN_H