Image problem in TsListView (vsIcon mode)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37961
    HeDiBo
    Participant

    The problem is very difficult to reproduce in a test project.

    I have a TsListView showing the skincontroller's images for skins.

    Whenever I change skin, the images are all blanked a1.gif

    This is the panel with the images (the skin Sport is about to be selected):

    [attachment=8915:TsListView Before.jpg]

    This is the panel after Sport has been selected:

    [attachment=8916:TsListView After.jpg]

    Also if I select another skin from the program icon in stead, the same thing happens.

    This is the little code that shows the images:

    Code:
    procedure TfrSettings.RedrawSkins;
    var
    i: Integer;
    li: TListItem;
    begin
    with dmWIP4 do begin
    lvSkins.Clear;
    lvSkins.Visible := sSkinManager.Active;
    gbSamples.Visible := lvSkins.Visible;
    if lvSkins.Visible then begin
    lvSkins.SortType := stText; // Show in skin name sequence
    lvSkins.LargeImages := SkinImages;
    for i := 0 to SkinNames.Count-1 do begin
    li := lvSkins.Items.Add;
    li.Caption := SkinNames;
    li.ImageIndex := i;
    if sSkinManager.SkinName = li.Caption then lvSkins.Selected := li;
    end{for};
    end{if};
    end{with};
    lvSkins.Refresh;
    end;

    This is the dfm part for the list view:

    Code:
    object lvSkins: TsListView
    AlignWithMargins = True
    Left = 1
    Top = 47
    Width = 687
    Height = 389
    Margins.Left = 0
    Margins.Top = 5
    Margins.Right = 0
    Margins.Bottom = 0
    DoubleBuffered = True
    SkinData.SkinSection = 'PANEL'
    HighlightHeaders = False
    Align = alClient
    AllocBy = 4
    Columns = <>
    ColumnClick = False
    HideSelection = False
    HotTrack = True
    HotTrackStyles = [htHandPoint]
    HoverTime = 10000000
    IconOptions.AutoArrange = True
    IconOptions.WrapText = False
    ShowColumnHeaders = False
    TabOrder = 1
    OnSelectItem = lvSkinsSelectItem
    end

    Apologies for the incorrect indentations, it's my browser, I think.

    The SkinImages and SkinNames were loaded once upon the program start.

    #58435
    Support
    Keymaster

    I see defining of the LargeImages to SkinImage:

    Code:
    lvSkins.LargeImages := SkinImages;

    How the SkinImages ImageList is filled? It looks like SkinImage is empty when images are not visible.

    #58438
    HeDiBo
    Participant
    'Support' wrote:

    I see defining of the LargeImages to SkinImage:

    Code:
    lvSkins.LargeImages := SkinImages;

    How the SkinImages ImageList is filled? It looks like SkinImage is empty when images are not visible.

    Thank you a7.gif

    Your answer made me rethink the logic. And sure enough, I made a silly mistake. a8.gif

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