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 <all_include.h>
hegyi@1849: #include <nbtab.h>
hegyi@1593: #include <libgnomecanvasmm.h>
hegyi@1593: #include <libgnomecanvasmm/polygon.h>
hegyi@1814: #include <stack>
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@1849:   NoteBookTab & mytab;
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@1849:   NewMapWin(const std::string& title, NoteBookTab &, 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<unsigned int> &, 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<char, std::string> 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