From 24f882b98f421e1d65f4fa46cda094f2ac2a34cd Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Mon, 26 Sep 2005 01:48:14 +0000 Subject: [PATCH] Agrego Dialogo para crear un nuevo arbol. --- viewer/Makefile | 2 +- viewer/new_tree_dialog.cpp | 22 ++++++++++++++++++++++ viewer/new_tree_dialog.h | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 viewer/new_tree_dialog.cpp create mode 100644 viewer/new_tree_dialog.h diff --git a/viewer/Makefile b/viewer/Makefile index af96ee2..f3603ed 100644 --- a/viewer/Makefile +++ b/viewer/Makefile @@ -1,6 +1,6 @@ TARGET=viewer CXXFLAGS=-Wall -g `pkg-config gtkmm-2.4 libgnomecanvasmm-2.6 --cflags` -I../src -OBJECTS=main.o view_btree.o view_btree_data.o view_properties.o view_node.o +OBJECTS=main.o view_btree.o view_btree_data.o view_properties.o view_node.o new_tree_dialog.o all: $(TARGET) diff --git a/viewer/new_tree_dialog.cpp b/viewer/new_tree_dialog.cpp new file mode 100644 index 0000000..8c77cf4 --- /dev/null +++ b/viewer/new_tree_dialog.cpp @@ -0,0 +1,22 @@ + +#include "new_tree_dialog.h" + + +NewTreeDialog::NewTreeDialog(): Gtk::Dialog ("Nuevo Arbol", true, true) +{ + label.set_label ("Cantidad a insertar : "); + + hbox.pack_start (label, false, true, 8); + hbox.pack_start (entry, true, true, 8); + get_vbox ()->add (hbox); + add_button (Gtk::StockID ("Cancelar"), Gtk::RESPONSE_CANCEL); + add_button (Gtk::StockID ("Crear"), Gtk::RESPONSE_OK); + + show_all (); +} + +uint NewTreeDialog::getAmount () +{ + return atoi (entry.get_text ().c_str()); +} + diff --git a/viewer/new_tree_dialog.h b/viewer/new_tree_dialog.h new file mode 100644 index 0000000..bb4eb6e --- /dev/null +++ b/viewer/new_tree_dialog.h @@ -0,0 +1,19 @@ + +#ifndef _NUEVO_ARBOL_DLG_ +#define _NUEVO_ARBOL_DLG_ + +#include + +class NewTreeDialog : public Gtk::Dialog { + public: + NewTreeDialog (); + + uint getAmount (); + private: + Gtk::HBox hbox; + Gtk::Label label; + Gtk::Entry entry; +}; + +#endif + -- 2.43.0