TFrame Skin Issues

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #47821
    Jamie
    Participant

      On another note maybe it would be easier to just get rid of the multiple skin managers, that would work great as well. The reason that we have multiple skin managers is that we sometimes have duplicate forms and we change the title bar color to differentiate them, we use the following code (roughly) to alter the title bar colors based on skin manager:

      {

      SmaskData::TsGeneralData &gData = SkinManager->gd[SkinManager->GetSkinIndex(s_FormTitle)];

      gData.Color = newColor;

      gData.HotColor = newColor;

      SkinManager->RepaintForms();

      }

      Is there another way that we could alter the title bar color on a per form basis without multiple skin managers?

      #47914
      Support
      Keymaster

        Hello, Jamie

        I think you can try another way.

        TsSkinManager component have the CommonSections property. This property adds new sections into every skin which is loaded in this TsSkinManager.

        Here is a sample code :

        Code:
        const
        NewSectionName = 'REDTITLE';
        begin
        // Add a new Common Skin Section
        sSkinManager1.CommonSections.Add('[' + NewSectionName + ']');
        sSkinManager1.CommonSections.Add('HOTTRANSPARENCY=0');
        sSkinManager1.CommonSections.Add('TRANSPARENCY=0');
        sSkinManager1.CommonSections.Add('HOTCOLOR=255');
        sSkinManager1.CommonSections.Add('COLOR=255');

        // Reinit skin data
        sSkinManager1.SkinName := sSkinManager1.SkinName;

        // Change a title section
        sSkinProvider1.TitleSkin := NewSectionName;

        // Update internal data. This line will not be required in the AlphaControls 7.62 and newer
        SendAMessage(sSkinProvider1.Form.Handle, AC_SETNEWSKIN, longword(sSkinManager1));
        end;

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