-
Notifications
You must be signed in to change notification settings - Fork 1
/
DialogButtonBar.hpp
47 lines (40 loc) · 1.27 KB
/
DialogButtonBar.hpp
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
38
39
40
41
42
43
44
45
46
47
/*
* =====================================================================================
*
* Filename: DialogButtonBar.hpp
*
* Description: Gives you an OK and cancel button to sit at the bottom of a dialog
*
* Version: 1.0
* Created: 06/04/2011 09:49:11 AM
* Revision: none
* Compiler: gcc
*
* Author: Matthew Sherborne (), msherborne@gmail.com
* Company:
*
* =====================================================================================
*/
#ifndef DIALOG_BUTTON_BAR_HPP
#define DIALOG_BUTTON_BAR_HPP
#include <Wt/WDialog>
#include <Wt/WPushButton>
#include "MoreAwesomeTemplate.hpp"
using Wt::WPushButton;
using Wt::WDialog;
namespace vidanueva {
class DialogButtonBar : public MoreAwesomeTemplate {
private:
WPushButton* _okBtn;
WPushButton* _cancelBtn;
public:
DialogButtonBar(WDialog& dialog) : MoreAwesomeTemplate(dialog.contents()) {
setTemplateText(tr("dialog-button-bar"));
bindAndCreateWidget(_okBtn, "ok-btn", tr("ok-btn"));
bindAndCreateWidget(_cancelBtn, "cancel-btn", tr("cancel-btn"));
_okBtn->clicked().connect(&dialog, &WDialog::accept);
_cancelBtn->clicked().connect(&dialog, &WDialog::reject);
}
};
}
#endif // DIALOG_BUTTON_BAR_HPP