Wt examples
3.3.0
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
build
buildd
witty-3.3.0
examples
javascript
Popup.h
Go to the documentation of this file.
1
// This may look like C code, but it's really -*- C++ -*-
2
/*
3
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
4
*
5
* See the LICENSE file for terms of use.
6
*/
7
#ifndef POPUP_H_
8
#define POPUP_H_
9
10
#include <Wt/WObject>
11
#include <Wt/WString>
12
#include <Wt/WJavaScript>
13
14
using namespace
Wt;
15
20
32
class
Popup
:
public
WObject
33
{
34
public
:
37
static
Popup
*createConfirm(
const
WString
& message,
WObject
*parent = 0);
38
41
static
Popup
*createPrompt(
const
WString
& message,
42
const
std::string defaultValue,
43
WObject
*parent = 0);
44
47
static
Popup
*createAlert(
const
WString
& message,
WObject
*parent = 0);
48
51
void
setMessage(
const
WString
& message);
52
55
void
setDefaultValue(
const
std::string defaultValue);
56
59
const
WString
&
message
()
const
{
return
message_; }
60
63
const
std::string&
defaultValue
()
const
{
return
defaultValue_; }
64
70
JSlot
show
;
71
74
JSignal<std::string>
&
okPressed
() {
return
okPressed_; }
75
78
JSignal<void>
&
cancelPressed
() {
return
cancelPressed_; }
79
80
private
:
83
enum
Type
{ Confirm, Alert, Prompt };
84
87
Popup
(
Type
t,
const
WString
& message,
const
std::string defaultValue,
88
WObject
*parent);
89
90
JSignal<std::string>
okPressed_
;
91
JSignal<void>
cancelPressed_
;
92
93
Type
t_
;
94
WString
message_
;
95
std::string
defaultValue_
;
96
99
void
setJavaScript();
100
};
101
104
#endif // POPUP_H_
Generated on Fri May 31 2013 for
the C++ Web Toolkit (Wt)
by
1.8.3.1