summaryrefslogtreecommitdiff
path: root/plugins/DbChecker/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/DbChecker/src/stdafx.h')
-rw-r--r--plugins/DbChecker/src/stdafx.h115
1 files changed, 104 insertions, 11 deletions
diff --git a/plugins/DbChecker/src/stdafx.h b/plugins/DbChecker/src/stdafx.h
index e912983a10..c08189312e 100644
--- a/plugins/DbChecker/src/stdafx.h
+++ b/plugins/DbChecker/src/stdafx.h
@@ -32,13 +32,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_database.h>
#include <m_db_int.h>
#include <m_genmenu.h>
+#include <m_gui.h>
+#include <m_icolib.h>
#include <m_langpack.h>
#include <win2k.h>
#include "resource.h"
#include "version.h"
-#define WZM_GOTOPAGE (WM_USER+1)
+#define MODULENAME "DbChecker"
+
#define WZN_PAGECHANGING (WM_USER+1221)
#define WZN_CANCELCLICKED (WM_USER+1222)
@@ -62,7 +65,7 @@ struct DbToolOptions : public MZeroedObject
MIDatabaseChecker *dbChecker;
DWORD error;
HANDLE hEventRun, hEventAbort;
- bool bFinished, bAutoExit, bOwnsDb;
+ bool bFinished, bAutoExit, bOwnsDb, bMarkRead;
wchar_t filename[MAX_PATH];
};
@@ -75,17 +78,107 @@ struct CMPlugin : public PLUGIN<CMPlugin>
};
extern int errorCount;
-extern LRESULT wizardResult;
-
-int DoMyControlProcessing(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam, INT_PTR *bReturn);
-
-INT_PTR CALLBACK WizardDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK OpenErrorDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
-
-int OpenDatabase(HWND hdlg);
#define STATUS_CLASSMASK 0x0f
void AddToStatus(int flags, const wchar_t* fmt, ...);
void SetProgressBar(int perThou);
+/////////////////////////////////////////////////////////////////////////////////////////
+// UI classes
+
+class CWizardPageDlg : public CDlgBase
+{
+ typedef CDlgBase CSuper;
+
+ CCtrlButton btnOk, btnCancel;
+
+protected:
+ virtual void OnNext() PURE;
+ virtual void OnCancel();
+
+ DbToolOptions* getOpts() const;
+ void changePage(CWizardPageDlg *);
+
+public:
+ CWizardPageDlg(int dlgId);
+
+ bool OnInitDialog() override;
+
+ void onClick_Ok(CCtrlButton*) { OnNext(); }
+ void onClick_Cancel(CCtrlButton*) { OnCancel(); }
+};
+
+class COptionsPageDlg : public CWizardPageDlg
+{
+ typedef CWizardPageDlg CSuper;
+
+ CCtrlEdit edtFile;
+ CCtrlButton btnFile;
+ CCtrlCheck chkMarkRead;
+
+public:
+ COptionsPageDlg();
+
+ bool OnInitDialog() override;
+
+ int Resizer(UTILRESIZECONTROL *urc) override;
+
+ void OnNext() override;
+};
+
+class CProgressPageDlg : public CWizardPageDlg
+{
+ typedef CWizardPageDlg CSuper;
+
+ int fontHeight, listWidth;
+ int manualAbort;
+
+public:
+ CProgressPageDlg();
+
+ bool OnInitDialog() override;
+ void OnDestroy() override;
+
+ int Resizer(UTILRESIZECONTROL *urc) override;
+ INT_PTR DlgProc(UINT, WPARAM, LPARAM) override;
+
+ void OnNext() override;
+};
+
+class COpenErrorDlg : public CWizardPageDlg
+{
+ typedef CWizardPageDlg CSuper;
+
+public:
+ COpenErrorDlg();
+
+ bool OnInitDialog() override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
+
+ void OnNext() override;
+};
+
+class CWizardDlg : public CDlgBase
+{
+ HWND hwndPage = nullptr;
+ int m_splitterX, m_splitterY;
+ DbToolOptions *m_opts;
+
+ CTimer timerStart;
+ CCtrlButton btnCancel;
+
+ LRESULT ChangePage(CWizardPageDlg *pPage);
+
+public:
+ CWizardDlg(DbToolOptions *opts);
+
+ bool OnInitDialog() override;
+ bool OnApply() override;
+ void OnDestroy() override;
+
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
+
+ void onClick_Cancel(CCtrlButton *);
+ void onTimer(CTimer *);
+};