summaryrefslogtreecommitdiff
path: root/src/user/include/cxx/raleigh/d
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/include/cxx/raleigh/d')
-rw-r--r--src/user/include/cxx/raleigh/d/dialog.h37
-rw-r--r--src/user/include/cxx/raleigh/d/saving_window.h20
2 files changed, 57 insertions, 0 deletions
diff --git a/src/user/include/cxx/raleigh/d/dialog.h b/src/user/include/cxx/raleigh/d/dialog.h
new file mode 100644
index 0000000..f207033
--- /dev/null
+++ b/src/user/include/cxx/raleigh/d/dialog.h
@@ -0,0 +1,37 @@
+#ifndef RALEIGH_D_DIALOG_H
+#define RALEIGH_D_DIALOG_H
+
+#include <raleigh/w/vbox.h>
+#include <raleigh/window.h>
+#include <structs/alist.h>
+#include <structs/duple.h>
+#include <stdint.h>
+
+namespace raleigh {
+ typedef uint32_t diag_result_t;
+ enum : diag_result_t {
+ NONE = 0,
+ YES,
+ NO,
+ CANCEL,
+ RETRY
+ };
+ extern alist<duple<const char *, diag_result_t>> &yes_no_cancel;
+ extern alist<duple<const char *, diag_result_t>> &yes_no_retry;
+ class dialog : public window {
+ public:
+ //button names are copied
+ //alist isn't needed past constructor
+ dialog(widget &top_part, alist<duple<const char *, diag_result_t>> buttons);
+
+ //zero means not set yet
+ diag_result_t result;
+
+ void show_modal();
+
+ private:
+ vbox *main_box;
+ };
+}
+
+#endif \ No newline at end of file
diff --git a/src/user/include/cxx/raleigh/d/saving_window.h b/src/user/include/cxx/raleigh/d/saving_window.h
new file mode 100644
index 0000000..84b6f69
--- /dev/null
+++ b/src/user/include/cxx/raleigh/d/saving_window.h
@@ -0,0 +1,20 @@
+#ifndef RALEIGH_D_SAVING_WINDOW_H
+#define RALEIGH_D_SAVING_WINDOW_H
+
+#include <raleigh/w/vbox.h>
+#include <raleigh/window.h>
+
+namespace raleigh {
+ typedef void *save_tag_t;
+ class saving_window : public window {
+ public:
+ //save_func returns true if saving was successful
+ saving_window(bool (*save_func)(save_tag_t), save_tag_t save_tag, widget &root, _pixel_t bg_color=RGB(bf, bf, bf));
+ bool is_saved;
+
+ bool (*save_func)(save_tag_t);
+ save_tag_t save_tag;
+ };
+};
+
+#endif \ No newline at end of file