]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
bueno, hice que el doble click abra una ventanita de propiedades, pero solo lo implem...
authorNicolás Dimov <ndimov@gmail.com>
Tue, 28 Oct 2003 21:03:34 +0000 (21:03 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Tue, 28 Oct 2003 21:03:34 +0000 (21:03 +0000)
La cuestion es que me parece que se me esta armando bardo con todas las clases que estoy creando... diganme si se debe simplificar un poco o asi esta bien...
El make hizo que mi estilo de vida suba en un 300%, gracias por existir.!!!

15 files changed:
Constructor/cistern.cpp
Constructor/cistern.h
Constructor/cisternptywnd.cpp [new file with mode: 0644]
Constructor/cisternptywnd.h [new file with mode: 0644]
Constructor/conduct.cpp
Constructor/conduct.h
Constructor/conductptywnd.cpp [new file with mode: 0644]
Constructor/conductptywnd.h [new file with mode: 0644]
Constructor/constructor.cpp
Constructor/constructor.glade
Constructor/constructor.h
Constructor/item.cpp
Constructor/item.h
Constructor/propertywnd.cpp [new file with mode: 0644]
Constructor/propertywnd.h [new file with mode: 0644]

index ef12915dc8b77acf1d1dae470a955fad46bf9505..c71b849a0c4e3cf58fcd429eab4ae5db6da6d846 100644 (file)
@@ -8,6 +8,15 @@ Cistern::Cistern()
        imgActual = 0;
        image = imageE;
        set_size_request(image->get_width(), image->get_height());
+       
+       Glib::RefPtr<Gnome::Glade::Xml> ref;
+       try {
+               ref = Gnome::Glade::Xml::create("constructor.glade", "cistern_pty_wnd");
+       }
+       catch(const Gnome::Glade::XmlError &ex) {
+               std::cerr << ex.what() << std::endl;
+       }
+       ref->get_widget_derived("cistern_pty_wnd",property_wnd);
 }
 
 Cistern::~Cistern()
@@ -31,10 +40,18 @@ bool Cistern::on_button_press_event(GdkEventButton *event)
                set_size_request(image->get_width(),image->get_height());
                image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
        }
+       
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
                menu_popup.popup(event->button, event->time);
                 return true; //It has been handled.
        }
+       
+       if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
+               if( property_wnd->is_open() == false ){
+                       property_wnd->show();
+                       property_wnd->set_open (true);
+               } 
+       }               
        return true;
 }
 
@@ -45,3 +62,11 @@ void Cistern::on_menu_popup_rotar()
                event.button = 2;
        Cistern::on_button_press_event(&event);
 }
+
+void Cistern::on_menu_popup_propiedades()
+{
+       GdkEventButton event; 
+               event.type = GDK_2BUTTON_PRESS;
+               event.button = 1;
+       Cistern::on_button_press_event(&event);
+}
index 3fb32ba12998ccde08514ea6024e875b39422078..f4affb501217a759ae21d773e4e4fe0f5700ec02 100644 (file)
@@ -3,13 +3,14 @@
 #define _CISTERN_H_
 
 #include "item.h"
-
+#include "cisternptywnd.h"
 class Cistern : public CItem {
        public:
                Cistern();
                virtual ~Cistern();
                virtual bool on_button_press_event(GdkEventButton *event);
                virtual void on_menu_popup_rotar();
+               virtual void on_menu_popup_propiedades();
        private:
                int imgActual;  
        
diff --git a/Constructor/cisternptywnd.cpp b/Constructor/cisternptywnd.cpp
new file mode 100644 (file)
index 0000000..98acbd6
--- /dev/null
@@ -0,0 +1,11 @@
+//cisternptywnd.cpp
+
+#include "cisternptywnd.h"
+
+CisternPtyWnd::CisternPtyWnd():PropertyWnd()
+{
+}
+
+CisternPtyWnd::~CisternPtyWnd()
+{
+}
diff --git a/Constructor/cisternptywnd.h b/Constructor/cisternptywnd.h
new file mode 100644 (file)
index 0000000..2429af4
--- /dev/null
@@ -0,0 +1,17 @@
+//cisternptywnd.h
+
+#ifndef _CISTERNPTYWND_H_
+#define _CISTERNPTYWND_H_
+
+#include "propertywnd.h"
+
+class CisternPtyWnd : public PropertyWnd{
+       public:
+               CisternPtyWnd();
+               virtual ~CisternPtyWnd();
+       protected:
+               
+       
+};
+
+#endif
index 075f645e264060a3638f30fbb56b77455b8d263c..4b7fa17032c46822b554a42c12db99f3862dfba0 100644 (file)
@@ -8,6 +8,16 @@ Conduct::Conduct()
        imgActual = 0;
        image = imageN;
        set_size_request(image->get_width(), image->get_height());
+       
+       Glib::RefPtr<Gnome::Glade::Xml> ref;
+       try {
+               ref = Gnome::Glade::Xml::create("constructor.glade", "conduct_pty_wnd");
+       }
+       catch(const Gnome::Glade::XmlError &ex) {
+               std::cerr << ex.what() << std::endl;
+       }
+       //tengo que crear una clase para esta ventana..!!!
+       ref->get_widget_derived("conduct_pty_wnd",property_wnd);
 }
 
 Conduct::~Conduct()
