ladanyi@1442: // -*- C++ -*- // ladanyi@1442: ladanyi@1442: #ifndef MAP_WIN_H ladanyi@1442: #define MAP_WIN_H ladanyi@1442: hegyi@1512: class MapWin; hegyi@1512: hegyi@1837: #include hegyi@1849: #include hegyi@1882: #include ladanyi@1442: #include ladanyi@1442: #include ladanyi@1442: hegyi@1893: ///Graph visualization setup window. hegyi@1893: ladanyi@1442: ///This class is responsible for creating a window, ladanyi@1442: ///on which the visualization attributes can be ladanyi@1442: ///assigned to maps. ladanyi@1442: class MapWin : public Gtk::Window ladanyi@1442: { ladanyi@1442: protected: hegyi@1893: ///\ref NoteBookTab to that the \ref MapWin belongs to. hegyi@1849: NoteBookTab & mytab; ladanyi@1442: hegyi@1893: ///Designing element hegyi@1512: Gtk::Table * table; ladanyi@1442: hegyi@1893: ///\ref MapSelectors for each property ladanyi@1442: hegyi@1893: ///Each property has an own \ref MapSelector through which hegyi@1893: ///the map to visualize by the property van be set. hegyi@1893: MapSelector ** e_combo_array; hegyi@1893: hegyi@1893: ///\ref MapSelectors for each property hegyi@1893: hegyi@1893: ///Each property has an own \ref MapSelector through which hegyi@1893: ///the map to visualize by the property van be set. hegyi@1893: MapSelector ** n_combo_array; hegyi@1893: hegyi@1893: ///Information holder hegyi@1446: Gtk::Label * label; ladanyi@1442: hegyi@1893: ///Container in which elements are organized. hegyi@1512: Gtk::VBox vbox; hegyi@1512: ladanyi@1442: public: hegyi@1893: ///Constructor ladanyi@1442: hegyi@1893: ///It creates the widgets shown in \ref MapWin and hegyi@1893: ///binds the needed signal to the correct place. hegyi@1893: ///\param title title of window hegyi@1893: ///\param eml edgemap list hegyi@1893: ///\param nml nodemap list hegyi@1893: ///\param mw the owner \ref NoteBookTab (\ref mytab) hegyi@1893: MapWin(const std::string& title, std::vector eml, std::vector nml, NoteBookTab & mw); hegyi@1838: hegyi@1893: ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab) hegyi@1838: virtual bool on_delete_event(GdkEventAny *); hegyi@1838: hegyi@1893: ///Handles changement in nodemap selection hegyi@1512: hegyi@1893: ///If \ref MapSelector emits a signal that indicates hegyi@1893: ///changement in nodemap selection this function will hegyi@1893: ///be called. It calls the appropriate handler function, hegyi@1893: ///\ref NoteBookTab::propertyChange with parameters describing the changement. hegyi@1893: ///\param mapname the recently selected map hegyi@1893: ///\param prop the changed property hegyi@1893: void nodeMapChanged(std::string mapname, int prop); hegyi@1837: hegyi@1893: ///Handles changement in edgemap selection hegyi@1512: hegyi@1893: ///If \ref MapSelector emits a signal that indicates hegyi@1893: ///changement in edgemap selection this function will hegyi@1893: ///be called. It calls the appropriate handler function, hegyi@1893: ///\ref NoteBookTab::propertyChange with parameters describing the changement. hegyi@1893: ///\param mapname the recently selected map hegyi@1893: ///\param prop the changed property hegyi@1893: void edgeMapChanged(std::string mapname, int prop); hegyi@1586: hegyi@1893: ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened. hegyi@1586: hegyi@1893: ///This function is bound to the hegyi@1893: ///signal emitted by the \ref MapSelector in case of hegyi@1893: ///the user wants to create a new map. It only pass the hegyi@1893: ///information further to the tab owning this \ref MapWin that is needed to open the hegyi@1893: ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin) hegyi@1893: ///\param itisedge should the new map will be an edgemap? (or nodemap) hegyi@1893: void newMapWinNeeded(bool itisedge); hegyi@1893: hegyi@1893: ///This function inserts name of the new edgemap in the name list in \ref MapSelector s hegyi@1893: hegyi@1893: ///\param new_name hegyi@1893: ///name of new map hegyi@1893: void registerNewEdgeMap(std::string new_name); hegyi@1893: hegyi@1893: ///This function inserts name of the new nodemap in the name list in \ref MapSelector s hegyi@1893: hegyi@1893: ///\param new_name hegyi@1893: ///name of new map hegyi@1893: void registerNewNodeMap(std::string new_name); hegyi@1893: hegyi@1893: ///Close window if Esc key pressed. hegyi@1524: virtual bool closeIfEscapeIsPressed(GdkEventKey*); hegyi@1586: hegyi@1893: ///Updates list of maps in all \ref MapSelector hegyi@1893: hegyi@1893: ///This function is called by \ref NoteBookTab, when the file hegyi@1893: ///showed in it has changed, therefore the contained maps hegyi@1893: ///have changed as well. \ref NoteBookTab knows, whether it hegyi@1893: ///has to call this function or not from the \ref NoteBookTab::mapwinexists hegyi@1893: ///variable. hegyi@1893: ///\param eml edge map list hegyi@1893: ///\param nml node map list hegyi@1893: void update(std::vector eml, std::vector nml); ladanyi@1442: }; ladanyi@1442: ladanyi@1442: #endif //MAP_WIN_H