62 m_pNoActiveSelectMarkDrawer =
new CSelectedBeltDrawer(::GetSysColor(COLOR_BTNFACE), base,
true);
65 int c1 = ::GetSysColor(COLOR_WINDOW);
66 int c2 = ::GetSysColor(COLOR_BTNFACE);
67 int r1 = GetRValue(c1);
68 int r2 = GetRValue(c2);
69 int r = r2 - (r1 - r2);
71 int g1 = GetGValue(c1);
72 int g2 = GetGValue(c2);
73 int g = g2 - (g1 - g2);
75 int b1 = GetBValue(c1);
76 int b2 = GetBValue(c2);
77 int b = b2 - (b1 - b2);
94 return m_SetDrawer(m_pBackgroundDrawer, draw);
107 m_selectMarkType = type;
108 bool r = m_SetDrawer(m_pSelectMarkDrawer, draw);
111 m_pNoActiveSelectMarkDrawer = m_pSelectMarkDrawer;
127 return m_SetDrawer(m_pNoActiveSelectMarkDrawer, draw2);
138 return m_SetDrawer(m_pFocusMarkDrawer, draw);
150 return m_SetDrawer(m_pDisabledStyleDrawer, draw);
160 if ( color == CLR_INVALID )
162 m_backColor = ::GetSysColor(COLOR_WINDOW);
164 m_backColorBrush.
Null();
197 ::PostMessage(m_wndList[i], message, wParam, lParam);
219 return m_selectMarkType;
240 if ( isActive || m_pNoActiveSelectMarkDrawer.
IsNull() )
242 m_DrawDrawer(m_pSelectMarkDrawer, dc, rect, lParam);
246 m_DrawDrawer(m_pNoActiveSelectMarkDrawer, dc, rect, lParam);
258 m_DrawDrawer(m_pBackgroundDrawer, dc, rect, lParam);
269 m_DrawDrawer(m_pFocusMarkDrawer, dc, rect, lParam);
281 m_DrawDrawer(m_pDisabledStyleDrawer, dc, rect, lParam);
291 if ( (rect.bottom - rect.top) > 0 )
293 if ( m_backColorBrush.
IsNull() )
295 m_backColorBrush = ::CreateSolidBrush(m_backColor);
297 ::FillRect(dc, &rect, m_backColorBrush);
308 void DrawText(HDC dc,
const RECT& rect, LPCTSTR lpsz, LPARAM lParam = 0)
310 if ( ! m_pTextDrawer.IsNull() )
312 CSize sz = CRect(rect).Size();
313 m_pTextDrawer->Resize(sz - CSize(2, 0));
314 m_pTextDrawer->SetString(lpsz);
315 m_pTextDrawer->DrawEx(dc, rect.left + 1, rect.top, lParam);
327 void DrawText(HDC dc,
const RECT& rect, LPCTSTR lpsz, DWORD drawStyle, LPARAM lParam = 0)
329 if ( ! m_pTextDrawer.IsNull() )
331 CSize sz = CRect(rect).Size();
332 m_pTextDrawer->SetDrawStyle(drawStyle);
333 m_pTextDrawer->Resize(sz - CSize(2, 0));
334 m_pTextDrawer->SetString(lpsz);
335 m_pTextDrawer->DrawEx(dc, rect.left + 1, rect.top, lParam);
345 if ( ! m_pTextDrawer.IsNull() )
347 return m_pTextDrawer->GetDrawStyle();
359 if ( m_pTextDrawer.IsNull() )
361 CFont* pFont = pWnd->GetFont();
362 m_pTextDrawer =
new CTextDrawer(*pFont, CLR_AUTOSELECT, _T(
""), DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS);
374 HWND h = m_wndList[i];
391 for ( INT_PTR i = m_wndList.
GetSize() - 1; i >= 0; i-- )
393 HWND h = m_wndList[i];
401 if ( ::IsWindowVisible(h) != r )
403 ::ShowWindow(h, r ? SW_SHOW : SW_HIDE );
422 m_pSelectMarkDrawer.
Null();
423 m_pNoActiveSelectMarkDrawer.
Null();
424 m_pFocusMarkDrawer.
Null();
425 m_pBackgroundDrawer.
Null();
426 m_pDisabledStyleDrawer.
Null();
428 m_backColorBrush.
Null();
429 m_pTextDrawer.Null();
430 m_backColor = ::GetSysColor(COLOR_WINDOW);
442 if ( ! _P->
Resize(CSize(1, 1)) )
450 void m_DrawDrawer(
IDrawable::Ptr& _pDrawer, HDC dc,
const RECT& rect, LPARAM lParam = 0)
452 if ( ! _pDrawer.
IsNull() )
454 const CRect& rc = rect;
455 if ( ! rc.IsRectEmpty() )
457 _pDrawer->
Resize(rc.Size());
458 _pDrawer->
DrawEx(dc, rc.left, rc.top, lParam);
471 COLORREF m_backColor;
#define loop(VAR, CNT)
loop構文.
bool IsNull(void) const
[確認] NULLチェック
void RemoveAll(void)
[削除] 空化
size_t GetSize(void) const
[取得] サイズ取得
bool Remove(INDEX index)
[削除] 要素一つ削除.
INDEX Add(const TYP &t)
[追加] 要素一つ追加.
virtual IDrawable * Clone(void) const
[作成] クローン作成.
void SetTextDrawer(const CTextDrawer &text)
[設定] テキスト描画情報指定
void AdditionRelatedHwnd(HWND hWnd)
[追加] 関連Windowハンドル追加
CAbstractDrawingCtrl(void)
コンストラクタ
ESelectMarkType
セレクトマークタイプ
DWORD GetTextDrawStyle(void) const
[取得] 文字列描画スタイル取得.
void SetDefaultMarkDrawer(COLORREF base=::GetSysColor(COLOR_WINDOW))
[設定] デフォルトのマーク描画指定.
bool SetSelectMarkDrawer(const IDrawable &draw1, const IDrawable &draw2, ESelectMarkType type=OVERLAP)
[設定] 選択マーク描画指定.
virtual ~CAbstractDrawingCtrl(void)
デストラクタ
bool SetSelectMarkDrawer(const IDrawable &draw, ESelectMarkType type=OVERLAP)
[設定] 選択マーク描画指定.
void DrawText(HDC dc, const RECT &rect, LPCTSTR lpsz, DWORD drawStyle, LPARAM lParam=0)
[描画] 文字列描画
bool EndItemPaint(void)
[処理] 描画終了.
bool SetBackgroundDrawer(const IDrawable &draw)
[設定] 背景描画指定.
COLORREF GetBackColor(void) const
[取得] 背景色取得.
void DrawBackground(HDC dc, const RECT &rect, LPARAM lParam=0)
[描画] 背景表示
void DrawText(HDC dc, const RECT &rect, LPCTSTR lpsz, LPARAM lParam=0)
[描画] 文字列描画
void SetBackColor(COLORREF color)
[設定] 背景色設定.
void DrawSelectMark(HDC dc, const RECT &rect, bool isActive, LPARAM lParam=0)
[描画] 選択マーク表示
ESelectMarkType GetSelectMarkType(void) const
[取得] セレクトマークタイプ
bool SetFocusMarkDrawer(const IDrawable &draw)
[設定] フォーカスマーク描画指定.
void PostMessageToRelatedHwnd(UINT message, WPARAM wParam=0, LPARAM lParam=0)
[処理] 関連Windowハンドルへポスト
void DrawDisabledStyle(HDC dc, const RECT &rect, LPARAM lParam=0)
[描画] 無効状態描画.
void AllReset(void)
[設定] 全設定リセット.
void DrawFocusMark(HDC dc, const RECT &rect, LPARAM lParam=0)
[描画] フォーカスマーク表示
void BeginItemPaint(void)
[処理] 描画開始.
void DrawBackColor(HDC dc, const RECT &rect)
[描画] 背景色描画
void SetDefaultTextDrawer(CWnd *pWnd)
[設定] テキスト描画情報設定.
bool SetDisabledStyleDrawer(const IDrawable &draw)
[設定] 無効状態描画指定.
void SetProcessingFlag(HWND hWnd, bool isEnable)
[設定] 処理済フラグ操作.
bool IsProcessingFlag(HWND hWnd)
[取得] 処理済フラグ取得.
virtual bool Resize(const SIZE &size)=0
[設定] サイズ設定.
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.