@@ -37,6 +47,13 @@ bool Conduct::on_button_press_event(GdkEventButton *event)
                menu_popup.popup(event->button, event->time);
                 return true; //It has been handled.
        }
+       
+       if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
+               if( property_wnd->is_open() == false ){
+                       property_wnd->show();
+                       property_wnd->set_open (true);
+               } 
+       }
        return true;
 }
 
@@ -47,3 +64,11 @@ void Conduct::on_menu_popup_rotar()
                event.button = 2;
        Conduct::on_button_press_event(&event);
 }
+
+void Conduct::on_menu_popup_propiedades()
+{
+       GdkEventButton event;
+       event.type = GDK_2BUTTON_PRESS;
+       event.button = 1;
+       Conduct::on_button_press_event(&event);
+}
index 2a44ce15458819191b119c9ed9725a126a40f483..4735d822dccf1aa2cab0246a64b08fcb31301206 100644 (file)
@@ -10,6 +10,7 @@ class Conduct : public CItem {
                virtual ~Conduct();
                virtual bool on_button_press_event(GdkEventButton *event);
                virtual void on_menu_popup_rotar();
+               virtual void on_menu_popup_propiedades();
        private:
                int imgActual;  
        
diff --git a/Constructor/conductptywnd.cpp b/Constructor/conductptywnd.cpp
new file mode 100644 (file)
index 0000000..f1650d3
--- /dev/null
@@ -0,0 +1,11 @@
+//conductptywnd.cpp
+
+#include "conductptywnd.h"
+
+ConductPtyWnd::ConductPtyWnd():PropertyWnd()
+{
+}
+
+ConductPtyWnd::~ConductPtyWnd()
+{
+}
diff --git a/Constructor/conductptywnd.h b/Constructor/conductptywnd.h
new file mode 100644 (file)
index 0000000..3afb970
--- /dev/null
@@ -0,0 +1,17 @@
+//conductptywnd.h
+
+#ifndef _CONDUCTPTYWND_H_
+#define _CONDUCTPTYWND_H_
+
+#include "propertywnd.h"
+
+class ConductPtyWnd : public PropertyWnd{
+       public:
+               ConductPtyWnd();
+               virtual ~ConductPtyWnd();
+       protected:
+               
+       
+};
+
+#endif
index ca97953e1edaa5402e44b745364f852e11ee0e94..caa74f8024679c615f19d233b6291ed16c4a83e3 100644 (file)
@@ -21,7 +21,7 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        
        
        
-       //Targets:
+       //Targets
        listTargets.push_back( Gtk::TargetEntry("STRING") );
        listTargets.push_back( Gtk::TargetEntry("text/plain") );
        listTargets.push_back( Gtk::TargetEntry("POINTER") );
@@ -73,7 +73,7 @@ void Constructor::on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& c
        gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"item_tanque.png",15);
 }
 
-void Constructor::on_main_menu_quit(void)
+void Constructor::on_main_menu_quit()
 {
        Gtk::Main::quit();
 }
index cf3c90b0abaacd20ae08bbc5a34eb7c8e227b200..e1d757d44fd2573394c59f94105a1b85e2f4f0f2 100644 (file)
@@ -29,7 +29,7 @@
          <property name="yscale">1</property>
 
          <child>
-           <widget class="GtkMenuBar" id="menu">
+           <widget class="GtkMenuBar" id="main_menu">
              <property name="visible">True</property>
 
              <child>
@@ -507,10 +507,10 @@ Empalme</property>
   </child>
 </widget>
 
-<widget class="GtkDialog" id="dialog1">
-  <property name="width_request">271</property>
+<widget class="GtkDialog" id="cistern_pty_wnd">
+  <property name="width_request">354</property>
   <property name="height_request">194</property>
-  <property name="title" translatable="yes">Propiedades</property>
+  <property name="title" translatable="yes">Propiedades del Tanque</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
   <property name="modal">False</property>
