X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f030b480459cf4067aac2fb74bff91f81f2a361..0d8b87ac8ae0ababd4c0d725142532f6d592fdb2:/samples/db/dbtest.h?ds=sidebyside diff --git a/samples/db/dbtest.h b/samples/db/dbtest.h index 089f79004f..eb5b691081 100644 --- a/samples/db/dbtest.h +++ b/samples/db/dbtest.h @@ -9,12 +9,12 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "dbtest.h" #endif -#include -#include +#include "wx/string.h" +#include "wx/dbtable.h" enum DialogModes {mView,mCreate,mEdit,mSearch}; @@ -22,6 +22,9 @@ enum DialogModes {mView,mCreate,mEdit,mSearch}; #define FILE_CREATE 100 #define FILE_RECREATE_TABLE 110 #define FILE_RECREATE_INDEXES 120 +#if wxUSE_NEW_GRID +#define FILE_DBGRID_TABLE 130 +#endif #define FILE_EXIT 199 #define EDIT_PARAMETERS 200 #define HELP_ABOUT 300 @@ -39,7 +42,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch}; const wxChar CONTACT_TABLE_NAME[] = "contacts"; -#define wxODBC_BLOB_EXPERIMENT 0 +#define wxODBC_BLOB_EXPERIMENT 1 // Number of columns in the CONTACT table #if wxODBC_BLOB_EXPERIMENT > 0 @@ -129,7 +132,7 @@ class Ccontact : public wxDbTable, public CstructContact // Contains all the index definitions and calls to wxDbTable::CreateIndex() // required to create all the indexes we wish to define for this table. - bool CreateIndexes(void); + bool CreateIndexes(bool recreate); // Since we do not wish to have duplicate code blocks all over our program // for a common query/fetch that we will need to do in many places, we @@ -166,7 +169,10 @@ class DatabaseDemoFrame: public wxFrame void OnExit(wxCommandEvent& event); void OnEditParameters(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); - +#if wxUSE_NEW_GRID + void OnDbGridTable( wxCommandEvent& ); +#endif + void CreateDataTable(bool recreate); void BuildEditorDialog(); void BuildParameterDialog(wxWindow *parent); @@ -174,6 +180,25 @@ DECLARE_EVENT_TABLE() }; // DatabaseDemoFrame +#if wxUSE_NEW_GRID + +// *************************** DBGridFrame *************************** + +class DbGridFrame : public wxFrame +{ +public: + bool initialized; + + DbGridFrame(wxWindow *parent); + + void OnCloseWindow(wxCloseEvent& event); + bool Initialize(); + + DECLARE_EVENT_TABLE() +}; + +#endif + // Define a new application type class DatabaseDemoApp: public wxApp { @@ -252,7 +277,7 @@ class CeditorDlg : public wxPanel wxButton *pCreateBtn, *pEditBtn, *pDeleteBtn, *pCopyBtn, *pSaveBtn, *pCancelBtn; wxButton *pPrevBtn, *pNextBtn, *pQueryBtn, *pResetBtn, *pDoneBtn, *pHelpBtn; wxButton *pNameListBtn; - wxButton *pDataTypesBtn, *pDbDiagsBtn; + wxButton *pCatalogBtn, *pDataTypesBtn, *pDbDiagsBtn; wxTextCtrl *pNameTxt, *pAddress1Txt, *pAddress2Txt,*pCityTxt, *pStateTxt, *pCountryTxt,*pPostalCodeTxt; wxStaticText *pNameMsg, *pAddress1Msg, *pAddress2Msg,*pCityMsg, *pStateMsg, *pCountryMsg,*pPostalCodeMsg; wxTextCtrl *pJoinDateTxt,*pContribTxt, *pLinesTxt; @@ -348,6 +373,7 @@ DECLARE_EVENT_TABLE() #define EDITOR_DIALOG_DEVELOPER 236 #define EDITOR_DIALOG_JOIN_MSG 237 #define EDITOR_DIALOG_JOIN_TEXT 238 +#define EDITOR_DIALOG_CATALOG 240 #define EDITOR_DIALOG_DATATYPES 250 #define EDITOR_DIALOG_DB_DIAGS 260