diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-22 09:08:46 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-22 09:08:46 +0000 |
commit | b58fa04b8dc505c6d45100ccf772464a4b619df5 (patch) | |
tree | 14e48f9e3ad7165061090bdd400a4311b9d1776b /include | |
parent | 2a5135f1283ffc05a8a5c1e56b7025fe3d55a013 (diff) |
UI utils:
- added class CProgress;
- added class CTimer;
git-svn-id: http://svn.miranda-ng.org/main/trunk@17331 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r-- | include/m_gui.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/include/m_gui.h b/include/m_gui.h index ffc80b1bfd..916e0a4038 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -371,6 +371,7 @@ public: class MIR_CORE_EXPORT CDlgBase
{
+ friend class CTimer;
friend class CCtrlBase;
friend class CCtrlData;
@@ -415,6 +416,8 @@ protected: virtual void OnClose() { }
virtual void OnDestroy() { }
+ virtual void OnTimer(CTimer*) {}
+
// miranda-related stuff
virtual int Resizer(UTILRESIZECONTROL *urc);
virtual void OnApply() {}
@@ -431,16 +434,43 @@ protected: void ThemeDialogBackground(BOOL tabbed);
private:
+ LIST<CTimer> m_timers;
LIST<CCtrlBase> m_controls;
void NotifyControls(void (CCtrlBase::*fn)());
CCtrlBase *FindControl(int idCtrl);
+ CTimer* FindTimer(int idEvent);
+
static INT_PTR CALLBACK GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static int GlobalDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc);
};
/////////////////////////////////////////////////////////////////////////////////////////
+// CTimer
+
+class MIR_CORE_EXPORT CTimer
+{
+ friend class CDlgBase;
+
+public:
+ CTimer(CDlgBase* wnd, int idEvent);
+
+ __forceinline int GetEventId() const { return m_idEvent; }
+
+ virtual BOOL OnTimer();
+
+ void Start(int elapse);
+ void Stop();
+
+ CCallback<CTimer> OnEvent;
+
+protected:
+ int m_idEvent;
+ CDlgBase* m_wnd;
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlBase
class MIR_CORE_EXPORT CCtrlBase
@@ -556,6 +586,20 @@ protected: };
/////////////////////////////////////////////////////////////////////////////////////////
+// CProgress
+
+class MIR_CORE_EXPORT CProgress : public CCtrlBase
+{
+public:
+ CProgress(CDlgBase *dlg, int ctrlId);
+
+ void SetRange(WORD max, WORD min = 0);
+ void SetPosition(WORD value);
+ void SetStep(WORD value);
+ WORD Move(WORD delta = 0);
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlClc
#if !defined(MGROUP)
@@ -711,7 +755,7 @@ class MIR_CORE_EXPORT CCtrlSpin : public CCtrlBase public:
CCtrlSpin(CDlgBase *dlg, int ctrlId);
- void SetRange(short min, short max);
+ void SetRange(WORD max, WORD min = 0);
};
/////////////////////////////////////////////////////////////////////////////////////////
|