Confirmed with the gadget library from http://www.purebasic.com/beta/windows/.Num3 wrote:PureColor is now bugged with the updated Listicongadgets!
Disables gridlines!!!Code: Select all
PureCOLOR_SetGadgetColorEx(#Gadget_main_listtrab, #PureCOLOR_SystemColor,#PureCOLOR_SystemColor, RGB(255, 255, 223), #PureCOLOR_LV_AlternateColors)
But as it's a beta lib and it worked from PB3.9x to PB4.20, how to be sure that :
1. It's not a PB bug ?
2. It will remain in PB4.21 final ?
PureCOLOR simply uses #NM_CUSTOMDRAW to color the rows, and it does no use the gadget item data.
So it looks like a PB bug to me (or the PB ListIcon just became a little more less 'API' compatible) :
Code: Select all
#CDDS_SUBITEMPREPAINT = #CDDS_SUBITEM | #CDDS_ITEMPREPAINT
Procedure.l CallBack(WindowId.l, message.l , wParam.l, lParam.l)
  Protected *LVCDHeader.NMLVCUSTOMDRAW
  Protected Result.l
  ;
  Result = #PB_ProcessPureBasicEvents
  If message = #WM_NOTIFY
    *LVCDHeader = lParam
    If *LVCDHeader\nmcd\hdr\code = #NM_CUSTOMDRAW
      Select *LVCDHeader\nmcd\dwDrawStage
        Case #CDDS_PREPAINT
          Result = #CDRF_NOTIFYITEMDRAW
        Case #CDDS_ITEMPREPAINT
          Result = #CDRF_NOTIFYSUBITEMDRAW
        Case #CDDS_SUBITEMPREPAINT
            If *LVCDHeader\nmcd\dwItemSpec & 1
              *LVCDHeader\clrTextBk = #White
            Else
              *LVCDHeader\clrTextBk = #Yellow
            EndIf
          Result = #CDRF_NEWFONT
      EndSelect
    EndIf
  EndIf
  ProcedureReturn Result 
EndProcedure
Enumeration
  #Window_0
EndEnumeration
Enumeration
  #ListIcon_0
EndEnumeration
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 400, 215, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      ListIconGadget(#ListIcon_0, 16, 17, 375, 191, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_0, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_0, 2, "Column #3", 100)
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      AddGadgetItem(#ListIcon_0, -1, "x" + Chr(10) + "x" + Chr(10) + "x")
      SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
      SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
      SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    EndIf
  EndIf
EndProcedure
SetWindowCallback(@CallBack())
OpenWindow_Window_0()
Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver

