listview widget skin problem

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • listview widget skin problem

      I'm using STemwin V5.44, stm32cubemx V5.4 exported, I created a listview widget, I try to change the skin of the listview ,but failed ,I tried this fuction(LISTVIEW_SetSkinClassic(hItem);) but called error, I tried (LISTVIEW_SetBkColor(hItem, LISTVIEW_CI_DISABLED, GUI_MAKE_COLOR(0x0077773C));WM_DisableWindow(hItem);) ,but (LISTVIEW_CI_DISABLED) seems not work at all,but the other options working well(LISTVIEW_CI_UNSEL,LISTVIEW_CI_SEL,LISTVIEW_CI_SELFOCUS), but this 4 options appear in one same function explaination,I don't know what's the problem,how can I change the skin when disabled,and change back when enabled ? I tried to google and search in this forum ,but few people meet this question

      The post was edited 1 time, last by mountain ().

    • your method working very well, [LISTVIEW_SetOwnerDraw(hListview, _OwnerDrawListview);][_OwnerDrawListview] this function has a parameter[ WIDGET_ITEM_DRAW_INFO*], but only struct pointer,no struct body given, how can this work ? do I need to declare it somwhere?
      another problem is there is no get function [LISTVIEW_GetOwnerDraw] , so how can I change back to default, or once I set ownerdraw, it must be use all the time? actually , I just want to let it look differrent when enabled and disabled, why [LISTVIEW_CI_DISABLED] doesn't work at all, is this a bug? will it be fixed ? or I didn't get how to use?
    • Hi,

      the struct WIDGET_ITEM_DRAW_INFO gets declared within the LISTVIEW widget. A pointer to to this structure gets passed to the owner draw function.

      You can either call the default owner draw function within the custom one or call LISTVIEW_SetOwnerDraw(LISTVIEW_OwnerDraw);

    • Hi,

      there is no default owner draw function per se, what you mean is the default paint routine for the widget. This routine is typically named _Paint() or _OnPaint() and called in the WM_PAINT case of the widget's default callback routine. These routines are located in the file to the corresponding widget. When a custom owner draw routine is set, the custom routine is called instead of the default paint routine.

      Best regards,

    • oh,thanks,
      but I still don't know how to change skin when disabled listview widget and change back when enabled,
      Once I tried LISTVIEW_SetOwnerDraw() ,the focus blue clolor will no more cover whole grid ,only text area,
      I try to cover listview widget with a subtransparent widget directly, but failed
    • Hi,

      the set owner draw function should define what should be drawn when the widget is disabled. When the widget has the owner draw routine set, is disabled and invalidated, it should be drawn according to the disabled state.

      Best regards,