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