map_win.h
author hegyi
Mon, 02 Oct 2006 18:52:00 +0000
changeset 157 7e6ad28aeb9e
parent 121 637c12cbd64c
child 172 fc1e478697d3
permissions -rw-r--r--
View settings also for edges.
ladanyi@6
     1
// -*- C++ -*- //
ladanyi@6
     2
ladanyi@6
     3
#ifndef MAP_WIN_H
ladanyi@6
     4
#define MAP_WIN_H
ladanyi@6
     5
hegyi@28
     6
class MapWin;
hegyi@28
     7
hegyi@94
     8
#include <all_include.h>
hegyi@96
     9
#include <nbtab.h>
hegyi@112
    10
#include <mapselector.h>
ladanyi@6
    11
#include <libgnomecanvasmm.h>
ladanyi@6
    12
#include <libgnomecanvasmm/polygon.h>
ladanyi@6
    13
hegyi@123
    14
///Graph visualization setup window.
hegyi@123
    15
ladanyi@6
    16
///This class is responsible for creating a window,
ladanyi@6
    17
///on which the visualization attributes can be
ladanyi@6
    18
///assigned to maps.
ladanyi@6
    19
class MapWin : public Gtk::Window
ladanyi@6
    20
{
ladanyi@6
    21
protected:
hegyi@123
    22
  ///\ref NoteBookTab to that the \ref MapWin belongs to.
hegyi@96
    23
  NoteBookTab & mytab;
ladanyi@6
    24
hegyi@123
    25
  ///Designing element
hegyi@28
    26
  Gtk::Table * table;
ladanyi@6
    27
  
hegyi@123
    28
  ///\ref MapSelectors for each property
ladanyi@6
    29
hegyi@123
    30
  ///Each property has an own \ref MapSelector through which
hegyi@123
    31
  ///the map to visualize by the property van be set.
hegyi@123
    32
  MapSelector ** e_combo_array;
hegyi@123
    33
hegyi@123
    34
  ///\ref MapSelectors for each property
hegyi@123
    35
hegyi@123
    36
  ///Each property has an own \ref MapSelector through which
hegyi@123
    37
  ///the map to visualize by the property van be set.
hegyi@123
    38
  MapSelector ** n_combo_array;
hegyi@123
    39
hegyi@123
    40
  ///Information holder
hegyi@8
    41
  Gtk::Label * label;
ladanyi@6
    42
hegyi@123
    43
  ///Container in which elements are organized.
hegyi@28
    44
  Gtk::VBox vbox;
hegyi@28
    45
ladanyi@6
    46
public:
hegyi@123
    47
  ///Constructor
ladanyi@6
    48
hegyi@123
    49
  ///It creates the widgets shown in \ref MapWin and
hegyi@123
    50
  ///binds the needed signal to the correct place.
hegyi@123
    51
  ///\param title title of window
hegyi@123
    52
  ///\param eml edgemap list
hegyi@123
    53
  ///\param nml nodemap list
hegyi@123
    54
  ///\param mw the owner \ref NoteBookTab (\ref mytab)
hegyi@123
    55
  MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw);
hegyi@95
    56
hegyi@123
    57
  ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab)
hegyi@95
    58
  virtual bool on_delete_event(GdkEventAny *);
hegyi@95
    59
hegyi@123
    60
  ///Handles changement in nodemap selection
hegyi@28
    61
hegyi@123
    62
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    63
  ///changement in nodemap selection this function will
hegyi@123
    64
  ///be called. It calls the appropriate handler function,
hegyi@123
    65
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    66
  ///\param mapname the recently selected map
hegyi@123
    67
  ///\param prop the changed property
hegyi@123
    68
  void nodeMapChanged(std::string mapname, int prop);
hegyi@94
    69
hegyi@123
    70
  ///Handles changement in edgemap selection
hegyi@28
    71
hegyi@123
    72
  ///If \ref MapSelector emits a signal that indicates
hegyi@123
    73
  ///changement in edgemap selection this function will
hegyi@123
    74
  ///be called. It calls the appropriate handler function,
hegyi@123
    75
  ///\ref NoteBookTab::propertyChange with parameters describing the changement.
hegyi@123
    76
  ///\param mapname the recently selected map
hegyi@123
    77
  ///\param prop the changed property
hegyi@123
    78
  void edgeMapChanged(std::string mapname, int prop);
hegyi@38
    79
hegyi@123
    80
  ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened.
hegyi@38
    81
hegyi@123
    82
  ///This function is bound to the
hegyi@123
    83
  ///signal emitted by the \ref MapSelector in case of
hegyi@123
    84
  ///the user wants to create a new map. It only pass the
hegyi@123
    85
  ///information further to the tab owning this \ref MapWin that is needed to open the
hegyi@123
    86
  ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin)
hegyi@123
    87
  ///\param itisedge should the new map will be an edgemap? (or nodemap)
hegyi@123
    88
  void newMapWinNeeded(bool itisedge);
hegyi@123
    89
hegyi@123
    90
  ///This function inserts name of the new edgemap in the name list in \ref MapSelector s
hegyi@123
    91
hegyi@123
    92
  ///\param new_name
hegyi@123
    93
  ///name of new map
hegyi@123
    94
  void registerNewEdgeMap(std::string new_name);
hegyi@123
    95
hegyi@123
    96
  ///This function inserts name of the new nodemap in the name list in \ref MapSelector s
hegyi@123
    97
hegyi@123
    98
  ///\param new_name
hegyi@123
    99
  ///name of new map
hegyi@123
   100
  void registerNewNodeMap(std::string new_name);
hegyi@123
   101
hegyi@123
   102
  ///Close window if Esc key pressed.
hegyi@30
   103
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@38
   104
hegyi@123
   105
  ///Updates list of maps in all \ref MapSelector
hegyi@123
   106
hegyi@123
   107
  ///This function is called by \ref NoteBookTab, when the file
hegyi@123
   108
  ///showed in it has changed, therefore the contained maps
hegyi@123
   109
  ///have changed as well. \ref NoteBookTab knows, whether it
hegyi@123
   110
  ///has to call this function or not from the \ref NoteBookTab::mapwinexists
hegyi@123
   111
  ///variable.
hegyi@123
   112
  ///\param eml edge map list
hegyi@123
   113
  ///\param nml node map list
hegyi@123
   114
  void update(std::vector<std::string> eml, std::vector<std::string> nml);
ladanyi@6
   115
};
ladanyi@6
   116
ladanyi@6
   117
#endif //MAP_WIN_H