SkinManager internal skin order

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.