Pelles C forum

C language => Beginner questions => Topic started by: HellOfMice on November 22, 2024, 03:52:55 PM

Title: WM_DRAWITEM
Post by: HellOfMice on November 22, 2024, 03:52:55 PM
Hello the World,

I want to draw an ownerdraw TAB
Like I did it runs but does not have the good colors.
Only when selected.



int Theme_Tab_WMDRAWITEM(LPDRAWITEMSTRUCT __lpDis)
{
   if((__lpDis->itemAction & ODA_SELECT) && (__lpDis->itemState & ODS_SELECTED))
         Theme_Tab_DrawSelectedAndSelected(hTabControl,__lpDis) ;
   else
   {
      if((__lpDis->itemAction & ODA_DRAWENTIRE) && (__lpDis->itemState & ODS_SELECTED))
         Theme_Tab_DrawSelectedAndSelected(hTabControl,__lpDis) ;
      else
         Theme_Tab_DrawFullAndNotSelected(hTabControl,__lpDis) ;
   }

   return (TRUE) ;
}


int Main_OnWmDrawItem(HWND __hWnd,WPARAM __wParam,LPARAM __lParam)
{
if(__wParam == IDC_TAB_01)
return (Theme_Tab_WMDRAWITEM(_lpDis)) ;
}


I join the full source code maybe that can help you
Please help to understand this message.
Merci

Philippe
Title: Re: WM_DRAWITEM
Post by: HellOfMice on November 22, 2024, 04:01:24 PM
I join an image it's easier to understand

After I will come back for the NMCUSTOMDRAW.

Philippe