ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static LRESULT CALLBACK SubclassButtonProc ( HWND  hWnd,
WPARAM  wp,
LPARAM  lp 
) [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;
}

Generated on Sun May 27 2012 04:39:49 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.