aboutsummaryrefslogtreecommitdiff
path: root/src/InputDialog.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-03 01:10:08 +0100
committerdec05eba <dec05eba@protonmail.com>2018-11-03 01:10:11 +0100
commit8cc8853c3c1e5dfd7681bc0c31bc0eb88a4ef959 (patch)
tree844cb300de80e41aac38a1b481368c6ae6eb6c58 /src/InputDialog.cpp
parent3c5eb7000709606eccd34114e8bf4e851dcacd6a (diff)
Add room name change event, create new room button, multiple rooms
Diffstat (limited to 'src/InputDialog.cpp')
-rw-r--r--src/InputDialog.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/InputDialog.cpp b/src/InputDialog.cpp
new file mode 100644
index 0000000..520bfa2
--- /dev/null
+++ b/src/InputDialog.cpp
@@ -0,0 +1,32 @@
+#include "../include/InputDialog.hpp"
+#include <gtkmm/label.h>
+
+namespace dchat
+{
+ InputDialog::InputDialog(const char *title, const char *text, const char *acceptText, const char *cancelText)
+ {
+ set_title(title);
+
+ Gtk::Box *box = get_content_area();
+ Gtk::Label *label = Gtk::manage(new Gtk::Label(text));
+ label->set_valign(Gtk::ALIGN_END);
+ label->set_halign(Gtk::ALIGN_CENTER);
+ box->pack_start(*label, true, true);
+
+ entry.set_valign(Gtk::ALIGN_CENTER);
+ entry.set_halign(Gtk::ALIGN_CENTER);
+ entry.set_hexpand(true);
+ box->pack_end(entry, true, true);
+
+ add_button(acceptText, Gtk::RESPONSE_ACCEPT);
+ add_button(cancelText, Gtk::RESPONSE_CANCEL);
+ show_all();
+
+ set_size_request(300, 150);
+ }
+
+ Glib::ustring InputDialog::getInput() const
+ {
+ return entry.get_text();
+ }
+} \ No newline at end of file