00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _GENERATORTOOL_H_
00011 #define _GENERATORTOOL_H_
00012
00013
00014
00015
00016
00017
00018
00019 #include <wx/wx.h>
00020 #include <wx/textfile.h>
00021 #include <wx/db.h>
00022 #include <wx/utils.h>
00023 #include <wx/dbtable.h>
00024 #include <wx/grid.h>
00025 #include <wx/progdlg.h>
00026 #include "stdlib.h"
00027 #include <iostream>
00028
00029 class
00030 GeneratorToolapp : public wxApp
00031 {
00032 public:
00033 virtual bool OnInit();
00034
00035 };
00036
00037 class
00038 GeneratorToolFrame : public wxFrame
00039 {
00040 public:
00041 GeneratorToolFrame( const wxString& title, const wxPoint& pos, const wxSize& pos, long style,const wxString& name );
00042 ~GeneratorToolFrame();
00043 void OnQuit( wxCommandEvent& event );
00044 void OnAbout( wxCommandEvent& event );
00045 void OnButtonLogin( wxCommandEvent& event );
00046 void OnButtonLogout( wxCommandEvent& event );
00047 void OnButtonLaunch( wxCommandEvent& event );
00048
00049 void set_properties();
00050 void do_layout();
00051 void DbEstb();
00052 wxString IntToWxstring(int id);
00053
00054 void InstantiateForm(int id, int x, int y, int w, int h, int type, int style, wxString title, int isindex);
00055 void InstantiateObject(int type, int formid, int oid, wxString olabel,wxString odefault, int ox, int oy, int ow, int oh, int ostyle, int oAttrtype);
00056 void RefreshGrid(int formid, int objectid);
00057 void FormGenericEventFunc(wxCommandEvent& event);
00058 void MenuGenericEventFunc(wxCommandEvent& event);
00059 void ButtonGenericEventFunc(wxCommandEvent& event);
00060 void StaticTextGenericEventFunc(wxCommandEvent& event);
00061 void TextCtrlGenericEventFunc(wxCommandEvent& event);
00062
00063 private:
00064 DECLARE_EVENT_TABLE()
00065
00066 wxDbConnectInf *DbConnectInf;
00067 wxDb *dbFastApp;
00068
00069 wxDbConnectInf *UserDbConnectInf;
00070 wxDb *dbUser;
00071
00072
00073
00074 wxHashTable formtable;
00075 wxHashTable objecttable;
00076
00077
00078
00079
00080
00081
00082
00083 wxDbTable *tbFa_Db;
00084 wxChar sDbname[50+1],sDsnname[50+1];
00085 long sDbid, sNooftables;
00086
00087
00088 wxDbTable *tbFa_Inifile;
00089 wxChar sLastdateupdated[50+1],sLasttimeupdated[50+1],sFilelocation[50+1],sScphost[50+1], sScpuser[50+1], sScppw[50+1];
00090
00091
00092 wxDbTable *tbFa_Appform;
00093 long sAF_Appid, sAF_Formid;
00094
00095
00096 wxDbTable *tbFa_Tabledef;
00097 wxChar sTablename[50+1];
00098 long sTableid, sNoofcolumns,sTD_Deleted;
00099
00100
00101 wxDbTable *tbFa_Dbtable;
00102 long sDBT_Dbid, sDBT_Tabid;
00103
00104
00105 wxDbTable* tbFa_Columndef;
00106 wxChar sAttrname[50+1], sAttrdefault[50+1];
00107 long sColid, sAttrtype, sAttrlength, sAttrpkey, sFkeytableid, sFkeyattrib,sCD_Deleted;
00108
00109
00110 wxDbTable *tbFa_Tablecol;
00111 long sTC_Tabid, sTC_Colid;
00112
00113
00114 wxDbTable *tbFa_Language;
00115 wxChar sLanguage[100+1],sLstyle[100+1];
00116 long sLid, sFont;
00117
00118
00119 wxDbTable *tbFa_App;
00120 wxChar sAppname[50+1], sSusername[50+1],sSpassword[50+1];
00121 long sAppid, sSuserid, sSdbid, sAppformid;
00122
00123
00124 wxDbTable *tbFa_Process;
00125 wxChar sPid[50+1],sProcessdesc[150+1];
00126 long sEventid;
00127
00128
00129 wxDbTable *tbFa_Form;
00130 long sFid, sFormx, sFormy, sFormw, sFormh, sFormtype, sFormstyle, sInitialisation, sPreprocessing, sPostprocessing,sIsindex;
00131 wxChar sCaption[50+1];
00132
00133
00134 wxDbTable *tbFa_Object;
00135 long sFormid, sObjid, sChildid, sLangid, sObjx, sObjy, sObjw, sObjh, sObjtype, sObjstyle ;
00136 wxChar sObjlabel[50+1], sObjdefault[50+1], sAttrtable[50+1], sAttr[50+1], sOT_Eventid[50+1],sO_Attrtype[50+1];
00137
00138
00139
00140
00141 int noforms;
00142
00143
00144
00145 wxBoxSizer* frameSizer;
00146 wxFlexGridSizer* grid_sizer_1;
00147 wxFlexGridSizer* grid_sizer_2;
00148 wxBoxSizer *ButtonBox;
00149
00150
00151 wxString *arrAppname;
00152 int *arrAppid, *arrSdbid, *arrAppformid, *arrFormid;
00153
00154
00155
00156
00157 wxStaticText* loginStaticText;
00158 wxStaticText* dummy;
00159 wxStaticText* nameStaticText;
00160 wxTextCtrl* usernameTextCtrl;
00161 wxTextCtrl* passwordTextCtrl;
00162 wxStaticText* passwordStaticText;
00163 wxButton* loginButton;
00164 wxButton* logoutButton;
00165
00166 wxListBox *appListBox;
00167 wxStaticText* applistStaticText;
00168 wxButton *launchButton;
00169 };
00170
00171 enum
00172 {
00173 Menu_File_Quit = 100,
00174 Menu_File_About,
00175 ID_BTN_LOGIN,
00176 ID_TCTRL_PW,
00177 ID_BTN_LAUNCH,
00178 ID_BTN_LOGOUT,
00179 ID_LB_APPLIST
00180 };
00181 wxString strDsnname;
00182 #endif // _GENERATORTOOL_H_