12 #error TnbCeMfcDoubleClick.h is only supported on Windows CE platforms.
26#ifndef BN_DOUBLECLICKED
27 #define BN_DOUBLECLICKED 1
40_SELECTANY DWORD s_dcaDoubleClickTime = 0;
41_SELECTANY DWORD s_toleranceClickRange = TNB::CalcScaleX(10);
95 s_toleranceClickRange = d;
109 s_dcaDoubleClickTime = t;
120 if ( s_dcaDoubleClickTime == 0 )
124 return s_dcaDoubleClickTime;
137 LRESULT r = SendMessage(WM_GETDLGCODE);
138 if ( (r & DLGC_STATIC) != 0 && (GetStyle() & SS_NOTIFY) == 0 )
142 _super::PreSubclassWindow();
154 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
159 if ( m_phase > STANDBY && m_IsPassed() )
163 if ( m_phase == STANDBY )
167 m_point = CPoint(lParam);
170 else if ( m_phase == DOWNWAIT )
172 m_phase = m_Check(lParam) ? UPWAIT2 : STANDBY;
176 if ( m_phase == UPWAIT )
178 m_phase = m_Check(lParam) ? DOWNWAIT : STANDBY;
180 else if ( m_phase == UPWAIT2 )
182 if ( m_Check(lParam) )
190 if ( m_phase > STANDBY && ! m_Check(lParam) )
196 return _super::WindowProc(message, wParam, lParam);
210 bool m_IsArea(
const POINT& p)
const
212 DWORD x = abs(p.x - m_point.x);
213 DWORD y = abs(p.y - m_point.y);
214 return (x <= s_toleranceClickRange && y <= s_toleranceClickRange);
217 bool m_IsPassed(
void)
const
219 return m_tick.
IsPassed(s_dcaDoubleClickTime);
222 bool m_Check(LPARAM lParam)
const
225 return (! m_IsPassed() && m_IsArea(CPoint(lParam)));
bool IsPassed(DWORD dwTime) const
[確認] 経過確認.
void Reset(void)
[設定] リセット.
static void SetDoubleClickTime(DWORD t)
[設定] ダブルクリック時間設定.
static DWORD GetDoubleClickTime(void)
[取得] ダブルクリック時間取得.
virtual void PreSubclassWindow(void)
[通知] subclassing/unsubclassing functions.
static void SetToleranceClickRange(DWORD d)
[設定] 許容クリック範囲設定.
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
CDoubleClickAddinT(void)
コンストラクタ
LRESULT SendCommandMessage(CWnd *pCtrl, UINT cmd)
[処理] WM_COMMAND送信.