Project

General

Profile

Bug #3627 ยป test_20141015a_dialog_tooltip.C

Bruce Toll, 10/15/2014 09:11 PM

 
1
#include <Wt/WApplication>
2
#include <Wt/WEnvironment>
3
#include <Wt/WContainerWidget>
4
#include <Wt/WMessageBox>
5
#include <Wt/WText>
6
#include <Wt/WBootstrapTheme>
7

    
8
using namespace Wt;
9

    
10
class TestApplication : public WApplication
11
{
12
public:
13
  TestApplication(const WEnvironment& env);
14
  ~TestApplication() { delete theme(); }
15
};
16

    
17
TestApplication::TestApplication(const WEnvironment& env) : WApplication(env)
18
{
19
  setTitle("Test XHTML Tooltip in WMessageBox");
20
  setTheme(new WBootstrapTheme());
21

    
22
  auto message_box = new WMessageBox("Text XHTML Tooltip in WMessageBox",
23
      "This text should have an XHTML Tooltip!", NoIcon, Ok);
24

    
25
  message_box->textWidget()->setToolTip("<b>A bold tooltip</b>", XHTMLText);
26

    
27
  message_box->buttonClicked().connect(std::bind([=] {
28
    delete message_box;
29
  }));
30

    
31
  message_box->show();
32
}
33

    
34
int main(int argc, char **argv)
35
{
36
  return WRun(argc, argv, [](const WEnvironment& env) {return new TestApplication(env);});
37
}
    (1-1/1)