map_win.h
author hegyi
Tue, 29 Nov 2005 19:31:58 +0000
branchgui
changeset 94 adfdc2f70548
parent 90 e9f8f44f12a3
child 95 628c0b383d2f
permissions -rw-r--r--
Structure of GUI is now more clear-cut than before.
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@94
     9
#include <main_win.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@94
    43
    MapSelector(std::vector<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@94
    68
  MainWin & mainwin;
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@94
    80
  MapWin(const std::string& title, std::vector<std::string>, std::vector<std::string>, MainWin & mw);
ladanyi@6
    81
hegyi@94
    82
  void nodeMapChanged(std::string, int);
hegyi@28
    83
hegyi@94
    84
  void edgeMapChanged(std::string, int);
hegyi@94
    85
hegyi@94
    86
  void newMapWinNeeded(bool, int);
hegyi@28
    87
hegyi@38
    88
  ///This function inserts name of the new edgemap in the list in the combo box
hegyi@38
    89
  void registerNewEdgeMap(std::string);
hegyi@38
    90
hegyi@38
    91
  ///This function inserts name of the new nodemap in the list in the combo box
hegyi@38
    92
  void registerNewNodeMap(std::string);
hegyi@38
    93
hegyi@30
    94
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@38
    95
hegyi@94
    96
  void update(std::vector<std::string>, std::vector<std::string>);
ladanyi@6
    97
};
ladanyi@6
    98
ladanyi@6
    99
#endif //MAP_WIN_H