-
Notifications
You must be signed in to change notification settings - Fork 2
/
modal.h
29 lines (26 loc) · 800 Bytes
/
modal.h
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
#pragma once
#include <Wt/WApplication.h>
#include <Wt/WContainerWidget.h>
#include <Wt/WMessageBox.h>
#include <Wt/WPushButton.h>
#include <Wt/WText.h>
#include <string>
class modal {
public:
modal(string,string); //constructor
~modal() {}; //destructor
void showdialog(); //function declaration to show dialog
private:
string text,head; //sting to hold text
};
modal::modal(string head,string text) {
this->head = head;
this->text = text; //parameterized constructor
}
void modal::showdialog() { //functon definition to show dialog
Wt::StandardButton answer = Wt::WMessageBox::show(head,text,Wt::StandardButton::Ok); //show dialog box
if (answer==Wt::StandardButton::Ok) {
Wt::WApplication::instance()->refresh();
Wt::WApplication::instance()->redirect("/"); //refresh on click
}
}