TNB Library
TnbPartsDrawable.h
[詳解]
1#pragma once
11#include "TnbDef.h"
12
13
14
15//TNB Library
16namespace TNB {
17namespace MFC {
18
19
20
21#ifndef _TnbDOXYGEN //Document作成用シンボル
22 #define DFCS_FOCUS 0x10000
23#endif
24
25
26
38{
40 virtual ~IPartsDrawable(void) { }
41
51 virtual bool DrawEdge(HDC hdc, LPCRECT lprc, UINT edge, UINT grfFlags) const = 0;
52
101 virtual bool DrawButtonControl(HDC hdc, LPRECT _lprc, UINT uState) const = 0;
102
111 virtual bool DrawFocusRect(HDC hdc, LPCRECT lpRect) const = 0;
112
118 virtual void GetPushedOffset(POINT& _po) const = 0;
119
125 virtual void GetEdgeOffset(POINT& _po) const = 0;
126};
127
128
129
141{
142 DEFSUPER(IPartsDrawable);
143public:
153 virtual bool DrawEdge(HDC hdc, LPCRECT lprc, UINT edge, UINT grfFlags) const
154 {
155 RECT rc = *lprc;
156 return !! ::DrawEdge(hdc, &rc, edge, grfFlags);
157 }
158
170 virtual bool DrawButtonControl(HDC hdc, LPRECT _lprc, UINT uState) const
171 {
172 switch ( uState & 0xFF )
173 {
174 case DFCS_BUTTON3STATE:
175 case DFCS_BUTTONCHECK:
176 case DFCS_BUTTONRADIO:
177 _lprc->right = _lprc->left + 13;
178 _lprc->bottom = _lprc->top + 13;
179 break;
180 }
181 if ( hdc == NULL ) { return true; }
182 return !! ::DrawFrameControl(hdc, _lprc, DFC_BUTTON, uState);
183 }
184
193 virtual bool DrawFocusRect(HDC hdc, LPCRECT lpRect) const
194 {
195 return !! ::DrawFocusRect(hdc, lpRect);
196 }
197
203 virtual void GetPushedOffset(POINT& _po) const
204 {
205 _po.x = 1;
206 _po.y = 1;
207 }
208
214 virtual void GetEdgeOffset(POINT& _po) const
215 {
216 _po.x = ::GetSystemMetrics(SM_CXEDGE);
217 _po.y = ::GetSystemMetrics(SM_CYEDGE);
218 }
219};
220
221
222
223}; //MFC
224}; //TNB
225
226
227
TNBライブラリの定義ヘッダ
標準WINDOWパーツ描画クラス
virtual bool DrawEdge(HDC hdc, LPCRECT lprc, UINT edge, UINT grfFlags) const
[描画] 長方形の辺を描画.
virtual void GetEdgeOffset(POINT &_po) const
[取得] エッジの幅、高さ.
virtual bool DrawButtonControl(HDC hdc, LPRECT _lprc, UINT uState) const
[描画] ボタンコントロール描画.
virtual void GetPushedOffset(POINT &_po) const
[取得] 押下状態のずれ.
virtual bool DrawFocusRect(HDC hdc, LPCRECT lpRect) const
[描画] フォーカス枠描画.
TNB Library
Definition: TnbDoxyTitle.txt:2
WINDOWパーツ描画インターフェース
virtual bool DrawFocusRect(HDC hdc, LPCRECT lpRect) const =0
[描画] フォーカス枠描画.
virtual ~IPartsDrawable(void)
デストラクタ
virtual void GetEdgeOffset(POINT &_po) const =0
[取得] エッジの幅、高さ.
virtual bool DrawEdge(HDC hdc, LPCRECT lprc, UINT edge, UINT grfFlags) const =0
[描画] 長方形の辺を描画.
virtual bool DrawButtonControl(HDC hdc, LPRECT _lprc, UINT uState) const =0
[描画] ボタンコントロール描画.
virtual void GetPushedOffset(POINT &_po) const =0
[取得] 押下状態のずれ.