Wt examples 3.1.10
|
00001 // This may look like C code, but it's really -*- C++ -*- 00002 /* 00003 * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium. 00004 * 00005 * See the LICENSE file for terms of use. 00006 */ 00007 00008 #ifndef FORM_H_ 00009 #define FORM_H_ 00010 00011 #include <Wt/WTable> 00012 00013 using namespace Wt; 00014 00015 namespace Wt { 00016 class WContainerWidget; 00017 class WText; 00018 class WTextArea; 00019 class WLineEdit; 00020 class WComboBox; 00021 class WFormWidget; 00022 class WDatePicker; 00023 } 00024 00029 00035 class Form : public WTable 00036 { 00037 public: 00040 Form(WContainerWidget *parent = 0); 00041 00042 private: 00045 void countryChanged(); 00046 00049 void submit(); 00050 00051 void createUI(); 00052 00053 WContainerWidget *feedbackMessages_; 00054 00055 WLineEdit *nameEdit_; 00056 WLineEdit *firstNameEdit_; 00057 00058 WComboBox *countryEdit_; 00059 WComboBox *cityEdit_; 00060 00061 WDatePicker *birthDateEdit_; 00062 WLineEdit *childCountEdit_; 00063 WLineEdit *weightEdit_; 00064 00065 WTextArea *remarksEdit_; 00066 00069 void addValidationStatus(int row, WFormWidget *field); 00070 00073 bool validate(); 00074 00080 bool checkValid(WFormWidget *edit, const WString& text); 00081 }; 00082 00085 #endif // FORM_H_