There is no need for these furthermore.
1.1 --- a/edit_win.cc Thu Jul 28 15:54:00 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,94 +0,0 @@
1.4 -#include <edit_win.h>
1.5 -#include <set>
1.6 -
1.7 -bool EditWin::closeIfEscapeIsPressed(GdkEventKey* e)
1.8 -{
1.9 - if(e->keyval==GDK_Escape)
1.10 - {
1.11 - hide();
1.12 - }
1.13 - return true;
1.14 -}
1.15 -
1.16 -EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true)
1.17 -{
1.18 - set_title(title);
1.19 - set_default_size(200, 50);
1.20 - set_keep_above(true);
1.21 - signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::closeIfEscapeIsPressed));
1.22 -
1.23 - //buttons array
1.24 - buttons=new Gtk::RadioButton * [TOOL_NUM];
1.25 - for(int i=0;i<TOOL_NUM;i++)
1.26 - {
1.27 - buttons[i]=NULL;
1.28 - }
1.29 -
1.30 - Gtk::RadioButton::Group group;//=buttons[MOVE]->get_group();
1.31 -
1.32 - //New node button
1.33 - buttons[CREATE_NODE]=new Gtk::RadioButton("New Node");
1.34 - buttons[CREATE_NODE]->set_mode(false);
1.35 - buttons[CREATE_NODE]->set_group(group);
1.36 - buttons[CREATE_NODE]->signal_clicked().connect
1.37 - (
1.38 - sigc::bind
1.39 - (
1.40 - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.41 - 1
1.42 - )
1.43 - );
1.44 - table.attach(*buttons[CREATE_NODE],0,1,0,1);
1.45 -
1.46 - //New edge button
1.47 - buttons[CREATE_EDGE]=new Gtk::RadioButton("New Edge");
1.48 - buttons[CREATE_EDGE]->set_mode(false);
1.49 - buttons[CREATE_EDGE]->set_group(group);
1.50 - buttons[CREATE_EDGE]->signal_clicked().connect
1.51 - (
1.52 - sigc::bind
1.53 - (
1.54 - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.55 - 2
1.56 - )
1.57 - );
1.58 - table.attach(*buttons[CREATE_EDGE],1,2,0,1);
1.59 -
1.60 - //Move button
1.61 - buttons[MOVE]=new Gtk::RadioButton("Move");
1.62 - buttons[MOVE]->set_mode(false);
1.63 - buttons[MOVE]->set_group(group);
1.64 - buttons[MOVE]->signal_clicked().connect
1.65 - (
1.66 - sigc::bind
1.67 - (
1.68 - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.69 - 0
1.70 - )
1.71 - );
1.72 - table.attach(*buttons[MOVE],0,1,1,2);
1.73 -
1.74 - //New edge button
1.75 - buttons[ERASER]=new Gtk::RadioButton("Erase Item");
1.76 - buttons[ERASER]->set_mode(false);
1.77 - buttons[ERASER]->set_group(group);
1.78 - buttons[ERASER]->signal_clicked().connect
1.79 - (
1.80 - sigc::bind
1.81 - (
1.82 - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.83 - 3
1.84 - )
1.85 - );
1.86 - table.attach(*buttons[ERASER],1,2,1,2);
1.87 -
1.88 - add(table);
1.89 -
1.90 - show_all_children();
1.91 -
1.92 -}
1.93 -
1.94 -void EditWin::makeEditorialToolChanged(int newtool)
1.95 -{
1.96 - gdc.changeEditorialTool(newtool);
1.97 -}
2.1 --- a/edit_win.h Thu Jul 28 15:54:00 2005 +0000
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,40 +0,0 @@
2.4 -// -*- C++ -*- //
2.5 -
2.6 -#ifndef EDIT_WIN_H
2.7 -#define EDIT_WIN_H
2.8 -
2.9 -#include <all_include.h>
2.10 -#include <mapstorage.h>
2.11 -#include <graph_displayer_canvas.h>
2.12 -#include <libgnomecanvasmm.h>
2.13 -#include <libgnomecanvasmm/polygon.h>
2.14 -
2.15 -///This class is responsible for creating a window,
2.16 -///on which the wished editorial tool can be activated.
2.17 -class EditWin : public Gtk::Window
2.18 -{
2.19 -protected:
2.20 - ///The \ref GraphDisplayerCanvas on which the graph will be drawn.
2.21 - ///It has to be known for this class, because the appropriate
2.22 - //callback function for each tool is implemented in that class
2.23 - GraphDisplayerCanvas & gdc;
2.24 -
2.25 - ///Table that holds the tools.
2.26 - Gtk::Table table;
2.27 -
2.28 - ///these buttons are RadioButtons with classic look
2.29 - Gtk::RadioButton ** buttons;
2.30 -
2.31 -public:
2.32 - ///Constructor of EditWin creates the widgets shown in EditWin.
2.33 - EditWin(const std::string& title, GraphDisplayerCanvas &);
2.34 -
2.35 - virtual bool closeIfEscapeIsPressed(GdkEventKey*);
2.36 -
2.37 - ///Callback function in case of button pression.
2.38 - ///It changes the actual tool ins editor's hand.
2.39 - void makeEditorialToolChanged(int);
2.40 -
2.41 -};
2.42 -
2.43 -#endif //EDIT_WIN_H