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