Ignore:
Timestamp:
Mar 27, 2013, 5:47:22 PM (11 years ago)
Author:
garnier
Message:

merge avec la branche 12_03_12-managerComboBox

Location:
Interface_Web/trunk/pspaWT
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT

  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc

    r272 r401  
    33#include <Wt/WApplication>
    44#include <Wt/WText>
     5#include <Wt/WBorder>
     6#include <Wt/WLayout>
     7#include <Wt/WPanel>
     8#include <Wt/WScrollArea>
    59
    610GWt_console::GWt_console()
     
    812{
    913    setObjectName("console");
     14
     15    // le panel
     16    WPanel *panelConsole = new WPanel(this);
     17    WScrollArea* container = new  WScrollArea();
     18   
     19    panelConsole->setTitle(" output");
     20    output_ = new WText(this);
     21    output_->setTextFormat(PlainText);
     22    output_->setInline(false);
     23
     24    container->setWidget(output_);
     25
     26    panelConsole->setCentralWidget(container);
     27    output_->setMinimumSize(270,100);
     28    output_->setMaximumSize(400,400);
     29
     30
    1031}
    1132
     
    1839void GWt_console::addConsoleMessage(WString msg) {
    1940   
    20     WText *w = new WText(this);
    21     w->setTextFormat(PlainText);
    22     w->setText(msg);
    23     w->setInline(false);
     41    output_->setText(output_->text()+msg);
    2442   
    2543    /*
    2644     * Little javascript trick to make sure we scroll along with new content
    2745     */
    28     wApp->doJavaScript(this->jsRef() + ".scrollTop += "
    29                        + this->jsRef() + ".scrollHeight;");
     46    wApp->doJavaScript(output_->jsRef() + ".scrollTop += "
     47                       + output_->jsRef() + ".scrollHeight;");
    3048   
    3149}
Note: See TracChangeset for help on using the changeset viewer.