-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathButtonBar.hpp
58 lines (50 loc) · 1.47 KB
/
ButtonBar.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
48
49
50
51
52
53
54
55
56
57
58
/*
* =====================================================================================
*
* Filename: ButtonBar.hpp
*
* Description: Provides a generic two button bar, for ok/cancel or whatever..
*
* Version: 1.0
* Created: 06/17/2011 10:30:08 PM
* Revision: none
* Compiler: gcc
*
* Author: Matthew Sherborne (), [email protected]
* Company:
*
* =====================================================================================
*/
#ifndef BUTTON_BAR
#define BUTTON_BAR
#include <Wt/WPushButton>
#include "MoreAwesomeTemplate.hpp"
using Wt::WPushButton;
namespace vidanueva {
/**
* @brief A nice two buttons next to each other on a panel
*
* Cancel will navigate the app back to "/".
* OK will trigger the 'onOk' event
*/
class ButtonBar : public MoreAwesomeTemplate {
protected:
WPushButton* _btn1;
WPushButton* _btn2;
public:
/**
* @brief Gives you a nice pair of buttons
*
* @param parent Parent Widget
*/
ButtonBar(const WString& button1Text, const WString& button2Text, WContainerWidget* parent=0) : MoreAwesomeTemplate(parent) {
setTemplateText(tr("button-bar"));
setStyleClass("yui-gb button-bar");
bindAndCreateWidget(_btn1, "btn-1", button1Text);
bindAndCreateWidget(_btn2, "btn-2", button2Text);
}
WPushButton* btn1() { return _btn1; }
WPushButton* btn2() { return _btn2; }
};
} // namespace vidanueva
#endif // BUTTON_BAR