-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathWDialog.C
More file actions
785 lines (651 loc) · 20.7 KB
/
Copy pathWDialog.C
File metadata and controls
785 lines (651 loc) · 20.7 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
/*
* Copyright (C) 2008 Emweb bv, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#include "Wt/WApplication.h"
#include "Wt/WBootstrap5Theme.h"
#include "Wt/WContainerWidget.h"
#include "Wt/WDialog.h"
#include "Wt/WEnvironment.h"
#include "Wt/WException.h"
#include "Wt/WLogger.h"
#include "Wt/WVBoxLayout.h"
#include "Wt/WPushButton.h"
#include "Wt/WTemplate.h"
#include "Wt/WText.h"
#include "Wt/WTheme.h"
#include "Wt/Utils.h"
#include "Wt/WGlobal.h"
#include "Resizable.h"
#include "WebController.h"
#include "WebUtils.h"
#include <boost/algorithm/string.hpp>
#ifndef WT_DEBUG_JS
#include "js/WDialog.min.js"
#endif
namespace Wt {
LOGGER("WDialog");
class DialogCover : public WContainerWidget
{
public:
DialogCover() : WContainerWidget()
{
setObjectName("dialog-cover");
hide();
}
void pushDialog(WDialog *dialog, const WAnimation& animation) {
dialogs_.push_back(dialog);
if (dialog->isModal()) {
coverFor(dialog, animation);
}
scheduleRender();
}
void popDialog(WDialog *dialog, const WAnimation& animation) {
Utils::erase(dialogs_, dialog);
WDialog *topModal = nullptr;
for (unsigned i = dialogs_.size(); i > 0; --i) {
unsigned j = i - 1;
if (dialogs_[j]->isModal()) {
topModal = dialogs_[j];
break;
}
}
coverFor(topModal, animation);
if (dialogs_.empty()) {
#ifndef WT_TARGET_JAVA
WApplication::instance()->removeChild(this);
#else // WT_TARGET_JAVA
delete this;
#endif // WT_TARGET_JAVA
} else
scheduleRender();
}
virtual bool isExposed(WWidget *w) final override {
for (unsigned i = dialogs_.size(); i > 0; --i) {
unsigned j = i - 1;
if (dialogs_[j]->isExposed(w))
return true;
if (dialogs_[j]->isModal())
return isInOtherPopup(w);
}
return false;
}
bool isTopDialogRendered(WDialog *dialog) const {
return dialog->id() == topDialogId_;
}
void bringToFront(WDialog *dialog) {
if (Utils::erase(dialogs_, dialog)) {
dialogs_.push_back(dialog);
scheduleRender();
}
}
protected:
virtual void render(WT_MAYBE_UNUSED WFlags<RenderFlag> flags) final override {
if (dialogs_.empty())
topDialogId_.clear();
else
topDialogId_ = dialogs_.back()->id();
}
private:
std::vector<WDialog *> dialogs_;
std::string topDialogId_; // as currently rendered
void coverFor(WDialog *dialog, const WAnimation& animation) {
if (dialog) {
if (isHidden()) {
if (!animation.empty())
animateShow(WAnimation(AnimationEffect::Fade,
TimingFunction::Linear,
animation.duration() * 4));
else
show();
WApplication::instance()->pushExposedConstraint(this);
}
dialog->doJSAfterLoad("setTimeout(function() {"
+ WApplication::instance()->javaScriptClass()
+ "._p_.updateGlobal('" + dialog->layoutContainer_->id() + "') }"
", 0);"
);
setZIndex(dialog->zIndex() - 1);
setStyleClass(userCoverClasses(dialog));
WApplication *app = WApplication::instance();
app->theme()->apply(app->domRoot(), this, DialogCoverWidget);
} else {
//call updateGlobal(null)
WApplication::instance()->doJavaScript("setTimeout(function() {"
+ WApplication::instance()->javaScriptClass()
+ "._p_.updateGlobal(null) });");
if (!isHidden()) {
if (!animation.empty())
animateHide(WAnimation(AnimationEffect::Fade,
TimingFunction::Linear,
animation.duration() * 4));
else
hide();
WApplication::instance()->popExposedConstraint(this);
}
}
}
std::string userCoverClasses(WWidget *w) {
std::string c = w->styleClass().toUTF8();
std::vector<std::string> classes;
boost::split(classes, c, boost::is_any_of(" "));
std::string result;
for (unsigned i = 0; i < classes.size(); ++i) {
if (!classes[i].empty() && !boost::starts_with(classes[i], "Wt-")) {
if (!result.empty())
result += " ";
result += classes[i] + "-cover";
}
}
return result;
}
bool isInOtherPopup(WWidget *w) {
WApplication *app = WApplication::instance();
/*
* Not sure if the following is entirely correct for popup widgets
* and popup menus?
*/
for (WWidget *p = w; p; p = p->parent()) {
if (dynamic_cast<WDialog *>(p))
return false;
if (p == app->domRoot())
return w != app->root();
w = p;
}
return false;
}
};
WDialog::WDialog()
: WPopupWidget(std::unique_ptr<WWidget>
(new WTemplate(tr("Wt.WDialog.template")))),
moved_(this, "moved"),
resized_(this, "resized"),
zIndexChanged_(this, "zIndexChanged")
{
create();
}
WDialog::WDialog(const WString& windowTitle)
: WPopupWidget(std::unique_ptr<WWidget>
(new WTemplate(tr("Wt.WDialog.template")))),
moved_(this, "moved"),
resized_(this, "resized"),
zIndexChanged_(this, "zIndexChanged")
{
create();
setWindowTitle(windowTitle);
}
void WDialog::create()
{
closeIcon_ = nullptr;
footer_ = nullptr;
modal_ = true;
resizable_ = false;
recursiveEventLoop_ = false;
escapeIsReject_ = false;
autoFocus_ = true;
impl_ = dynamic_cast<WTemplate *>(implementation());
impl_->addFunction("block", &WTemplate::Functions::block);
const char *CSS_RULES_NAME = "Wt::WDialog";
WApplication *app = WApplication::instance();
if (!app->styleSheet().isDefined(CSS_RULES_NAME)) {
/* Needed for the dialog cover */
if (app->environment().agentIsIElt(9))
app->styleSheet().addRule("body", "height: 100%;");
std::string position
= app->environment().agent()
== UserAgent::IE6 ? "absolute" : "fixed";
// we use left: 50%, top: 50%, margin hack when JavaScript is not available
// see below for an IE workaround
app->styleSheet().addRule("div.Wt-dialog", std::string()
//"position: " + position + ';'
+ (!app->environment().ajax() ?
"left: 50%; top: 50%;"
"margin-left: -100px; margin-top: -50px;" :
"left: 0px; top: 0px;"),
CSS_RULES_NAME);
if (app->environment().agent() == UserAgent::IE6) {
app->styleSheet().addRule
("div.Wt-dialogcover",
"position: absolute;"
"left: expression("
"(ignoreMe2 = document.documentElement.scrollLeft) + 'px' );"
"top: expression("
"(ignoreMe = document.documentElement.scrollTop) + 'px' );");
// simulate position: fixed left: 50%; top 50%
if (!app->environment().ajax())
app->styleSheet().addRule
("div.Wt-dialog",
"position: absolute;"
"left: expression("
"(ignoreMe2 = document.documentElement.scrollLeft + "
"document.documentElement.clientWidth/2) + 'px' );"
"top: expression("
"(ignoreMe = document.documentElement.scrollTop + "
"document.documentElement.clientHeight/2) + 'px' );");
}
}
LOAD_JAVASCRIPT(app, "js/WDialog.js", "WDialog", wtjs1);
std::unique_ptr<WContainerWidget> layoutContainer(new WContainerWidget());
layoutContainer_ = layoutContainer.get();
layoutContainer->setGlobalUnfocused(true);
scheduleThemeStyleApply(wApp->theme(), layoutContainer.get(), DialogContent);
layoutContainer->addStyleClass("dialog-layout");
std::unique_ptr<WVBoxLayout> layoutPtr(new WVBoxLayout());
WVBoxLayout *layout = layoutPtr.get();
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layoutContainer->setLayout(std::move(layoutPtr));
impl_->bindWidget("layout", std::move(layoutContainer));
titleBar_ = new WContainerWidget();
scheduleThemeStyleApply(app->theme(), titleBar_, DialogTitleBar);
caption_ = titleBar_->addNew<WTemplate>(tr("Wt.WDialog.titlebar"));
caption_->addFunction("block", &WTemplate::Functions::block);
contents_ = new WContainerWidget();
scheduleThemeStyleApply(app->theme(), contents_, DialogBody);
layout->addWidget(std::unique_ptr<WWidget>(titleBar_));
layout->addWidget(std::unique_ptr<WWidget>(contents_), 1);
/*
* Cannot be done using the CSS stylesheet in case there are
* contained elements with setHideWithOffsets() set
*
* For IE, we cannot set it yet since it will confuse width measurements
* to become minimum size instead of (unconstrained) preferred size
*/
if (app->environment().ajax()) {
impl_->setMargin(0);
/*
* This is needed for animations only, but setting absolute or
* fixed positioning confuses layout measurement in IE browsers
*/
if (!app->environment().agentIsIElt(9))
setPositionScheme(PositionScheme::Fixed);
} else
setPositionScheme(app->environment().agent() == UserAgent::IE6
? PositionScheme::Absolute : PositionScheme::Fixed);
setMovable(true);
zIndexChanged_.connect(this, &WDialog::zIndexChanged);
}
WDialog::~WDialog()
{
hide();
}
WContainerWidget *WDialog::footer() const
{
if (!footer_) {
std::unique_ptr<WContainerWidget> footer(footer_ = new WContainerWidget());
const_cast<WDialog *>(this)->scheduleThemeStyleApply(wApp->theme(),
footer_,
DialogFooter);
WContainerWidget *layoutContainer
= impl_->resolve<WContainerWidget *>("layout");
layoutContainer->layout()->addWidget(std::move(footer));
}
return footer_;
}
void WDialog::setResizable(bool resizable)
{
if (resizable != resizable_) {
resizable_ = resizable;
toggleStyleClass("Wt-resizable", resizable);
setSelectable(!resizable);
if (resizable)
contents_->setSelectable(true);
if (resizable_) {
Resizable::loadJavaScript(WApplication::instance());
setJavaScriptMember
(" Resizable",
"(new " WT_CLASS ".Resizable("
WT_CLASS "," + jsRef() + ")).onresize(function(w, h, done) {"
"var obj = " + jsRef() + ".wtObj;"
"if (obj) obj.onresize(w, h, done);"
" });");
}
}
}
void WDialog::setMovable(bool movable)
{
movable_ = movable;
}
void WDialog::setMaximumSize(const WLength& width, const WLength& height)
{
WPopupWidget::setMaximumSize(width, height);
WLength w = width.unit() != LengthUnit::Percentage ? width : WLength::Auto;
WLength h = height.unit() != LengthUnit::Percentage ? height : WLength::Auto;
impl_->resolveWidget("layout")->setMaximumSize(w, h);
}
void WDialog::setMinimumSize(const WLength& width, const WLength& height)
{
WPopupWidget::setMinimumSize(width, height);
impl_->resolveWidget("layout")->setMinimumSize(width, height);
}
void WDialog::render(WFlags<RenderFlag> flags)
{
if (flags.test(RenderFlag::Full)) {
WApplication *app = WApplication::instance();
bool centerX = offset(Side::Left).isAuto() && offset(Side::Right).isAuto(),
centerY = offset(Side::Top).isAuto() && offset(Side::Bottom).isAuto();
doJavaScript("new " WT_CLASS ".WDialog("
+ app->javaScriptClass() + "," + jsRef()
+ "," + titleBar_->jsRef()
+ "," + (movable_ ? "1" : "0")
+ "," + (centerX ? "1" : "0")
+ "," + (centerY ? "1" : "0")
+ "," + (moved_.isConnected()
? '"' + moved_.name() + '"'
: "null")
+ "," + (resized_.isConnected()
? '"' + resized_.name() + '"'
: "null")
+ ",\"" + zIndexChanged_.name() + '"'
+ ");");
for (std::size_t i = 0; i < delayedJs_.size(); ++i) {
doJavaScript(delayedJs_[i]);
}
delayedJs_.clear();
/*
* When a dialog is shown immediately for a new session, the recentering
* logic comes too late and causes a glitch. Thus we include directly in
* the HTML a JavaScript block to mitigate that
*/
if (!app->environment().agentIsIElt(9) &&
!app->environment().ajax()) {
std::string js = WString::tr("Wt.WDialog.CenterJS").toXhtmlUTF8();
Utils::replace(js, "$el", "'" + id() + "'");
Utils::replace(js, "$centerX", centerX ? "1" : "0");
Utils::replace(js, "$centerY", centerY ? "1" : "0");
impl_->bindString("center-script", "<script>" + js + "</script>", TextFormat::UnsafeXHTML);
} else
impl_->bindEmpty("center-script");
impl_->setCondition("if:theme-style-enabled", isThemeStyleEnabled());
impl_->setCondition("if:theme-style-disabled", !isThemeStyleEnabled());
if (isThemeStyleEnabled()) {
layoutContainer_->toggleStyleClass("movable", movable_);
}
if (caption_) {
caption_->setCondition("if:theme-style-enabled", isThemeStyleEnabled());
caption_->setCondition("if:theme-style-disabled", !isThemeStyleEnabled());
}
}
if (!isModal())
impl_->mouseWentDown().connect(this, &WDialog::bringToFront);
if ( flags.test(RenderFlag::Full) && autoFocus_) {
if (!impl_->findById(Wt::WApplication::instance()->focus()))
impl_->setFirstFocus();
}
WPopupWidget::render(flags);
}
void WDialog::onPathChange()
{
}
void WDialog::rejectWhenEscapePressed(bool enable)
{
escapeIsReject_ = enable;
}
void WDialog::setWindowTitle(const WString& windowTitle)
{
if (titleBar_->layout()) {
LOG_WARN("Cannot set window title when a layout is set on the title bar");
return;
}
if (!caption_) {
caption_ = titleBar_->addNew<WTemplate>(tr("Wt.WDialog.titlebar"));
caption_->addFunction("block", &WTemplate::Functions::block);
}
caption_->bindString("title", windowTitle, TextFormat::Plain);
}
WString WDialog::windowTitle() const
{
return caption_ ? caption_->resolveStringValue("title") : WString();
}
void WDialog::setTitleBarEnabled(bool enable)
{
titleBar_->setHidden(!enable);
}
void WDialog::setClosable(bool closable)
{
if (closable == this->closable()) {
return;
}
if (titleBar_->layout()) {
LOG_WARN("Cannot make the dialog closable when a layout is set on the title bar");
return;
}
if (closable) {
auto theme = WApplication::instance()->theme();
if (std::dynamic_pointer_cast<WBootstrap5Theme>(theme)) {
closeIcon_ = titleBar_->addNew<WPushButton>();
} else {
closeIcon_ = titleBar_->insertWidget(0, std::make_unique<WText>());
}
theme->apply(this, closeIcon_.get(), DialogCloseIcon);
closeIcon_->clicked().connect(this, &WDialog::reject);
} else {
titleBar_->removeWidget(closeIcon_.get());
closeIcon_ = nullptr;
}
}
DialogCode WDialog::exec(const WAnimation& animation)
{
if (recursiveEventLoop_)
throw WException("WDialog::exec(): already being executed.");
animateShow(animation);
#ifdef WT_TARGET_JAVA
if (!WebController::isAsyncSupported())
throw WException("WDialog#exec() requires a Servlet 3.0 enabled servlet "
"container and an application with async-supported "
"enabled.");
#endif
WApplication *app = WApplication::instance();
recursiveEventLoop_ = true;
if (app->environment().isTest()) {
app->environment().dialogExecuted().emit(this);
if (recursiveEventLoop_)
throw WException("Test case must close dialog");
} else {
do {
app->waitForEvent();
} while (recursiveEventLoop_);
}
hide();
return result_;
}
void WDialog::done(DialogCode result)
{
if (isHidden())
return;
result_ = result;
if (recursiveEventLoop_) {
recursiveEventLoop_ = false;
} else
hide();
finished_.emit(result);
}
void WDialog::accept()
{
done(DialogCode::Accepted);
}
void WDialog::reject()
{
done(DialogCode::Rejected);
}
void WDialog::setModal(bool modal)
{
modal_ = modal;
}
void WDialog::onDefaultPressed()
{
DialogCover *c = cover();
if (footer_ && c && c->isTopDialogRendered(this)) {
for (int i = 0; i < footer()->count(); ++i) {
WPushButton *b = dynamic_cast<WPushButton *>(footer()->widget(i));
if (b && b->isDefault()) {
if (b->isEnabled())
b->clicked().emit(WMouseEvent());
break;
}
}
}
}
void WDialog::onEscapePressed()
{
DialogCover *c = cover();
if (c && c->isTopDialogRendered(this))
reject();
}
void WDialog::setHidden(bool hidden, const WAnimation& animation)
{
/* For JWt: setHidden() is called from WPopupWidget constructor. */
if (contents_ && isHidden() != hidden) {
if (!hidden) {
if (footer_) {
for (int i = 0; i < footer()->count(); ++i) {
WPushButton *b = dynamic_cast<WPushButton *>(footer()->widget(i));
if (b && b->isDefault()) {
enterConnection1_ = enterPressed()
.connect(this, &WDialog::onDefaultPressed);
enterConnection2_ = impl_->enterPressed()
.connect(this, &WDialog::onDefaultPressed);
break;
}
}
}
if (escapeIsReject_) {
if (isModal()) {
escapeConnection1_ = escapePressed()
.connect(this, &WDialog::onEscapePressed);
} else {
escapeConnection1_ = WApplication::instance()->globalEscapePressed()
.connect(this, &WDialog::onEscapePressed);
}
escapeConnection2_ = impl_->escapePressed()
.connect(this, &WDialog::onEscapePressed);
}
} else {
escapeConnection1_.disconnect();
escapeConnection2_.disconnect();
enterConnection1_.disconnect();
enterConnection2_.disconnect();
}
DialogCover *c = cover();
if (!hidden) {
if ((!WWebWidget::canOptimizeUpdates() || isRendered()) && offset(Side::Left).isAuto()) {
doJavaScript("var o = " + jsRef() + ";"
"if (o && o.wtObj) o.wtObj.centerDialog();");
}
if (c)
c->pushDialog(this, animation);
if (modal_) {
doJSAfterLoad
("try {"
"""var ae=document.activeElement;"
// On IE when a dialog is shown on startup, activeElement is the
// body. Bluring the body sends the window to the background if
// it is the only tab.
// http://redmine.emweb.be/boards/2/topics/6415
"""if (ae && ae.blur && ae.nodeName != 'BODY') {"
"" "document.activeElement.blur();"
"}"
"} catch (e) { }");
}
} else {
if (c)
c->popDialog(this, animation);
}
}
WPopupWidget::setHidden(hidden, animation);
}
void WDialog::positionAt(const WWidget *widget, Orientation orientation,
WFlags<Orientation> adjustOrientations)
{
setPositionScheme(PositionScheme::Absolute);
if (wApp->environment().javaScript())
setOffsets(0, Side::Left | Side::Top);
WPopupWidget::positionAt(widget, orientation, adjustOrientations);
}
void WDialog::positionAt(const Wt::WMouseEvent& ev)
{
setPositionScheme(PositionScheme::Fixed);
if (wApp->environment().javaScript()) {
setOffsets(ev.window().x, Side::Left);
setOffsets(ev.window().y, Side::Top);
}
if (isHidden())
show();
}
DialogCover *WDialog::cover()
{
WApplication *app = WApplication::instance();
if (app->domRoot()) {
WWidget *w = app->findWidget("dialog-cover");
if (w)
return dynamic_cast<DialogCover *>(w);
else {
std::unique_ptr<DialogCover> d(new DialogCover());
auto result = d.get();
app->addGlobalWidget(result);
#ifndef WT_TARGET_JAVA
app->addChild(std::move(d));
#endif // WT_TARGET_JAVA
return result;
}
} else
return 0;
}
void WDialog::bringToFront(const WMouseEvent &e)
{
if (e.button() == MouseButton::Left &&
e.modifiers() == KeyboardModifier::None) {
raiseToFront();
}
}
void WDialog::raiseToFront()
{
doJSAfterLoad(jsRef() + ".wtObj.bringToFront()");
DialogCover *c = cover();
c->bringToFront(this);
}
void WDialog::zIndexChanged(int zIndex)
{
impl_->layoutImpl_->zIndex_ = zIndex;
}
EventSignal<WKeyEvent>& WDialog::keyWentDown()
{
return layoutContainer_->keyWentDown();
}
EventSignal<WKeyEvent>& WDialog::keyWentUp()
{
return layoutContainer_->keyWentUp();
}
EventSignal<WKeyEvent>& WDialog::keyPressed()
{
return layoutContainer_->keyPressed();
}
EventSignal<>& WDialog::enterPressed()
{
return layoutContainer_->enterPressed();
}
EventSignal<>& WDialog::escapePressed()
{
return layoutContainer_->escapePressed();
}
EventSignal<WTouchEvent>& WDialog::touchStarted()
{
return layoutContainer_->touchStarted();
}
EventSignal<WTouchEvent>& WDialog::touchEnded()
{
return layoutContainer_->touchEnded();
}
EventSignal<WTouchEvent>& WDialog::touchMoved()
{
return layoutContainer_->touchMoved();
}
void WDialog::doJSAfterLoad(std::string js)
{
if (isRendered())
doJavaScript(js);
else
delayedJs_.push_back(js);
}
}