summaryrefslogtreecommitdiff
path: root/src/user/include/cxx/raleigh/d/dialog.h
blob: f207033389ec4f8a222efaa03cf24e2cc5beef1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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