source: PSPA/Interface_Web/trunk/pspaWT/src/GWt_tools.cc @ 240

Last change on this file since 240 was 240, checked in by garnier, 11 years ago

Correction de la console qui est désormais une classe à part et initilisée une

File size: 520 bytes
Line 
1#include "GWt_tools.h"
2
3#include <Wt/WApplication>
4#include <Wt/WText>
5
6GWt_console::GWt_console()
7:WContainerWidget()
8{
9}
10
11
12GWt_console::~GWt_console()
13{
14}
15
16
17void GWt_console::addConsoleMessage(WString msg) {
18
19  WText *w = new WText(this);
20  w->setTextFormat(PlainText);
21  w->setText(msg);
22  w->setInline(false);
23 
24  /*
25   * Little javascript trick to make sure we scroll along with new content
26   */
27  wApp->doJavaScript(this->jsRef() + ".scrollTop += "
28                    + this->jsRef() + ".scrollHeight;");
29 
30}
31
Note: See TracBrowser for help on using the repository browser.