map_win.h
changeset 1 67188bd752db
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/map_win.h	Mon Jul 07 08:10:39 2008 -0500
     1.3 @@ -0,0 +1,142 @@
     1.4 +/* -*- C++ -*-
     1.5 + *
     1.6 + * This file is a part of LEMON, a generic C++ optimization library
     1.7 + *
     1.8 + * Copyright (C) 2003-2006
     1.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11 + *
    1.12 + * Permission to use, modify and distribute this software is granted
    1.13 + * provided that this copyright notice appears in all copies. For
    1.14 + * precise terms see the accompanying LICENSE file.
    1.15 + *
    1.16 + * This software is provided "AS IS" with no warranty of any kind,
    1.17 + * express or implied, and with no claim as to its suitability for any
    1.18 + * purpose.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +#ifndef MAP_WIN_H
    1.23 +#define MAP_WIN_H
    1.24 +
    1.25 +class NoteBookTab;
    1.26 +class MapSelector;
    1.27 +
    1.28 +#include <all_include.h>
    1.29 +#include <libgnomecanvasmm.h>
    1.30 +#include <libgnomecanvasmm/polygon.h>
    1.31 +#include "map_value.h"
    1.32 +
    1.33 +///Digraph visualization setup window.
    1.34 +
    1.35 +///This class is responsible for creating a window,
    1.36 +///on which the visualization attributes can be
    1.37 +///assigned to maps.
    1.38 +class MapWin : public Gtk::Window
    1.39 +{
    1.40 +protected:
    1.41 +  ///\ref NoteBookTab to that the \ref MapWin belongs to.
    1.42 +  NoteBookTab & mytab;
    1.43 +
    1.44 +  ///Designing element
    1.45 +  Gtk::Table * table;
    1.46 +  
    1.47 +  ///\ref MapSelectors for each property
    1.48 +
    1.49 +  ///Each property has an own \ref MapSelector through which
    1.50 +  ///the map to visualize by the property van be set.
    1.51 +  MapSelector ** e_combo_array;
    1.52 +
    1.53 +  ///\ref MapSelectors for each property
    1.54 +
    1.55 +  ///Each property has an own \ref MapSelector through which
    1.56 +  ///the map to visualize by the property van be set.
    1.57 +  MapSelector ** n_combo_array;
    1.58 +
    1.59 +  ///Information holder
    1.60 +  Gtk::Label * label;
    1.61 +
    1.62 +  ///Container in which elements are organized.
    1.63 +  Gtk::VBox vbox;
    1.64 +
    1.65 +public:
    1.66 +  ///Constructor
    1.67 +
    1.68 +  ///It creates the widgets shown in \ref MapWin and
    1.69 +  ///binds the needed signal to the correct place.
    1.70 +  ///\param title title of window
    1.71 +  ///\param mw the owner \ref NoteBookTab (\ref mytab)
    1.72 +  MapWin(const std::string& title, 
    1.73 +      std::vector<std::string> n_eml,
    1.74 +      std::vector<std::string> s_eml,
    1.75 +      std::vector<std::string> n_nml,
    1.76 +      std::vector<std::string> s_nml,
    1.77 +      NoteBookTab & mw);
    1.78 +
    1.79 +  ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
    1.80 +  virtual bool on_delete_event(GdkEventAny *);
    1.81 +
    1.82 +  ///Handles changement in nodemap selection
    1.83 +
    1.84 +  ///If \ref MapSelector emits a signal that indicates
    1.85 +  ///changement in nodemap selection this function will
    1.86 +  ///be called. It calls the appropriate handler function,
    1.87 +  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
    1.88 +  ///\param mapname the recently selected map
    1.89 +  ///\param prop the changed property
    1.90 +  void nodeMapChanged(std::string mapname, int prop);
    1.91 +
    1.92 +  ///Handles changement in arcmap selection
    1.93 +
    1.94 +  ///If \ref MapSelector emits a signal that indicates
    1.95 +  ///changement in arcmap selection this function will
    1.96 +  ///be called. It calls the appropriate handler function,
    1.97 +  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
    1.98 +  ///\param mapname the recently selected map
    1.99 +  ///\param prop the changed property
   1.100 +  void arcMapChanged(std::string mapname, int prop);
   1.101 +
   1.102 +  ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
   1.103 +
   1.104 +  ///This function is bound to the
   1.105 +  ///signal emitted by the \ref MapSelector in case of
   1.106 +  ///the user wants to create a new map. It only pass the
   1.107 +  ///information further to the tab owning this \ref MapWin that is needed to open the
   1.108 +  ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
   1.109 +  ///\param itisarc should the new map will be an arcmap? (or nodemap)
   1.110 +  void newMapWinNeeded(bool itisarc);
   1.111 +
   1.112 +  ///This function inserts name of the new arcmap in the name list in \ref MapSelector s
   1.113 +
   1.114 +  ///\param new_name
   1.115 +  ///name of new map
   1.116 +  void registerNewArcMap(std::string new_name, MapValue::Type type);
   1.117 +
   1.118 +  ///This function inserts name of the new nodemap in the name list in \ref MapSelector s
   1.119 +
   1.120 +  ///\param new_name
   1.121 +  ///name of new map
   1.122 +  void registerNewNodeMap(std::string new_name, MapValue::Type type);
   1.123 +
   1.124 +  ///Close window if Esc key pressed.
   1.125 +  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
   1.126 +
   1.127 +  ///Updates list of maps in all \ref MapSelector
   1.128 +
   1.129 +  ///This function is called by \ref NoteBookTab, when the file
   1.130 +  ///showed in it has changed, therefore the contained maps
   1.131 +  ///have changed as well. \ref NoteBookTab knows, whether it
   1.132 +  ///has to call this function or not from the \ref NoteBookTab::mapwinexists
   1.133 +  ///variable.
   1.134 +  void update(
   1.135 +    std::vector<std::string> n_eml,
   1.136 +    std::vector<std::string> s_eml,
   1.137 +    std::vector<std::string> n_nml,
   1.138 +    std::vector<std::string> s_nml);
   1.139 +
   1.140 +  void changeEntry(bool, int, std::string);
   1.141 +
   1.142 +  void set_title(std::string);
   1.143 +};
   1.144 +
   1.145 +#endif //MAP_WIN_H