Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 1169 of file winmain.c.
Referenced by DlgMainProc().
{ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lp; DWORD dwStyle; UINT dwText; TCHAR text[64]; int dx, dy, len; SIZE size; POINT pt; if(dis->CtlType == ODT_BUTTON) { /* * little exception: 1/x has different color * in standard and scientific modes */ if ((calc.layout == CALC_LAYOUT_STANDARD || calc.layout == CALC_LAYOUT_CONVERSION) && IDC_BUTTON_RX == dis->CtlID) { SetTextColor(dis->hDC, CALC_CLR_BLUE); } else for (dx=0; dx<SIZEOF(key2code); dx++) { if (key2code[dx].idc == dis->CtlID) { SetTextColor(dis->hDC, key2code[dx].col); break; } } /* button text to write */ len = GetWindowText(dis->hwndItem, text, SIZEOF(text)); /* default state: unpushed & enabled */ dwStyle = 0; dwText = 0; if ((dis->itemState & ODS_DISABLED)) dwText = DSS_DISABLED; if ((dis->itemState & ODS_SELECTED)) dwStyle = DFCS_PUSHED; DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH | dwStyle); GetTextExtentPoint32(dis->hDC, text, len, &size); dx = ((dis->rcItem.right-dis->rcItem.left) - size.cx) >> 1; dy = ((dis->rcItem.bottom-dis->rcItem.top) - size.cy) >> 1; if ((dwStyle & DFCS_PUSHED)) { dx++; dy++; } pt.x = dis->rcItem.left + dx; pt.y = dis->rcItem.top + dy; DrawState(dis->hDC, NULL, NULL, (LPARAM)text, 0, pt.x, pt.y, size.cx, size.cy, DST_TEXT | dwText); } return 1L; }