SkinManager internal skin order

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35370
    dhwz2001
    Participant

    Can you please add some sort of a sorting function to the skinmanager?

    If I add a new skin to the internal skins it is always attached to the bottom of the list (I know the interalskin editor is showing them in alphabetical order), but they are not sorted alphabetically internally, so when I create the skin list on thy fly in my program they are not sorted.

    I've always to remove all skins and add them new in the right order. 🙁

    #49030
    CheshireCat
    Participant

    Hello dhwz2001,

    internal skins is a TCollectionItem class and cannot be sorted by default. Maybe you can take a TsListBox or TStringList to show and save the internal skins.

    For example:

    Code:
    procedure TForm1.sButton1Click(Sender: TObject);
    var
    i: integer;
    begin
    sListBox1.Items.Clear; // clear the list
    sListBox1.Sorted := True; // alphabetical order

    // add internal skins to the list
    for i := 0 to sSkinManager1.InternalSkins.Count – 1 do
    sListBox1.Items.Add(sSkinManager1.InternalSkins.Items.Name)

    end;

    Best regards

    Sascha

    #49035
    dhwz2001
    Participant

    Ok, thanks for the info.

    Too bad that my skin selection is part of the mainmenu.

    I think I have to make a workaround for that problem. ^_^

    #49036
    CheshireCat
    Participant

    My workaround would look like this:

    Code:
    procedure TForm1.FormCreate(Sender: TObject);
    var
    tmpList: TStringList;
    i: integer;
    mItem: TMenuItem;
    begin
    tmpList := TStringList.Create;
    tmpList.Sorted := True;

    for i := 0 to sSkinManager1.InternalSkins.Count – 1 do
    tmpList.Add(sSkinManager1.InternalSkins.Items.Name);

    for i := 0 to tmpList.Count – 1 do
    begin
    mItem := TMenuItem.Create(Self);
    mItem.Caption := tmpList;
    SkinsItem.Add(mItem);
    end;

    tmpList.Free;
    end;

    Best regards

    Sascha

    #49037
    dhwz2001
    Participant

    Yes, that how I made it too. :a3:

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