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 slots: 00045 void countryChanged(); 00046 00049 void submit(); 00050 00051 private: 00052 void createUI(); 00053 00054 WContainerWidget *feedbackMessages_; 00055 00056 WLineEdit *nameEdit_; 00057 WLineEdit *firstNameEdit_; 00058 00059 WComboBox *countryEdit_; 00060 WComboBox *cityEdit_; 00061 00062 WDatePicker *birthDateEdit_; 00063 WLineEdit *childCountEdit_; 00064 WLineEdit *weightEdit_; 00065 00066 WTextArea *remarksEdit_; 00067 00070 void addValidationStatus(int row, WFormWidget *field); 00071 00074 bool validate(); 00075 00081 bool checkValid(WFormWidget *edit, const WString& text); 00082 }; 00083 00086 #endif // FORM_H_