alpar@174: /* -*- C++ -*- alpar@174: * alpar@174: * This file is a part of LEMON, a generic C++ optimization library alpar@174: * alpar@174: * Copyright (C) 2003-2006 alpar@174: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@174: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@174: * alpar@174: * Permission to use, modify and distribute this software is granted alpar@174: * provided that this copyright notice appears in all copies. For alpar@174: * precise terms see the accompanying LICENSE file. alpar@174: * alpar@174: * This software is provided "AS IS" with no warranty of any kind, alpar@174: * express or implied, and with no claim as to its suitability for any alpar@174: * purpose. alpar@174: * alpar@174: */ ladanyi@6: ladanyi@6: #ifndef MAP_WIN_H ladanyi@6: #define MAP_WIN_H ladanyi@6: hegyi@194: class NoteBookTab; hegyi@194: class MapSelector; hegyi@28: hegyi@94: #include ladanyi@6: #include ladanyi@6: #include ladanyi@201: #include "map_value.h" ladanyi@6: hegyi@123: ///Graph visualization setup window. hegyi@123: ladanyi@6: ///This class is responsible for creating a window, ladanyi@6: ///on which the visualization attributes can be ladanyi@6: ///assigned to maps. ladanyi@6: class MapWin : public Gtk::Window ladanyi@6: { ladanyi@6: protected: hegyi@123: ///\ref NoteBookTab to that the \ref MapWin belongs to. hegyi@96: NoteBookTab & mytab; ladanyi@6: hegyi@123: ///Designing element hegyi@28: Gtk::Table * table; ladanyi@6: hegyi@123: ///\ref MapSelectors for each property ladanyi@6: hegyi@123: ///Each property has an own \ref MapSelector through which hegyi@123: ///the map to visualize by the property van be set. hegyi@123: MapSelector ** e_combo_array; hegyi@123: hegyi@123: ///\ref MapSelectors for each property hegyi@123: hegyi@123: ///Each property has an own \ref MapSelector through which hegyi@123: ///the map to visualize by the property van be set. hegyi@123: MapSelector ** n_combo_array; hegyi@123: hegyi@123: ///Information holder hegyi@8: Gtk::Label * label; ladanyi@6: hegyi@123: ///Container in which elements are organized. hegyi@28: Gtk::VBox vbox; hegyi@28: ladanyi@6: public: hegyi@123: ///Constructor ladanyi@6: hegyi@123: ///It creates the widgets shown in \ref MapWin and hegyi@123: ///binds the needed signal to the correct place. hegyi@123: ///\param title title of window hegyi@123: ///\param mw the owner \ref NoteBookTab (\ref mytab) ladanyi@201: MapWin(const std::string& title, ladanyi@201: std::vector n_eml, ladanyi@201: std::vector s_eml, ladanyi@201: std::vector n_nml, ladanyi@201: std::vector s_nml, ladanyi@201: NoteBookTab & mw); hegyi@95: hegyi@123: ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab) hegyi@95: virtual bool on_delete_event(GdkEventAny *); hegyi@95: hegyi@123: ///Handles changement in nodemap selection hegyi@28: hegyi@123: ///If \ref MapSelector emits a signal that indicates hegyi@123: ///changement in nodemap selection this function will hegyi@123: ///be called. It calls the appropriate handler function, hegyi@123: ///\ref NoteBookTab::propertyChange with parameters describing the changement. hegyi@123: ///\param mapname the recently selected map hegyi@123: ///\param prop the changed property hegyi@123: void nodeMapChanged(std::string mapname, int prop); hegyi@94: hegyi@123: ///Handles changement in edgemap selection hegyi@28: hegyi@123: ///If \ref MapSelector emits a signal that indicates hegyi@123: ///changement in edgemap selection this function will hegyi@123: ///be called. It calls the appropriate handler function, hegyi@123: ///\ref NoteBookTab::propertyChange with parameters describing the changement. hegyi@123: ///\param mapname the recently selected map hegyi@123: ///\param prop the changed property hegyi@123: void edgeMapChanged(std::string mapname, int prop); hegyi@38: hegyi@123: ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened. hegyi@38: hegyi@123: ///This function is bound to the hegyi@123: ///signal emitted by the \ref MapSelector in case of hegyi@123: ///the user wants to create a new map. It only pass the hegyi@123: ///information further to the tab owning this \ref MapWin that is needed to open the hegyi@123: ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin) hegyi@123: ///\param itisedge should the new map will be an edgemap? (or nodemap) hegyi@123: void newMapWinNeeded(bool itisedge); hegyi@123: hegyi@123: ///This function inserts name of the new edgemap in the name list in \ref MapSelector s hegyi@123: hegyi@123: ///\param new_name hegyi@123: ///name of new map ladanyi@201: void registerNewEdgeMap(std::string new_name, MapValue::Type type); hegyi@123: hegyi@123: ///This function inserts name of the new nodemap in the name list in \ref MapSelector s hegyi@123: hegyi@123: ///\param new_name hegyi@123: ///name of new map ladanyi@201: void registerNewNodeMap(std::string new_name, MapValue::Type type); hegyi@123: hegyi@123: ///Close window if Esc key pressed. hegyi@30: virtual bool closeIfEscapeIsPressed(GdkEventKey*); hegyi@38: hegyi@123: ///Updates list of maps in all \ref MapSelector hegyi@123: hegyi@123: ///This function is called by \ref NoteBookTab, when the file hegyi@123: ///showed in it has changed, therefore the contained maps hegyi@123: ///have changed as well. \ref NoteBookTab knows, whether it hegyi@123: ///has to call this function or not from the \ref NoteBookTab::mapwinexists hegyi@123: ///variable. ladanyi@201: void update( ladanyi@201: std::vector n_eml, ladanyi@201: std::vector s_eml, ladanyi@201: std::vector n_nml, ladanyi@201: std::vector s_nml); hegyi@172: hegyi@172: void changeEntry(bool, int, std::string); hegyi@172: hegyi@172: void set_title(std::string); ladanyi@6: }; ladanyi@6: ladanyi@6: #endif //MAP_WIN_H