55 : _super(), m_size(0, 0), m_colorMark(::GetSysColor(COLOR_HIGHLIGHT))
56 , m_isActing(false), m_interval(10), m_step(1), m_colorBack(::GetSysColor(COLOR_BTNFACE))
57 , m_markWidth(6), m_pos(0), m_mode(1)
76 void SetParameter(
EMode mode, DWORD interval,
int step = 6, COLORREF colorBack = CLR_INVALID)
79 m_interval = interval;
81 m_colorBack = (colorBack != CLR_INVALID) ? colorBack : ::GetSysColor(COLOR_BTNFACE);
94 m_colorMark = (colorMark != CLR_INVALID) ? colorMark : ::GetSysColor(COLOR_HIGHLIGHT);
110 m_piMarkerDrawer = draw.
Clone();
123 m_isActing = isAction;
128 m_thread.
Start(_T(
"ProcessingCtrl"));
163 _super::GetClientRect(rc);
176 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
178 if ( message == WM_PAINT )
184 else if ( message == WM_PRINTCLIENT )
186 CDC* pDc = CDC::FromHandle(
reinterpret_cast<HDC
>(wParam));
190 else if ( message == WM_DESTROY )
195 return _super::WindowProc(message, wParam, lParam);
212 if ( m_pos + m_markWidth > m_size.cx )
214 m_pos = m_size.cx - m_markWidth;
218 else if ( m_mode < 0 )
220 if ( m_pos >= m_step )
233 if ( m_pos > m_size.cx )
235 m_pos = -m_markWidth;
240 _super::Invalidate();
249 void m_DeleteDrawer(
void)
251 m_piMarkerDrawer.
Null();
257 void m_Draw(CDC* pDC)
259 CRect cliRect(CPoint(0, 0), m_size);
260 HRGN rgn = ::CreateRectRgnIndirect(&cliRect);
265 CRect markRect(m_pos, 0, m_pos + m_markWidth, m_size.cy);
266 if ( m_piMarkerDrawer.
IsNull() )
268 pDC->FillSolidRect(markRect, m_colorMark);
272 m_piMarkerDrawer->
Draw(*pDC, m_pos, 0);
274 HRGN rgn = ::CreateRectRgnIndirect(&markRect);
278 pDC->FillSolidRect(cliRect, m_colorBack);
279 pDC->SelectClipRgn(NULL);
283 COLORREF m_colorBack;
287 COLORREF m_colorMark;
bool IsNull(void) const
[確認] NULLチェック
bool SetRunner(IRunner *pRunner)
[設定] ランナー、設定
bool Stop(DWORD dwWait=15000)
[設定] スレッド停止 スレッドに対して停止要求します。
bool Start(LPCTSTR lpszName=NULL)
[設定] スレッド開始
CThreadStatus & ReferThreadStatus(void)
[設定] スレッド状態種取得
void Action(bool isAction)
[設定] 動作.
void SetParameter(EMode mode, DWORD interval, int step=6, COLORREF colorBack=CLR_INVALID)
[設定] 動き指定
void SetMarker(COLORREF colorMark, int width)
[設定] マーカー指定.
CProcessingCtrl(void)
コンストラクタ
bool IsActing(void) const
[確認] 動作確認.
~CProcessingCtrl(void)
デストラクタ
virtual void PreSubclassWindow(void)
[通知] subclassing/unsubclassing functions.
void SetMarker(const IDrawable &draw)
[設定] マーカー指定.
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
int SelectClipRgnOrg(CDC *pDC, HRGN rgn, int mode=RGN_COPY)
[設定] リージョン設定.
bool IsRunnable(void) const
[確認] 実行可能か否か
virtual bool GetSize(SIZE &_size) const =0
[取得] サイズ取得.
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.
virtual void Draw(HDC dc, int x=0, int y=0) const =0
[描画] 描画.