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