| 218 | } |
| 219 | |
| 220 | void CGrFontDialog::OnPaint() { |
| 221 | CPaintDC dc(this); // device context for painting |
| 222 | CWnd *fontwnd; |
| 223 | RECT rect; |
| 224 | int w, h; |
| 225 | |
| 226 | if (m_FontPicBm > -1) { |
| 227 | grHardwareSurface surf(bm_w(m_FontPicBm, 0), bm_h(m_FontPicBm, 0), bm_bpp(m_FontPicBm)); |
| 228 | |
| 229 | fontwnd = GetDlgItem(IDC_STATIC_FONTVIEW); |
| 230 | fontwnd->GetWindowRect(&rect); |
| 231 | ScreenToClient(&rect); |
| 232 | |
| 233 | w = rect.right - rect.left - 4; |
| 234 | h = rect.bottom - rect.top - 4; |
| 235 | |
| 236 | if (w > (surf.width() - 4)) |
| 237 | w = surf.width() - 4; |
| 238 | if (h > (surf.height() - 4)) |
| 239 | h = surf.height() - 4; |
| 240 | |
| 241 | // load bitmap, convert transparency to pure black and then blt |
| 242 | surf.load(m_FontPicBm); |
| 243 | surf.replace_color(TRANSPARENT_COLOR32, 0); |
| 244 | |
| 245 | Desktop_surf->attach_to_window((unsigned)m_hWnd); |
| 246 | Desktop_surf->blt(rect.left + 2, rect.top + 2, &surf, 0, 0, w, h); |
| 247 | Desktop_surf->attach_to_window((unsigned)NULL); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | int CGrFontDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) { |
| 252 | if (CDialog::OnCreate(lpCreateStruct) == -1) |
nothing calls this directly
no test coverage detected