# HG changeset patch # User hegyi # Date 1122566093 0 # Node ID c421cc1b70edfdf00fc4b228a65d4f085f0e0f6d # Parent c2f95eac652b8f7a08ff4e40f8ad7b514da4fd04 There is no need for these furthermore. diff -r c2f95eac652b -r c421cc1b70ed gui/edit_win.cc --- a/gui/edit_win.cc Thu Jul 28 15:54:00 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -#include -#include - -bool EditWin::closeIfEscapeIsPressed(GdkEventKey* e) -{ - if(e->keyval==GDK_Escape) - { - hide(); - } - return true; -} - -EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true) -{ - set_title(title); - set_default_size(200, 50); - set_keep_above(true); - signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::closeIfEscapeIsPressed)); - - //buttons array - buttons=new Gtk::RadioButton * [TOOL_NUM]; - for(int i=0;iget_group(); - - //New node button - buttons[CREATE_NODE]=new Gtk::RadioButton("New Node"); - buttons[CREATE_NODE]->set_mode(false); - buttons[CREATE_NODE]->set_group(group); - buttons[CREATE_NODE]->signal_clicked().connect - ( - sigc::bind - ( - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged), - 1 - ) - ); - table.attach(*buttons[CREATE_NODE],0,1,0,1); - - //New edge button - buttons[CREATE_EDGE]=new Gtk::RadioButton("New Edge"); - buttons[CREATE_EDGE]->set_mode(false); - buttons[CREATE_EDGE]->set_group(group); - buttons[CREATE_EDGE]->signal_clicked().connect - ( - sigc::bind - ( - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged), - 2 - ) - ); - table.attach(*buttons[CREATE_EDGE],1,2,0,1); - - //Move button - buttons[MOVE]=new Gtk::RadioButton("Move"); - buttons[MOVE]->set_mode(false); - buttons[MOVE]->set_group(group); - buttons[MOVE]->signal_clicked().connect - ( - sigc::bind - ( - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged), - 0 - ) - ); - table.attach(*buttons[MOVE],0,1,1,2); - - //New edge button - buttons[ERASER]=new Gtk::RadioButton("Erase Item"); - buttons[ERASER]->set_mode(false); - buttons[ERASER]->set_group(group); - buttons[ERASER]->signal_clicked().connect - ( - sigc::bind - ( - sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged), - 3 - ) - ); - table.attach(*buttons[ERASER],1,2,1,2); - - add(table); - - show_all_children(); - -} - -void EditWin::makeEditorialToolChanged(int newtool) -{ - gdc.changeEditorialTool(newtool); -} diff -r c2f95eac652b -r c421cc1b70ed gui/edit_win.h --- a/gui/edit_win.h Thu Jul 28 15:54:00 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -// -*- C++ -*- // - -#ifndef EDIT_WIN_H -#define EDIT_WIN_H - -#include -#include -#include -#include -#include - -///This class is responsible for creating a window, -///on which the wished editorial tool can be activated. -class EditWin : public Gtk::Window -{ -protected: - ///The \ref GraphDisplayerCanvas on which the graph will be drawn. - ///It has to be known for this class, because the appropriate - //callback function for each tool is implemented in that class - GraphDisplayerCanvas & gdc; - - ///Table that holds the tools. - Gtk::Table table; - - ///these buttons are RadioButtons with classic look - Gtk::RadioButton ** buttons; - -public: - ///Constructor of EditWin creates the widgets shown in EditWin. - EditWin(const std::string& title, GraphDisplayerCanvas &); - - virtual bool closeIfEscapeIsPressed(GdkEventKey*); - - ///Callback function in case of button pression. - ///It changes the actual tool ins editor's hand. - void makeEditorialToolChanged(int); - -}; - -#endif //EDIT_WIN_H