edit_win.cc
branchgui
changeset 49 e112465192dc
parent 48 b8ec84524fa2
child 50 eedecee61922
     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 -}