| 1194 | } |
| 1195 | |
| 1196 | void CColorCopDlg::DisplayColor() { |
| 1197 | CDC* pDC = GetDC(); |
| 1198 | |
| 1199 | CBrush blackbrush; // create a black brush |
| 1200 | blackbrush.CreateSolidBrush(0x00000000); |
| 1201 | |
| 1202 | CBrush greybrush; // create a grey brush |
| 1203 | greybrush.CreateSolidBrush(0x00808080); |
| 1204 | |
| 1205 | pDC->FillSolidRect(buttonrect, RGB(m_Reddec, m_Greendec, m_Bluedec)); |
| 1206 | pDC->DrawEdge(buttonrect, EDGE_SUNKEN, BF_RECT); |
| 1207 | |
| 1208 | if (m_Appflags & ExpandedDialog) { |
| 1209 | pDC->FillSolidRect(&Q1rect, ColorHistory[0]); |
| 1210 | pDC->FrameRect(&Q1rect, &blackbrush); |
| 1211 | |
| 1212 | pDC->FillSolidRect(&Q2rect, ColorHistory[1]); |
| 1213 | pDC->FrameRect(&Q2rect, &blackbrush); |
| 1214 | |
| 1215 | pDC->FillSolidRect(&Q3rect, ColorHistory[2]); |
| 1216 | pDC->FrameRect(&Q3rect, &blackbrush); |
| 1217 | |
| 1218 | pDC->FillSolidRect(&Q4rect, ColorHistory[3]); |
| 1219 | pDC->FrameRect(&Q4rect, &blackbrush); |
| 1220 | |
| 1221 | pDC->FillSolidRect(&Q5rect, ColorHistory[4]); |
| 1222 | pDC->FrameRect(&Q5rect, &blackbrush); |
| 1223 | |
| 1224 | pDC->FillSolidRect(&Q6rect, ColorHistory[5]); |
| 1225 | pDC->FrameRect(&Q6rect, &blackbrush); |
| 1226 | |
| 1227 | pDC->FillSolidRect(&Q7rect, ColorHistory[6]); |
| 1228 | pDC->FrameRect(&Q7rect, &blackbrush); |
| 1229 | |
| 1230 | int palWidth = (colorpalrect.right - colorpalrect.left); |
| 1231 | int palHeight = (colorpalrect.bottom - colorpalrect.top); |
| 1232 | |
| 1233 | m_nwide = static_cast<int>((palWidth) / 6.0); |
| 1234 | m_ntall = static_cast<int>((palHeight) / 7.0); |
| 1235 | |
| 1236 | CRect insiderect = colorpalrect; |
| 1237 | insiderect.right = insiderect.left + m_nwide; |
| 1238 | insiderect.bottom = insiderect.top + m_ntall; |
| 1239 | |
| 1240 | for (int col = 0; col < 7; col++) { |
| 1241 | if (col) { |
| 1242 | // not the top row |
| 1243 | |
| 1244 | insiderect.top += m_ntall; |
| 1245 | insiderect.bottom += m_ntall; |
| 1246 | } |
| 1247 | for (int row = 0; row < 6; row++) { |
| 1248 | pDC->FillSolidRect(insiderect, ColorPal[row][col]); |
| 1249 | |
| 1250 | insiderect.right += m_nwide; |
| 1251 | insiderect.left += m_nwide; |
| 1252 | } |
| 1253 |
nothing calls this directly
no outgoing calls
no test coverage detected