54template<
typename TYP = CStatic>
72 m_height = m_GetClientHeight();
91 if ( m_backBrush.GetSafeHandle() != NULL )
93 m_backBrush.DeleteObject();
97 m_backBrush.CreateSolidBrush(c);
131 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
136 if ( ! m_isSafeFontSetting )
138 LRESULT r = _super::WindowProc(message, wParam, lParam);
147 return _super::WindowProc(message, wParam, lParam);
162 virtual BOOL
OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* _pResult)
166 case WM_CTLCOLORMSGBOX:
167 case WM_CTLCOLOREDIT:
168 case WM_CTLCOLORLISTBOX:
171 case WM_CTLCOLORSCROLLBAR:
172 case WM_CTLCOLORSTATIC:
173 if ( IS_RGBVALUE(m_textColor) )
175 HDC dc =
reinterpret_cast<HDC
>(wParam);
176 ::SetBkMode(dc, TRANSPARENT);
178 if ( m_backBrush.GetSafeHandle() == NULL )
180 int f = COLOR_3DFACE;
181 if ( message == WM_CTLCOLOREDIT )
185 m_backBrush.CreateSysColorBrush(f);
187 *_pResult =
reinterpret_cast<LRESULT
>(m_backBrush.GetSafeHandle());
192 return _super::OnChildNotify(message, wParam, lParam, _pResult);
202 _super::PreSubclassWindow();
208 int m_GetClientHeight(
void)
211 _super::GetClientRect(rc);
217 m_height = m_GetClientHeight();
219 CFont* pFont = _super::GetFont();
222 pFont->GetLogFont(&m_logFont);
229 m_isSafeFontSetting =
true;
230 int height = m_GetClientHeight();
232 _super::SetFont(NULL);
233 m_font.DeleteObject();
235 LOGFONT lf = m_logFont;
236 lf.lfHeight = m_logFont.lfHeight * height / m_height;
237 m_font.CreateFontIndirect(&lf);
238 _super::SetFont(&m_font);
239 m_isSafeFontSetting =
false;
244 bool m_isSafeFontSetting;
245 COLORREF m_textColor;
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT *_pResult)
[通知] for notifications from parent
void SetLogFont(const LOGFONT &logFont)
[設定] フォント属性設定.
void ResetFontSize(void)
[設定] フォントサイズリセット.
void GetLogFont(LOGFONT &_logFont) const
[取得] フォント属性取得.
void SetBackColor(COLORREF c=CLR_INVALID)
[設定] 背景色指定.
virtual void PreSubclassWindow(void)
[通知] subclassing/unsubclassing functions.
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
void SetTextColor(COLORREF c=CLR_INVALID)
[設定] 文字色指定.
CFontAdjusterAddinT(void)
コンストラクタ
void Zero(V &value)
[設定] ゼロクリア.