@@ -527,10 +527,10 @@ Empalme</property>
       <child internal-child="action_area">
        <widget class="GtkHButtonBox" id="dialog-action_area1">
          <property name="visible">True</property>
-         <property name="layout_style">GTK_BUTTONBOX_END</property>
+         <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
 
          <child>
-           <widget class="GtkButton" id="cancelbutton1">
+           <widget class="GtkButton" id="btn_cancel">
              <property name="visible">True</property>
              <property name="can_default">True</property>
              <property name="can_focus">True</property>
@@ -542,7 +542,7 @@ Empalme</property>
          </child>
 
          <child>
-           <widget class="GtkButton" id="okbutton1">
+           <widget class="GtkButton" id="btn_accept">
              <property name="visible">True</property>
              <property name="can_default">True</property>
              <property name="can_focus">True</property>
@@ -552,6 +552,18 @@ Empalme</property>
              <property name="response_id">-5</property>
            </widget>
          </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_apply">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-apply</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-10</property>
+           </widget>
+         </child>
        </widget>
        <packing>
          <property name="padding">0</property>
@@ -630,7 +642,7 @@ Empalme</property>
              <property name="width_request">104</property>
              <property name="height_request">24</property>
              <property name="visible">True</property>
-             <property name="label" translatable="yes">Fluido Máximo</property>
+             <property name="label" translatable="yes">Capacidad</property>
              <property name="use_underline">False</property>
              <property name="use_markup">False</property>
              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -652,7 +664,7 @@ Empalme</property>
              <property name="width_request">120</property>
              <property name="height_request">24</property>
              <property name="visible">True</property>
-             <property name="label" translatable="yes">Fluido Mínimo</property>
+             <property name="label" translatable="yes">Fluido Máximo</property>
              <property name="use_underline">False</property>
              <property name="use_markup">False</property>
              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -674,7 +686,7 @@ Empalme</property>
              <property name="width_request">96</property>
              <property name="height_request">24</property>
              <property name="visible">True</property>
-             <property name="label" translatable="yes">otra cosa</property>
+             <property name="label" translatable="yes">Otra propiedad</property>
              <property name="use_underline">False</property>
              <property name="use_markup">False</property>
              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -701,4 +713,223 @@ Empalme</property>
   </child>
 </widget>
 
+<widget class="GtkDialog" id="conduct_pty_wnd">
+  <property name="title" translatable="yes">Propiedades del Tubo</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox2">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="dialog-action_area2">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+         <child>
+           <widget class="GtkButton" id="btn_cancel">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-cancel</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-6</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_apply">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-apply</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-10</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_accept">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-ok</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-5</property>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkTable" id="table1">
+         <property name="visible">True</property>
+         <property name="n_rows">3</property>
+         <property name="n_columns">2</property>
+         <property name="homogeneous">True</property>
+         <property name="row_spacing">0</property>
+         <property name="column_spacing">0</property>
+
+         <child>
+           <widget class="GtkSpinButton" id="spinbutton4">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">0</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">1 0 100 1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label11">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Flujo Máximo</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_CENTER</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="x_options">fill</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spinbutton5">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">0</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">1 0 100 1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spinbutton6">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">0</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">1 0 100 1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label12">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Longitud</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="x_options">fill</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label13">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Otro</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="x_options">fill</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">10</property>
+         <property name="expand">True</property>
+         <property name="fill">False</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>
index 1bb50132048acfc0620af3e82ed37f133ca69add..fe959fe9c4f81fa7e96498e79fd1cc39744f8c4c 100644 (file)
@@ -36,7 +36,7 @@ class Constructor : public Gtk::Window {
        virtual void on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
-       virtual void on_main_menu_quit(void);
+       virtual void on_main_menu_quit();
        
        // señales para cambiar el icono.
        virtual void on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
index 720a86c69ad54fa62524e21fea59cff75beb1949..4caba43a99c813250b93af2a966d32d831e2db27 100644 (file)
@@ -5,15 +5,17 @@ CItem::CItem(const char *filename):Gtk::DrawingArea()
 {
        image = Gdk::Pixbuf::create_from_file(filename);
        set_size_request(image->get_width(), image->get_height());
+
 }
 
 CItem::CItem()
 {
-       menu_image.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU);
+       menu_image_delete.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU);
+       menu_image_rotar.set(Gtk::Stock::REFRESH, Gtk::ICON_SIZE_MENU);
        Gtk::Menu::MenuList& menulist = menu_popup.items();
