本文整理汇总了C++中wt::WPushButton::disable方法的典型用法代码示例。如果您正苦于以下问题:C++ WPushButton::disable方法的具体用法?C++ WPushButton::disable怎么用?C++ WPushButton::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wt::WPushButton
的用法示例。
在下文中一共展示了WPushButton::disable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
Upload::Upload( Wt::WContainerWidget* pcw ) {
//Wt::WContainerWidget *container = new Wt::WContainerWidget();
Wt::WFileUpload *fu = new Wt::WFileUpload( pcw );
fu->setFileTextSize( 10000 ); // Set the maximum file size (in KB )
fu->setProgressBar(new Wt::WProgressBar());
fu->setMargin(10, Wt::Right);
// Provide a button to start uploading.
Wt::WPushButton *uploadButton = new Wt::WPushButton("Send", pcw );
uploadButton->setMargin(10, Wt::Left | Wt::Right);
Wt::WText *out = new Wt::WText( pcw );
// Upload when the button is clicked.
uploadButton->clicked().connect(std::bind([=] () {
fu->upload();
uploadButton->disable();
}));
// Upload automatically when the user entered a file.
fu->changed().connect(std::bind([=] () {
fu->upload();
uploadButton->disable();
std::string s( "File upload is changed." );
out->setText( s );
}));
// React to a succesfull upload.
fu->uploaded().connect(std::bind([=] () {
std::string s( "File upload is finished: " );
s += fu->clientFileName().toUTF8();
s += ",";
//s += fu->fileTextSize()
s += fu->spoolFileName();
//fu->stealSpooledFile()
out->setText( s );
}));
// React to a file upload problem.
fu->fileTooLarge().connect(std::bind([=] () {
out->setText("File is too large.");
}));
}