Idea for the skinManager component.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #59430
    Support
    Keymaster

      I will think about such event.

      #59457
      JM-DG
      Participant

        I see that the new event has been added.

        Thank you for that. 🙂

        However I thought that the event would come after the new skin information has been loaded up. +/- line 3160

        After the code:

        Code:
        ResetSkinData;
        InitCommonData;

        Example:

        Code:
        try
        ResetSkinData;
        InitCommonData;
        except
        on E: Exception do begin
        FSkinName := OldName;
        ShowError(E.Message);
        end;
        end;

        if Assigned(FOnSkinChanging) then begin
        FOnSkinChanging(Self, FSkinName);
        end;

        If not, I have to redo some of the logic in the current onSkinChanging event in order to get the color palettes of the new skin being loaded.

        Ex:

        Code:
        procedure TDataModule1.sSkinManager1SkinChanging(Sender: TObject;
        const NewSkinName: String; var AllowChanging: Boolean);
        var color:TColor;
        begin
        sSkinManager1.ManagerState := sSkinManager1.ManagerState + [msSkinChanging];
        sSkinManager1.ResetSkinData;
        sSkinManager1.CommonSkinData;
        sSkinManager1.ManagerState := sSkinManager1.ManagerState – [msSkinChanging];

        color := clNone;
        if(not IsDarkColor(sSkinManager1.GetGlobalColor)) then
        begin
        color:= sSkinManager1.GetHighLightColor(true);
        end;

        BorderIcons.BlendColor:= color;
        PlayerControls.BlendColor:= color;
        LargePlayerControls.BlendColor:= color;
        end;

        #59475
        Support
        Keymaster

          The OnSkinChanging event occurs before loading of new skin and allows to prevent loading of the skin.

          Look on the OnSkinLoading event. This event occurs when skin is loaded but not activated yet. Maybe that's what you need.

          #59480
          JM-DG
          Participant
            'Support' wrote:

            The OnSkinChanging event occurs before loading of new skin and allows to prevent loading of the skin.

            Look on the OnSkinLoading event. This event occurs when skin is loaded but not activated yet. Maybe that's what you need.

            I tried the OnSkinLoading event before and it was causing me some problem… (I can't remember what)

            However I just tried it again and everything worked fine.

            Thank you. This is what I needed.

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