Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Header file for task completed modal
- Loading branch information
1 parent
297f390
commit 4893673
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} | ||
} |