Skip to content

Commit

Permalink
Header file for task completed modal
Browse files Browse the repository at this point in the history
  • Loading branch information
BeepLoveKarki committed Mar 11, 2018
1 parent 297f390 commit 4893673
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modal.h
@@ -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
}
}

0 comments on commit 4893673

Please sign in to comment.