new_map_win.h
author hegyi
Mon, 21 Nov 2005 12:07:05 +0000
branchgui
changeset 89 4042761b21e3
parent 85 0b2217328320
child 90 e9f8f44f12a3
permissions -rw-r--r--
Reorganizing.
hegyi@42
     1
// -*- C++ -*- //
hegyi@42
     2
hegyi@42
     3
#ifndef NEWMAPWIN_H
hegyi@42
     4
#define NEWMAPWIN_H
hegyi@42
     5
hegyi@42
     6
class NewMapWin;
hegyi@42
     7
hegyi@42
     8
#include <all_include.h>
hegyi@42
     9
#include <graph_displayer_canvas.h>
hegyi@42
    10
#include <libgnomecanvasmm.h>
hegyi@42
    11
#include <libgnomecanvasmm/polygon.h>
hegyi@88
    12
#include <stack>
hegyi@42
    13
hegyi@42
    14
///This class is responsible for creating a window,
hegyi@42
    15
///on which the parameters of a new map can be set.
hegyi@42
    16
hegyi@42
    17
class NewMapWin : public Gtk::Window
hegyi@42
    18
{
hegyi@42
    19
  ///The \ref GraphDisplayerCanvas on which the graph will be drawn.
hegyi@42
    20
  ///It has to be known for this class, because
hegyi@42
    21
  ///when a map is created
hegyi@42
    22
  ///a function of the \ref GraphDisplayerCanvas will be called.
hegyi@42
    23
  GraphDisplayerCanvas & gdc;
hegyi@42
    24
hegyi@88
    25
public:
hegyi@88
    26
  struct tree_node
hegyi@88
    27
  {
hegyi@88
    28
    char ch;
hegyi@88
    29
    tree_node * left_child;
hegyi@88
    30
    tree_node * right_child;
hegyi@88
    31
  };
hegyi@88
    32
  
hegyi@42
    33
  ///Constructor of NewMapWin creates the widgets shown in NewMapWin.
hegyi@42
    34
  NewMapWin(const std::string& title, GraphDisplayerCanvas &);
hegyi@42
    35
hegyi@88
    36
  
hegyi@42
    37
  ///Signal on button is connected to this function,
hegyi@42
    38
  ///Therefore this function determines whether to
hegyi@42
    39
  ///call the map/creatort function, and if yes, it
hegyi@42
    40
  //tells it the attributes.(name, default value)
hegyi@42
    41
  virtual void buttonPressed();
hegyi@88
    42
  
hegyi@85
    43
  virtual void showByPreChoose(bool);
hegyi@85
    44
hegyi@42
    45
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@42
    46
hegyi@88
    47
  ///Function that creates a tree from an appropriately manipulated string
hegyi@88
    48
  tree_node * weightedString2Tree(std::string, std::vector<unsigned int> &, int);
hegyi@88
    49
hegyi@88
    50
  ///Function  that creates a string from a tree by postorder reading.
hegyi@88
    51
  std::string postOrder(tree_node *);
hegyi@88
    52
hegyi@88
    53
  std::string string2Polishform(std::string, bool);
hegyi@88
    54
hegyi@88
    55
  bool validVariable(std::string, bool);
hegyi@88
    56
hegyi@88
    57
  std::map<char, std::string> ch2var;
hegyi@88
    58
hegyi@42
    59
  Gtk::Entry name, default_value;
hegyi@42
    60
hegyi@42
    61
  Gtk::VBox vbox;
hegyi@42
    62
hegyi@42
    63
  Gtk::Button * button;
hegyi@42
    64
hegyi@42
    65
  Gtk::Table * table;
hegyi@42
    66
  Gtk::Label * label;
hegyi@42
    67
hegyi@42
    68
  Gtk::RadioButton node, edge;
hegyi@42
    69
};
hegyi@42
    70
hegyi@42
    71
#endif //NEWMAPWIN_H