gui/edit_win.cc
changeset 1478 bc7ae573d77d
parent 1469 104aab6e5d86
child 1485 3a1c6678fa23
equal deleted inserted replaced
0:a041c1302310 1:6cf536708537
    12 
    12 
    13 EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true)
    13 EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true)
    14 {
    14 {
    15   set_title(title);
    15   set_title(title);
    16   set_default_size(200, 50);
    16   set_default_size(200, 50);
    17 
    17   set_keep_above(true);
    18   signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close_if_escape_is_pressed));
    18   signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close_if_escape_is_pressed));
    19   
    19   
       
    20   //buttons array
       
    21   buttons=new (Gtk::RadioButton *) [TOOL_NUM];
       
    22   for(int i=0;i<TOOL_NUM;i++)
       
    23     {
       
    24       buttons[i]=NULL;
       
    25     }
       
    26 
       
    27   Gtk::RadioButton::Group group;//=buttons[MOVE]->get_group();
       
    28 
    20   //New node button
    29   //New node button
    21   button=new Gtk::Button("New Node");
    30   buttons[CREATE_NODE]=new Gtk::RadioButton("New Node");
    22   button->signal_clicked().connect
    31   buttons[CREATE_NODE]->set_mode(false);
       
    32   buttons[CREATE_NODE]->set_group(group);
       
    33   buttons[CREATE_NODE]->signal_clicked().connect
    23     (
    34     (
    24      sigc::bind
    35      sigc::bind
    25      (
    36      (
    26       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    37       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    27       1
    38       1
    28       )
    39       )
    29      );
    40      );
    30   table.attach(*button,0,1,0,1);
    41   table.attach(*buttons[CREATE_NODE],0,1,0,1);
    31 
    42 
    32   //New edge button
    43   //New edge button
    33   button=new Gtk::Button("New Edge");
    44   buttons[CREATE_EDGE]=new Gtk::RadioButton("New Edge");
    34   button->signal_clicked().connect
    45   buttons[CREATE_EDGE]->set_mode(false);
       
    46   buttons[CREATE_EDGE]->set_group(group);
       
    47   buttons[CREATE_EDGE]->signal_clicked().connect
    35     (
    48     (
    36      sigc::bind
    49      sigc::bind
    37      (
    50      (
    38       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    51       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    39       2
    52       2
    40       )
    53       )
    41      );
    54      );
    42   table.attach(*button,1,2,0,1);
    55   table.attach(*buttons[CREATE_EDGE],1,2,0,1);
    43     
    56     
    44   //Move button
    57   //Move button
    45   button=new Gtk::Button("Move");
    58   buttons[MOVE]=new Gtk::RadioButton("Move");
    46   button->signal_clicked().connect
    59   buttons[MOVE]->set_mode(false);
       
    60   buttons[MOVE]->set_group(group);
       
    61   buttons[MOVE]->signal_clicked().connect
    47     (
    62     (
    48      sigc::bind
    63      sigc::bind
    49      (
    64      (
    50       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    65       sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
    51       0
    66       0
    52       )
    67       )
    53      );
    68      );
    54   table.attach(*button,0,1,1,2);
    69   table.attach(*buttons[MOVE],0,1,1,2);
    55     
    70       
    56   add(table);
    71   add(table);
    57 
    72 
    58   show_all_children();
    73   show_all_children();
    59 
    74 
    60 }
    75 }