gui/map_win.h
author ladanyi
Sat, 17 Dec 2005 20:55:41 +0000
changeset 1860 27a9a75b957b
parent 1838 b61682f0ee96
child 1882 2c3f6c7e01b4
permissions -rw-r--r--
Save and load the coordinates of the arrows on the edges.
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>
ladanyi@1442
    10
#include <libgnomecanvasmm.h>
ladanyi@1442
    11
#include <libgnomecanvasmm/polygon.h>
ladanyi@1442
    12
ladanyi@1442
    13
///This class is responsible for creating a window,
ladanyi@1442
    14
///on which the visualization attributes can be
ladanyi@1442
    15
///assigned to maps.
ladanyi@1442
    16
class MapWin : public Gtk::Window
ladanyi@1442
    17
{
hegyi@1819
    18
hegyi@1819
    19
  class MapSelector : public Gtk::HBox
hegyi@1819
    20
  {
hegyi@1819
    21
  protected:
hegyi@1837
    22
    sigc::signal<void, std::string> signal_cbt;
hegyi@1837
    23
    sigc::signal<void, bool> signal_newmapwin;
hegyi@1819
    24
hegyi@1819
    25
    int id;
hegyi@1819
    26
hegyi@1819
    27
    bool itisedge;
hegyi@1819
    28
hegyi@1819
    29
    bool default_state;
hegyi@1819
    30
hegyi@1819
    31
    bool set_new_map;
hegyi@1819
    32
hegyi@1819
    33
    Gtk::ComboBoxText cbt;
hegyi@1819
    34
hegyi@1819
    35
    Gtk::Button * newbut, * defbut;
hegyi@1819
    36
hegyi@1819
    37
    Gtk::HBox hbox;
hegyi@1819
    38
hegyi@1819
    39
    Gtk::Label * label;
hegyi@1819
    40
hegyi@1819
    41
  public:
hegyi@1819
    42
hegyi@1838
    43
    MapSelector(std::vector<std::string>, std::string, int, bool);
hegyi@1819
    44
hegyi@1837
    45
    sigc::signal<void, std::string> signal_cbt_ch();
hegyi@1837
    46
    sigc::signal<void, bool> signal_newmapwin_needed();
hegyi@1837
    47
hegyi@1837
    48
    void update_list( std::vector<std::string> );
hegyi@1819
    49
hegyi@1819
    50
    ///If a radiobutton is clicked, this function determines
hegyi@1819
    51
    ///which button was that and after that calls the
hegyi@1819
    52
    ///appropriate function of the \ref GraphDisplayerCanvas
hegyi@1819
    53
    ///to change the visible values of that attribute.
hegyi@1819
    54
    virtual void comboChanged();
hegyi@1819
    55
hegyi@1819
    56
    virtual void new_but_pressed();
hegyi@1819
    57
hegyi@1819
    58
    virtual void reset();
hegyi@1819
    59
hegyi@1819
    60
    Glib::ustring get_active_text();
hegyi@1819
    61
    void set_active_text(Glib::ustring);
hegyi@1819
    62
    void append_text(Glib::ustring);
hegyi@1819
    63
  };
hegyi@1819
    64
hegyi@1819
    65
hegyi@1819
    66
ladanyi@1442
    67
protected:
hegyi@1849
    68
  NoteBookTab & mytab;
ladanyi@1442
    69
hegyi@1512
    70
  Gtk::Table * table;
ladanyi@1442
    71
  
hegyi@1731
    72
  MapSelector ** e_combo_array, ** n_combo_array;
ladanyi@1442
    73
hegyi@1446
    74
  Gtk::Label * label;
ladanyi@1442
    75
hegyi@1512
    76
  Gtk::VBox vbox;
hegyi@1512
    77
ladanyi@1442
    78
public:
ladanyi@1442
    79
  ///Constructor of MapWin creates the widgets shown in MapWin.
hegyi@1849
    80
  MapWin(const std::string& title, std::vector<std::string>, std::vector<std::string>, NoteBookTab & mw);
ladanyi@1442
    81
hegyi@1838
    82
  ~MapWin();
hegyi@1838
    83
hegyi@1838
    84
  virtual bool on_delete_event(GdkEventAny *);
hegyi@1838
    85
hegyi@1837
    86
  void nodeMapChanged(std::string, int);
hegyi@1512
    87
hegyi@1837
    88
  void edgeMapChanged(std::string, int);
hegyi@1837
    89
hegyi@1837
    90
  void newMapWinNeeded(bool, int);
hegyi@1512
    91
hegyi@1586
    92
  ///This function inserts name of the new edgemap in the list in the combo box
hegyi@1586
    93
  void registerNewEdgeMap(std::string);
hegyi@1586
    94
hegyi@1586
    95
  ///This function inserts name of the new nodemap in the list in the combo box
hegyi@1586
    96
  void registerNewNodeMap(std::string);
hegyi@1586
    97
hegyi@1524
    98
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@1586
    99
hegyi@1837
   100
  void update(std::vector<std::string>, std::vector<std::string>);
ladanyi@1442
   101
};
ladanyi@1442
   102
ladanyi@1442
   103
#endif //MAP_WIN_H