TFrame Skin Issues

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35069
    Jamie
    Participant

    I'm having issues getting some TFrames to skin properly. We have kind a of a complex system going, in the particular configuration we have multiple skin managers in existence, this generally works fine, except with *some* TFrame derived frames. I did discover that TsFrameAdapter enabled some of the more basic frames to start skinning properly (I was able to just drop one on the form and move on). However, some of our forms are more complex from a TFrame prospective, ie we have a base frame (derived from TFrame) and then others derive off of that, then the derived frames are created dynamically. Dropping a TsFrameAdapter on the base frame doesn't seem to resolve anything, no skinning. As far as creating a TsFrameAdapter dynamically goes I'm wondering if I'm doing that correctly, I'm essentially just doing this in derived frame:

    mFrameAdapter = new TsFrameAdapter(this);

    I've tried also setting the SkinManager in the TsFrameAdapter as well (after newing it) with no luck, but frankly if the adapter would just allow the derived frame to skin from the default SkinManager that would be fine with me as well, I can work with that. I see in the docs that calling “DoHook” is required, but that doesn't seem to be accurate, that won't even compile. I know that providing you an example would be ideal, but I'm not going to be able to do that, so any ideas would be greatly appreciated. One more data point I guess, this all works fine when we only have one skin manager active in the system, even without any TsFrameAdapters on anything. Another interesting thing that is happening is that on the frames that won't skin properly there is some skinning, ie one frame contains TsPanels with TsLabels and TsGroupboxes, the labels are skinned but the panels and groupboxes aren't.

    Thanks,

    Jamie

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