-    menulist.push_back( Gtk::Menu_Helpers::MenuElem("Opcion", SigC::slot(*this, &CItem::on_menu_popup_opcion) ) );
-    menulist.push_back( Gtk::Menu_Helpers::MenuElem("Rotar", Gtk::Menu::AccelKey("<control>r"),SigC::slot(*this, &CItem::on_menu_popup_rotar) ) );
-    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image,SigC::slot(*this, &CItem::on_menu_popup_eliminar) ) ) ;
+    menulist.push_back( Gtk::Menu_Helpers::MenuElem("Propiedades", SigC::slot(*this, &CItem::on_menu_popup_propiedades) ) );
+    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Rotar",Gtk::Menu::AccelKey("<control>r"), menu_image_rotar ,SigC::slot(*this, &CItem::on_menu_popup_rotar) ) );
+    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image_delete,SigC::slot(*this, &CItem::on_menu_popup_eliminar) ) ) ;
        menu_popup.accelerate(*this);
 }
 
@@ -32,7 +34,7 @@ bool CItem::on_expose_event(GdkEventExpose* event)
        return true;
 }
 
-void CItem::on_menu_popup_opcion()
+void CItem::on_menu_popup_propiedades()
 {
 }
 
index 5aef5c60a4d9716de0e08b6a49c84dc71b62a244..5b2822944638cfeb3fc82329d7d9943cd549cc28 100644 (file)
@@ -3,10 +3,13 @@
 #ifndef GTKMM_EXAMPLE_DRAWINGAREALINES_H
 #define GTKMM_EXAMPLE_DRAWINGAREALINES_H
 
+#include <iostream>
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/stock.h>
 #include <gtkmm.h>
 #include <gdkmm.h>
+#include <libglademm.h>
+#include "propertywnd.h"
 
 class CItem:public Gtk::DrawingArea {
 public:
@@ -14,14 +17,15 @@ public:
        CItem(const char *filename);
        ~CItem();
        virtual bool on_expose_event(GdkEventExpose* event);
-       virtual void on_menu_popup_opcion();
+       virtual void on_menu_popup_propiedades();
        virtual void on_menu_popup_rotar();
        virtual void on_menu_popup_eliminar();
        Glib::RefPtr<Gdk::Pixbuf> get_image() { return image; }
 protected:
        Gtk::Menu menu_popup;
-       Gtk::Image menu_image;
+       Gtk::Image menu_image_delete, menu_image_rotar;
        Glib::RefPtr<Gdk::Pixbuf> image;
+       PropertyWnd *property_wnd;
 };
 
 #endif
diff --git a/Constructor/propertywnd.cpp b/Constructor/propertywnd.cpp
new file mode 100644 (file)
index 0000000..c929c5b
--- /dev/null
@@ -0,0 +1,39 @@
+//propertywnd.cpp
+
+#include "propertywnd.h"
+
+PropertyWnd::PropertyWnd()
+{
+       open = false;
+}
+
+PropertyWnd::PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade): Gtk::Window(cobject)
+{
+       refGlade->get_widget("btn_cancel", btn_cancel);
+       refGlade->get_widget("btn_apply", btn_apply);
+       refGlade->get_widget("btn_accept", btn_accept);
+               
+       btn_cancel->signal_clicked().connect(SigC::slot(*this, &PropertyWnd::on_btn_cancel_clicked));
+       open = false;
+}
+
+PropertyWnd::~PropertyWnd()
+{
+}
+
+void PropertyWnd::on_btn_cancel_clicked()
+{
+       open = false;
+       hide();
+       //oculto la ventana, tengo que ver como hago para cerrarla del todo.
+}
+
+bool PropertyWnd::is_open()
+{
+       return open;
+}
+
+void PropertyWnd::set_open(bool o)
+{
+       open = o;
+}
diff --git a/Constructor/propertywnd.h b/Constructor/propertywnd.h
new file mode 100644 (file)
index 0000000..bd5d40a
--- /dev/null
@@ -0,0 +1,27 @@
+//propertywnd.h
+#ifndef _PROPERTYWND_H_
+#define _PROPERTYWND_H_
+
+#include <gtkmm/window.h>
+#include <gtkmm/button.h>
+#include <libglademm.h>
+
+class PropertyWnd : public Gtk::Window{
+       public:
+               PropertyWnd();
+               PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
+               virtual ~PropertyWnd();
+               
+               bool is_open();
+               void set_open(bool);
+       
+       protected:
+               bool open;
+               Gtk::Button *btn_cancel, *btn_accept, *btn_apply;
+               virtual void on_btn_cancel_clicked();
+       
+       
+};
+
+
+#endif