new_map_win.h
author hegyi
Tue, 06 Dec 2005 10:53:38 +0000
branchgui
changeset 96 e664d8aa3f72
parent 94 adfdc2f70548
child 117 004b239908e6
permissions -rw-r--r--
Notebook style is provided. Without opportunity to close tabs. :-) But with all other necessary things (I think).
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@96
     9
#include <nbtab.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@90
    17
class NewMapWin : public Gtk::Dialog
hegyi@42
    18
{
hegyi@96
    19
  NoteBookTab & mytab;
hegyi@42
    20
hegyi@88
    21
public:
hegyi@88
    22
  struct tree_node
hegyi@88
    23
  {
hegyi@88
    24
    char ch;
hegyi@88
    25
    tree_node * left_child;
hegyi@88
    26
    tree_node * right_child;
hegyi@88
    27
  };
hegyi@88
    28
  
hegyi@42
    29
  ///Constructor of NewMapWin creates the widgets shown in NewMapWin.
hegyi@96
    30
  NewMapWin(const std::string& title, NoteBookTab &, bool itisedge=true, bool edgenode=true);
hegyi@88
    31
  
hegyi@42
    32
  ///Signal on button is connected to this function,
hegyi@42
    33
  ///Therefore this function determines whether to
hegyi@42
    34
  ///call the map/creatort function, and if yes, it
hegyi@42
    35
  //tells it the attributes.(name, default value)
hegyi@90
    36
  virtual void on_response(int response_id);
hegyi@85
    37
hegyi@42
    38
  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
hegyi@42
    39
hegyi@88
    40
  ///Function that creates a tree from an appropriately manipulated string
hegyi@88
    41
  tree_node * weightedString2Tree(std::string, std::vector<unsigned int> &, int);
hegyi@88
    42
hegyi@88
    43
  ///Function  that creates a string from a tree by postorder reading.
hegyi@88
    44
  std::string postOrder(tree_node *);
hegyi@88
    45
hegyi@88
    46
  std::string string2Polishform(std::string, bool);
hegyi@88
    47
hegyi@88
    48
  bool validVariable(std::string, bool);
hegyi@88
    49
hegyi@88
    50
  std::map<char, std::string> ch2var;
hegyi@88
    51
hegyi@42
    52
  Gtk::Entry name, default_value;
hegyi@42
    53
hegyi@42
    54
  Gtk::Table * table;
hegyi@42
    55
  Gtk::Label * label;
hegyi@42
    56
hegyi@42
    57
  Gtk::RadioButton node, edge;
hegyi@42
    58
};
hegyi@42
    59
hegyi@42
    60
#endif //NEWMAPWIN_H