Project

General

Profile

Bug #3984 ยป Ticket3984.cpp

slightly modified version - Stefan Ruppert, 06/01/2015 07:09 PM

 
#include <Wt/WApplication>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <Wt/WDialog>
#include <Wt/WMenu>
#include <Wt/WMenuItem>
#include <Wt/WPopupMenu>
#include <iostream>

#include <Wt/WDoubleSpinBox>
#include <Wt/WPushButton>


using namespace Wt;

class TestReadOnlyDSpinBox
: public Wt::WApplication
{
public:
TestReadOnlyDSpinBox( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{

WDialog *dialog = new WDialog();

box_ = new WDoubleSpinBox(dialog->contents());
button_ = new WPushButton("enable and readonly");
dialog->footer()->addWidget(button_);

box_->setDisabled(true);
box_->setMinimum(0);
box_->setMaximum(200);

button_->clicked().connect(this, &TestReadOnlyDSpinBox::mySetReadOnly);

dialog->show();
}

void mySetReadOnly()
{
box_->setReadOnly(true);
box_->setDisabled(false);
}
private:
WDoubleSpinBox *box_;
WPushButton *button_;
};
WApplication *createApplication(const WEnvironment& env)
{
return new TestReadOnlyDSpinBox(env);
}

int main(int argc, char **argv) {
return WRun(argc, argv, &createApplication);
}
    (1-1/1)