]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Constructor/workplace.cpp
Se agrega sobrecarga de add_arg(unsigned) a pedido de ricky :)
[z.facultad/75.42/plaqui.git] / Constructor / workplace.cpp
1 #include "workplace.h"
2
3 WorkPlace::WorkPlace( BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> &refGlade):Gtk::Fixed(cobject)
4 {
5         refGlade->get_widget_derived("viewport",viewport);
6         viewport->workplace = this;
7 }
8
9 WorkPlace::~WorkPlace()
10 {
11 }
12
13 bool WorkPlace::on_expose_event(GdkEventExpose *event)
14 {
15         int x, y;
16         for(x=0; x<get_width(); x+=32) 
17                 for (y=0; y<get_height();y+=32){
18                         get_window()->draw_point (get_style()->get_black_gc(), x,y);
19                         get_window()->draw_point (get_style()->get_black_gc(), x,y+1);
20                         get_window()->draw_point (get_style()->get_black_gc(), x,y-1);
21                         get_window()->draw_point (get_style()->get_black_gc(), x+1,y);
22                         get_window()->draw_point (get_style()->get_black_gc(), x-1,y);
23                 }
24                 
25 /*      std::list<t_line>::iterator i = lista_lineas.begin();
26         while ( i != lista_lineas.end() ) {
27                 t_line temp = *i;
28                 get_window()->draw_line (get_style()->get_black_gc(), temp.x,temp.y,temp.w,temp.z);
29                 i++;
30         }*/
31         return true;
32 }
33
34 void WorkPlace::delete_item(int _id)
35 {
36         std::list<CItem*>::iterator i = listaItems->begin();
37         while ( i != listaItems->end() ){
38         CItem *temp = *i;
39                 if ( temp->get_id() == _id ){
40                         listaItems->erase(i);
41                         delete temp;
42                         break;
43                 }
44                 i++;
45         }
46 }