#endif
// Name of the table to be created/opened
-const wxChar CONTACT_TABLE_NAME[] = wxT("contacts");
+const wxString CONTACT_TABLE_NAME = wxT("CONTACTS");
#define wxODBC_BLOB_SUPPORT
+
// Number of columns in the CONTACT table
#ifdef wxODBC_BLOB_SUPPORT
- const int CONTACT_NO_COLS = 13; // 0-12
+ const int CONTACT_NO_COLS = 14; // 0-13
+ const int MAX_PICTURE_SIZE = 128000; // in bytes
#else
- const int CONTACT_NO_COLS = 12; // 0-11
+ const int CONTACT_NO_COLS = 12; // 0-11
#endif
-const wxChar PARAM_FILENAME[] = wxT("dbtest.cfg");
-
+const wxString PARAM_FILENAME = wxT("dbtest.cfg");
enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER};
wxChar Country[20+1];
TIMESTAMP_STRUCT JoinDate; // Date on which this person joined the wxWidgets project
Language NativeLanguage; // Enumerated type indicating person's native language
- wxChar Picture[50000];
+ ULONG BlobSize;
+ wxChar Picture[MAX_PICTURE_SIZE];
bool IsDeveloper; // Is this person a developer for wxWidgets, or just a subscriber
UCHAR Contributions; // Something to show off an integer field
ULONG LinesOfCode; // Something to show off a 'long' field
wxRadioBox *pDeveloperRadio;
wxChoice *pNativeLangChoice;
wxStaticText *pNativeLangMsg;
+#ifdef wxODBC_BLOB_SUPPORT
+ wxStaticText *pPictureMsg, *pPictSizeMsg;
+ wxButton *pChooseImageBtn, *pShowImageBtn;
+ wxTextCtrl *pPictSizeTxt;
+#endif
public:
// Indicates if the editor dialog has been initialized yet (used to
bool Initialize();
+#ifdef wxODBC_BLOB_SUPPORT
+ // Methods for reading image file into current table, and
+ // also displaying the image.
+ void OnSelectPict();
+ void OnShowImage();
+#endif
+
// Sets wxStaticText fields to be editable or not depending
// on the current value of 'mode'
void FieldsEditable();
#define EDITOR_DIALOG_CATALOG 240
#define EDITOR_DIALOG_DATATYPES 250
#define EDITOR_DIALOG_DB_DIAGS 260
+#ifdef wxODBC_BLOB_SUPPORT
+ #define EDITOR_DIALOG_PIC_MSG 270
+ #define EDITOR_DIALOG_PICSIZE_MSG 271
+ #define EDITOR_DIALOG_PIC_BROWSE 272
+ #define EDITOR_DIALOG_PIC_SHOW 273
+ #define EDITOR_DIALOG_PIC_SIZE_TEXT 274
+#endif
// *************************** CparameterDlg ***************************
// Query strings
-wxChar * const langQRY_EQ = wxT("column = column | value");
-wxChar * const langQRY_LT = wxT("column < column | value");
-wxChar * const langQRY_GT = wxT("column > column | value");
-wxChar * const langQRY_LE = wxT("column <= column | value");
-wxChar * const langQRY_GE = wxT("column >= column | value");
-wxChar * const langQRY_BEGINS = wxT("columns that BEGIN with the string entered");
-wxChar * const langQRY_CONTAINS = wxT("columns that CONTAIN the string entered");
-wxChar * const langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char");
-wxChar * const langQRY_BETWEEN = wxT("column BETWEEN value AND value");
+wxString const & langQRY_EQ = wxT("column = column | value");
+const wxString & langQRY_LT = wxT("column < column | value");
+const wxString & langQRY_GT = wxT("column > column | value");
+const wxString & langQRY_LE = wxT("column <= column | value");
+const wxString & langQRY_GE = wxT("column >= column | value");
+const wxString & langQRY_BEGINS = wxT("columns that BEGIN with the string entered");
+const wxString & langQRY_CONTAINS = wxT("columns that CONTAIN the string entered");
+const wxString & langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char");
+const wxString & langQRY_BETWEEN = wxT("column BETWEEN value AND value");
class CqueryDlg : public wxDialog
wxTextCtrl *pFocusTxt;
CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], const wxString &pWhereArg);
- ~CqueryDlg(){};
+ ~CqueryDlg();
void OnButton( wxCommandEvent &event );
void OnCommand(wxWindow& win, wxCommandEvent& event);
#define QUERY_DIALOG_HINT_GROUP 323
#define QUERY_DIALOG_HINT_MSG 324
+#ifdef wxODBC_BLOB_SUPPORT
+
+class CimageDlg : public wxDialog
+{
+public:
+ CimageDlg(wxWindow *parent, wxChar *pImageData, off_t iSize);
+ ~CimageDlg();
+
+ void OnCloseWindow(wxCloseEvent &event);
+
+private:
+ wxStaticBitmap *m_pDisplayBmp;
+ wxBitmap *m_pBmp;
+ wxImage *m_pImage;
+
+protected:
+
+
+DECLARE_EVENT_TABLE()
+}; // CimageDlg
+
+#define IMAGE_DIALOG 400
+
+#define IMAGE_DIALOG_STATIC_BMP 401
+
+#endif
+
wxChar * const langNO = wxT("No");
wxChar * const langYES = wxT("Yes");
wxChar * const langDBINF_DB_NAME = wxT("Database Name = ");