3 WorkPlace::WorkPlace( BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> &refGlade):Gtk::Fixed(cobject)
7 bool WorkPlace::on_expose_event(GdkEventExpose *e)
10 for(x=0; x<get_width(); x+=32)
11 for (y=0; y<get_height();y+=32){
12 get_window()->draw_point (get_style()->get_black_gc(), x,y);
13 get_window()->draw_point (get_style()->get_black_gc(), x,y+1);
14 get_window()->draw_point (get_style()->get_black_gc(), x,y-1);
15 get_window()->draw_point (get_style()->get_black_gc(), x+1,y);
16 get_window()->draw_point (get_style()->get_black_gc(), x-1,y);
18 //TODO recorer la lista_lineas y dibujar todas
19 get_window()->draw_line (get_style()->get_black_gc(), temp.x,temp.y,temp.w,temp.z);
24 bool WorkPlace::on_button_press_event(GdkEventButton *event)
26 std::cout<< temp.x<<" "<<temp.y<< std::endl;
27 if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 1) ) {
28 get_pointer(temp.x,temp.y);
29 std::cout<< temp.x<<" "<<temp.y<< std::endl;
34 bool WorkPlace::on_button_release_event(GdkEventButton *event)
36 if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 1) ) {
37 get_pointer(temp.w,temp.z);
38 lista_lineas.push_back(temp);
39 get_window()->draw_line (get_style()->get_black_gc(), temp.x,temp.y,temp.w,temp.z);
44 void WorkPlace::delete_item(int _id)
46 std::list<CItem*>::iterator i = listaItems->begin();
47 while ( i != listaItems->end() ){
49 if ( temp->get_id() == _id ){