Problem with sListview

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36939
    cypheros
    Participant

    If for some reason a AC_REFRESH is send to the component with the skin deactivated, an access violation is created in “procedure TsCustomListView.UpdateCanvasColors” because SkinData.SkinIndex is -1 .

    This changes fixes the problem. “InitControl(True)” is only executed if skin is active.

    Code:
    AC_REFRESH:
    if (ACUInt(Message.LParam) = ACUInt(SkinData.SkinManager)) then begin
    Items.BeginUpdate;
    InitControl(True);
    if HandleAllocated and Assigned(Ac_UninitializeFlatS:cool: then
    Ac_UninitializeFlatSB(Handle);

    RefreshEditScrolls(SkinData, ListSW);
    CommonWndProc(Message, FCommonData);
    if FCommonData.Skinned and not Loading then begin
    if not FCommonData.CustomColor then
    Color := FCommonData.SkinManager.gd[FCommonData.SkinIndex].Props[0].Color;

    InitSkinParams;
    PrepareCache;
    RedrawWindow(Handle, nil, 0, RDW_FRAME or RDW_INVALIDATE or RDW_UPDATENOW or RDW_ALLCHILDREN);
    end;
    Items.EndUpdate;
    Exit;
    end;

    Code:
    AC_REFRESH:
    if (ACUInt(Message.LParam) = ACUInt(SkinData.SkinManager)) then begin
    if FCommonData.Skinned and not Loading then begin
    Items.BeginUpdate;
    InitControl(True);
    if HandleAllocated and Assigned(Ac_UninitializeFlatS:cool: then
    Ac_UninitializeFlatSB(Handle);

    RefreshEditScrolls(SkinData, ListSW);
    CommonWndProc(Message, FCommonData);
    if not FCommonData.CustomColor then
    Color := FCommonData.SkinManager.gd[FCommonData.SkinIndex].Props[0].Color;

    InitSkinParams;
    PrepareCache;
    RedrawWindow(Handle, nil, 0, RDW_FRAME or RDW_INVALIDATE or RDW_UPDATENOW or RDW_ALLCHILDREN);
    Items.EndUpdate;
    end;
    Exit;
    end;

    #41786
    Support
    Keymaster

    Hello! Thank you, these changes will be included in the nearest release.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.