gui/new_map_win.h
author deba
Sat, 03 Dec 2005 18:15:43 +0000
changeset 1844 eaa5f5b855f7
parent 1823 cb082cdf3667
child 1849 a4d1362397fe
permissions -rw-r--r--
Changed implementation and bug fix
hegyi@1593
     1
// -*- C++ -*- //
hegyi@1593
     2
hegyi@1593
     3
#ifndef NEWMAPWIN_H
hegyi@1593
     4
#define NEWMAPWIN_H
hegyi@1593
     5
hegyi@1593
     6
class NewMapWin;
hegyi@1593
     7
hegyi@1593
     8
#include <all_include.h>
hegyi@1837
     9
#include <main_win.h>
hegyi@1593
    10
#include <libgnomecanvasmm.h>
hegyi@1593
    11
#include <libgnomecanvasmm/polygon.h>
hegyi@1814
    12
#include <stack>
hegyi@1593
    13
hegyi@1593
    14
///This class is responsible for creating a window,
hegyi@1593
    15
///on which the parameters of a new map can be set.
hegyi@1593
    16
hegyi@1823
    17
class NewMapWin : public Gtk::Dialog
hegyi@1593
    18
{
hegyi@1837
    19
  MainWin & mainwin;
hegyi@1593
    20
hegyi@1814
    21
public:
hegyi@1814
    22
  struct tree_node
hegyi@1814
    23
  {
hegyi@1814
    24
    char ch;
hegyi@1814
    25
    tree_node * left_child;
hegyi@1814
    26
    tree_node * right_child;
hegyi@1814
    27
  };
hegyi@1814
    28
  
hegyi@1593
    29
  ///Constructor of NewMapWin creates the widgets shown in NewMapWin.
hegyi@1837
    30
  NewMapWin(const std::string& title, MainWin &, bool itisedge=true, bool edgenode=true);
hegyi@1814
    31
  
hegyi@1593
    32
  ///Signal on button is connected to this function,
hegyi@1593
    33
  ///Therefore this function determines whether to
hegyi@1593
    34
  ///call the map/creatort function, and if yes, it
hegyi@1593
    35
  //tells it the attributes.(name, default value)
hegyi@1823
    36
  virtual void on_response(int response_id);
hegyi@1737
    37
hegyi@1593
    38
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@1593
    39
hegyi@1814
    40
  ///Function that creates a tree from an appropriately manipulated string
hegyi@1814
    41
  tree_node * weightedString2Tree(std::string, std::vector<unsigned int> &, int);
hegyi@1814
    42
hegyi@1814
    43
  ///Function  that creates a string from a tree by postorder reading.
hegyi@1814
    44
  std::string postOrder(tree_node *);
hegyi@1814
    45
hegyi@1814
    46
  std::string string2Polishform(std::string, bool);
hegyi@1814
    47
hegyi@1814
    48
  bool validVariable(std::string, bool);
hegyi@1814
    49
hegyi@1814
    50
  std::map<char, std::string> ch2var;
hegyi@1814
    51
hegyi@1593
    52
  Gtk::Entry name, default_value;
hegyi@1593
    53
hegyi@1593
    54
  Gtk::Table * table;
hegyi@1593
    55
  Gtk::Label * label;
hegyi@1593
    56
hegyi@1593
    57
  Gtk::RadioButton node, edge;
hegyi@1593
    58
};
hegyi@1593
    59
hegyi@1593
    60
#endif //NEWMAPWIN_H