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 paint ( HTHEME  theme,
HWND  hwnd,
HDC  hParamDC,
ULONG  state 
) [static]

Definition at line 165 of file theme_combo.c.

Referenced by BUTTON_Paint(), OnPaint(), TAB_DeselectAll(), and THEMING_ComboSubclassProc().

{
  PAINTSTRUCT ps;
  HDC   hDC;
  COMBOBOXINFO cbi;
  DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);

  hDC = (hParamDC) ? hParamDC
                   : BeginPaint( hwnd, &ps);

  TRACE("hdc=%p\n", hDC);

  if( hDC && !(state & STATE_NOREDRAW) )
  {
      RECT frameRect;
      int buttonState;
  
      cbi.cbSize = sizeof (cbi);
      SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
      
      /* paint border */
      if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE)
          GetClientRect (hwnd, &frameRect);
      else
      {
          CopyRect (&frameRect, &cbi.rcItem);

          InflateRect(&frameRect, 
              EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, 
              EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
      }
      
      DrawThemeBackground (theme, hDC, 0, 
          IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL);
      
      /* paint button */
      if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
      {
          if (!IsWindowEnabled (hwnd))
              buttonState = CBXS_DISABLED;
          else if (cbi.stateButton == STATE_SYSTEM_PRESSED)
              buttonState = CBXS_PRESSED;
          else if (state & STATE_HOT)
              buttonState = CBXS_HOT;
          else
              buttonState = CBXS_NORMAL;
          DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState, 
              &cbi.rcButton, NULL);
      }

      /* paint text, if we need to */
      if ((dwStyle & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
          paint_text (hwnd, hDC, dwStyle, &cbi);
  }

  if( !hParamDC )
    EndPaint(hwnd, &ps);

  return 0;
}

Generated on Thu May 24 2012 05:06:57 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.