53 : _super(size), m_style(style), m_color(color), m_hWnd(hWnd), m_cx(cx), m_cy(cy), m_pParts(pParts), m_bkMode(TRANSPARENT)
68 : _super(), m_style(style), m_color(color), m_hWnd(hWnd), m_cx(cx), m_cy(cy), m_pParts(pParts), m_bkMode(TRANSPARENT)
91 virtual void Draw(HDC dc,
int x = 0,
int y = 0)
const
93 if ( ::IsWindow(m_hWnd) )
95 int iLen = ::GetWindowTextLength(m_hWnd);
99 ::GetWindowText(m_hWnd, str, iLen + 1);
100 RECT rc = { x + m_cx, y + m_cy, x +
m_size.cx - m_cx, y +
m_size.cy - m_cy };
104 HFONT font =
reinterpret_cast<HFONT
>(::SendMessage(m_hWnd, WM_GETFONT, 0, 0));
108 if ( m_pParts != NULL && ::GetFocus() == m_hWnd )
111 ::GetClientRect(m_hWnd, &wr);
116 ::IntersectRect(&rc, &rc, &wr);
void SetBkMode(int mode)
[設定] 背景モード設定.
void SelectFont(HFONT font)
[選択] フォント選択.
static bool DrawTextRect(RECT &_rect, HDC dc, DWORD drawStyle, const POINT &offset, COLORREF color1, COLORREF color2, LPCTSTR str)
[表示] 範囲文字表示.
CWndTextDrawer(const SIZE &size, HWND hWnd, COLORREF color, DWORD style, int cx=2, int cy=2, const IPartsDrawable *pParts=NULL)
コンストラクタ
virtual void Draw(HDC dc, int x=0, int y=0) const
[描画] 描画.
void SetBkMode(int mode)
[設定] 背景モード設定
void SetTextColor(COLORREF color)
[設定] 色設定.
void SetTextStyle(DWORD style)
[設定] スタイル設定.
virtual IDrawable * Clone(void) const
[作成] クローン作成.
CWndTextDrawer(HWND hWnd, COLORREF color, DWORD style, int cx=2, int cy=2, const IPartsDrawable *pParts=NULL)
コンストラクタ
virtual bool DrawFocusRect(HDC hdc, LPCRECT lpRect) const =0
[描画] フォーカス枠描画.