00001 // **************************************************************************** 00002 // copyright (c) 2000-2004 Horst Knorr <hk_classes@knoda.org> 00003 // This file is part of the hk_classes library. 00004 // This file may be distributed and/or modified under the terms of the 00005 // GNU Library Public License version 2 as published by the Free Software 00006 // Foundation and appearing in the file COPYING included in the 00007 // packaging of this file. 00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00010 // **************************************************************************** 00011 #ifndef HK_FORM_H 00012 #define HK_FORM_H 00013 #include "hk_presentation.h" 00014 using namespace std; 00015 00016 class hk_dslineedit; 00017 class hk_dsgrid; 00018 class hk_dsboolean; 00019 class hk_dsrowselector; 00020 class hk_dscombobox; 00021 class hk_dsmemo; 00022 class hk_button; 00023 class hk_label; 00024 class hk_formprivate; 00025 class hk_subform; 00038 class hk_form:public hk_presentation 00039 { 00040 friend class hk_dsvisible; 00041 friend class hk_visible; 00042 00043 public: 00044 00045 hk_form(void); 00046 virtual ~hk_form(void); 00052 hk_dsgrid* new_grid(void); 00058 hk_dslineedit* new_lineedit(void); 00064 hk_dsboolean* new_bool(void); 00070 hk_dscombobox* new_combobox(void); 00076 hk_button* new_button(void); 00082 hk_dsrowselector* new_rowselector(void); 00088 hk_dsmemo* new_memo(void); 00094 hk_label* new_label(void); 00095 00096 hk_subform* new_subform(void); 00097 00104 bool save_form(const hk_string& name="",bool ask=true); 00110 void load_form(const hk_string& name=""); 00111 virtual void savedata(ostream& s); 00112 virtual void loaddata(const hk_string& definition); 00113 00119 virtual void set_designsize(unsigned int width, unsigned int height,bool registerchange=true); 00120 hk_visible* get_visible(long nr); 00121 hk_visible* get_visible(const hk_string& identifier); 00122 virtual void bulk_operation(enum_bulkoperation bulkoperation); 00123 virtual bool set_mode(enum_mode s); 00127 hk_form* masterform(void) const; 00131 void clear_visiblelist(void); 00132 00133 00134 protected: 00135 void set_masterform(hk_form*); 00136 virtual hk_dsgrid* widget_specific_new_grid(void){return NULL;} 00137 virtual hk_dsrowselector* widget_specific_new_rowselector(void){return NULL;} 00138 virtual hk_dslineedit* widget_specific_new_lineedit(void){return NULL;} 00139 virtual hk_dsboolean* widget_specific_new_bool(void){return NULL;} 00140 virtual hk_button* widget_specific_new_button(void){return NULL;} 00141 virtual hk_dscombobox* widget_specific_new_combobox(void){return NULL;} 00142 virtual hk_dsmemo* widget_specific_new_memo(void){return NULL;} 00143 virtual hk_label* widget_specific_new_label(void){return NULL;} 00144 virtual hk_subform* widget_specific_new_subform(void){return NULL;} 00145 virtual void widget_specific_fieldresize(hk_visible* v); 00146 virtual void widget_specific_after_loadform(void){} 00147 list<hk_visible*>* visibles(void); 00148 void remove_visible(hk_visible* v); 00149 hk_visible* new_object(const hk_string& name); 00150 void raise_widget(hk_visible*); 00151 void lower_widget(hk_visible*); 00152 virtual void sizetype_changed(void); 00153 private: 00154 void add_visible(hk_visible* v); 00155 hk_formprivate* p_private; 00156 }; 00157 #endif
1.4.1