Changeset 174 in PSPA
- Timestamp:
- Dec 12, 2012, 12:03:54 PM (12 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/include/GWt_dialog.h
r148 r174 4 4 #include <Wt/WDialog> 5 5 #include <Wt/WString> 6 #include <Wt/WContainerWidget> 6 7 7 8 using namespace Wt; … … 22 23 enum iconType { Warning, Error, Info, Wait, NoIcon }; 23 24 25 /** Add a dialog with the given container inside 26 @param titre: A title displayed on the window title bar 27 @param message: The message inside this dialog 28 @param container: a valid WContainer 29 */ 30 GWt_dialog(WString titre, WContainerWidget* container, bool modal=false); 31 32 /** Add a full dialog window configure with title, message, iconType and button 33 @param titre: A title displayed on the window title bar 34 @param message: The message inside this dialog 35 @param icon: IconType, could be Warning, Error, Info, Wait or NoIcon 36 @param modal: true for a blocking dialog, false for a non-blocking dialog 37 @param okButton: true if you want a "ok" button at the end 38 */ 24 39 GWt_dialog(WString titre, std::string message, iconType icon=NoIcon, bool modal=false, bool okButton=false); 25 40 }; -
Interface_Web/trunk/pspaWT/include/GWt_pspaApplication.h
r173 r174 46 46 WContainerWidget* contenuSections_; 47 47 list<GWt_sectionToExecute*> selectedSections_; 48 WFileUpload* uploadFileSelectorWidget; 48 49 49 50 WText* createTitle(const WString&); … … 59 60 void restaurer(); 60 61 void chargerConfig(); 62 void openFileSelector(); 61 63 void dessiner(); 62 64 -
Interface_Web/trunk/pspaWT/src/GWt_LigneFaisceau.cc
r170 r174 126 126 127 127 message_= new GWt_dialog("Question","Are you sure you want to delete the selected item?",GWt_dialog::Warning,true,true); 128 message_->setClosable(true);129 128 130 129 WSignalMapper<GWt_abstractElement *> *MyMap = new WSignalMapper<GWt_abstractElement *>(this); -
Interface_Web/trunk/pspaWT/src/GWt_dialog.cc
r163 r174 7 7 #include <Wt/WCssDecorationStyle> 8 8 #include "GWt_dialog.h" 9 10 GWt_dialog::GWt_dialog( 11 WString titre, 12 WContainerWidget* wc, 13 bool modal 14 ): 15 WDialog(titre) 16 { 17 18 // change the title bar style 19 titleBar()->decorationStyle().setBackgroundColor (WColor(70,180,220)); 20 21 WContainerWidget* widgt = new WContainerWidget(contents()); 22 widgt->addWidget(wc); 23 24 setClosable(true); 25 setModal (modal); 26 } 27 28 9 29 10 30 GWt_dialog::GWt_dialog( … … 82 102 widgt->setLayout(hLayout); 83 103 104 setClosable(true); 84 105 setModal (modal); 85 106 } -
Interface_Web/trunk/pspaWT/src/GWt_pspaApplication.cc
r173 r174 63 63 // boutonLoadNew->setMinimumSize(30,30); 64 64 65 // uploadWidget = new WFileUpload(w);66 WContainerWidget *result = new WContainerWidget();67 WFileUpload *const uploadWidget = new WFileUpload(result);68 uploadWidget->setFileTextSize(40);69 70 65 // Upload when the button is clicked. 71 boutonLoadNew->clicked().connect(uploadWidget, &WFileUpload::upload);72 // boutonLoadNew->clicked().connect(boutonLoadNew, &Wt::WPushButton::disable);73 74 // Upload automatically when the user entered a file.75 uploadWidget->changed().connect(uploadWidget, &WFileUpload::upload);76 // uploadWidget->changed().connect(boutonLoadNew, &Wt::WPushButton::disable);77 78 66 // React to a succesfull upload. 79 uploadWidget->uploaded().connect(this, &PspaApplication::chargerConfig); 80 81 // React to a fileupload problem. 82 // upload->fileTooLarge().connect(this, &MyWidget::fileTooLarge); 83 67 boutonLoadNew->clicked().connect(this, &PspaApplication::openFileSelector); 84 68 85 69 … … 88 72 toolbarLayout->addWidget(boutonRestaure , 1); 89 73 toolbarLayout->addWidget(boutonLoadNew , 1); 90 toolbarLayout->addWidget(result , 1);91 74 boutonSauve->clicked().connect(this, &PspaApplication::sauver); 92 75 boutonRestaure->clicked().connect(this, &PspaApplication::restaurer); … … 476 459 } 477 460 461 462 void PspaApplication::openFileSelector() 463 { 464 465 WContainerWidget *result = new WContainerWidget(); 466 uploadFileSelectorWidget = new WFileUpload(result); 467 uploadFileSelectorWidget->setFileTextSize(40); 468 469 // Upload automatically when the user entered a file. 470 uploadFileSelectorWidget->changed().connect(uploadFileSelectorWidget, &WFileUpload::upload); 471 // uploadFileSelectorWidget->changed().connect(boutonLoadNew, &Wt::WPushButton::disable); 472 473 // React to a succesfull upload. 474 uploadFileSelectorWidget->uploaded().connect(this, &PspaApplication::chargerConfig); 475 476 // React to a fileupload problem. 477 //... upload->fileTooLarge().connect(this, &MyWidget::fileTooLarge); 478 479 480 GWt_dialog* fileSelectorDialog = new GWt_dialog("Load a file",result,false); 481 482 fileSelectorDialog->exec(); 483 } 484 485 478 486 void PspaApplication::chargerConfig() 479 487 { 480 // std::string filename = uploadWidget->spoolFileName(); 481 // addConsoleMessage(string("chargement de la configuration...:"+filename)); 482 } 488 GWt_dialog* message= new GWt_dialog("Info","The file has been correctly upload to" + uploadFileSelectorWidget->spoolFileName(),GWt_dialog::Warning,false,true); 489 490 message->show(); 491 } 492 483 493 484 494 void PspaApplication::faireDessin()
Note: See TracChangeset
for help on using the changeset viewer.