map_win.h
author hegyi
Tue, 20 Feb 2007 15:08:30 +0000
branchfastopen
changeset 204 8fec6a6472fe
parent 172 fc1e478697d3
child 194 6b2b718420eb
permissions -rw-r--r--
The much faster way.
     1 /* -*- C++ -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library
     4  *
     5  * Copyright (C) 2003-2006
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #ifndef MAP_WIN_H
    20 #define MAP_WIN_H
    21 
    22 class MapWin;
    23 
    24 #include <all_include.h>
    25 #include <nbtab.h>
    26 #include <mapselector.h>
    27 #include <libgnomecanvasmm.h>
    28 #include <libgnomecanvasmm/polygon.h>
    29 
    30 ///Graph visualization setup window.
    31 
    32 ///This class is responsible for creating a window,
    33 ///on which the visualization attributes can be
    34 ///assigned to maps.
    35 class MapWin : public Gtk::Window
    36 {
    37 protected:
    38   ///\ref NoteBookTab to that the \ref MapWin belongs to.
    39   NoteBookTab & mytab;
    40 
    41   ///Designing element
    42   Gtk::Table * table;
    43   
    44   ///\ref MapSelectors for each property
    45 
    46   ///Each property has an own \ref MapSelector through which
    47   ///the map to visualize by the property van be set.
    48   MapSelector ** e_combo_array;
    49 
    50   ///\ref MapSelectors for each property
    51 
    52   ///Each property has an own \ref MapSelector through which
    53   ///the map to visualize by the property van be set.
    54   MapSelector ** n_combo_array;
    55 
    56   ///Information holder
    57   Gtk::Label * label;
    58 
    59   ///Container in which elements are organized.
    60   Gtk::VBox vbox;
    61 
    62 public:
    63   ///Constructor
    64 
    65   ///It creates the widgets shown in \ref MapWin and
    66   ///binds the needed signal to the correct place.
    67   ///\param title title of window
    68   ///\param eml edgemap list
    69   ///\param nml nodemap list
    70   ///\param mw the owner \ref NoteBookTab (\ref mytab)
    71   MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw);
    72 
    73   ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
    74   virtual bool on_delete_event(GdkEventAny *);
    75 
    76   ///Handles changement in nodemap selection
    77 
    78   ///If \ref MapSelector emits a signal that indicates
    79   ///changement in nodemap selection this function will
    80   ///be called. It calls the appropriate handler function,
    81   ///\ref NoteBookTab::propertyChange with parameters describing the changement.
    82   ///\param mapname the recently selected map
    83   ///\param prop the changed property
    84   void nodeMapChanged(std::string mapname, int prop);
    85 
    86   ///Handles changement in edgemap selection
    87 
    88   ///If \ref MapSelector emits a signal that indicates
    89   ///changement in edgemap selection this function will
    90   ///be called. It calls the appropriate handler function,
    91   ///\ref NoteBookTab::propertyChange with parameters describing the changement.
    92   ///\param mapname the recently selected map
    93   ///\param prop the changed property
    94   void edgeMapChanged(std::string mapname, int prop);
    95 
    96   ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
    97 
    98   ///This function is bound to the
    99   ///signal emitted by the \ref MapSelector in case of
   100   ///the user wants to create a new map. It only pass the
   101   ///information further to the tab owning this \ref MapWin that is needed to open the
   102   ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
   103   ///\param itisedge should the new map will be an edgemap? (or nodemap)
   104   void newMapWinNeeded(bool itisedge);
   105 
   106   ///This function inserts name of the new edgemap in the name list in \ref MapSelector s
   107 
   108   ///\param new_name
   109   ///name of new map
   110   void registerNewEdgeMap(std::string new_name);
   111 
   112   ///This function inserts name of the new nodemap in the name list in \ref MapSelector s
   113 
   114   ///\param new_name
   115   ///name of new map
   116   void registerNewNodeMap(std::string new_name);
   117 
   118   ///Close window if Esc key pressed.
   119   virtual bool closeIfEscapeIsPressed(GdkEventKey*);
   120 
   121   ///Updates list of maps in all \ref MapSelector
   122 
   123   ///This function is called by \ref NoteBookTab, when the file
   124   ///showed in it has changed, therefore the contained maps
   125   ///have changed as well. \ref NoteBookTab knows, whether it
   126   ///has to call this function or not from the \ref NoteBookTab::mapwinexists
   127   ///variable.
   128   ///\param eml edge map list
   129   ///\param nml node map list
   130   void update(std::vector<std::string> eml, std::vector<std::string> nml);
   131 
   132   void changeEntry(bool, int, std::string);
   133 
   134   void set_title(std::string);
   135 };
   136 
   137 #endif //MAP_WIN_H