- This topic has 4 replies, 2 voices, and was last updated 5 years, 6 months ago by JM-DG.
-
AuthorPosts
-
May 6, 2019 at 2:49 am #38248JM-DGParticipant
Hi!
The idea is simple.
It would be nice to have an accessible event between “onBeforeChange” & “onAfterChange”.
The reason is that I want to get access to some informations of the next skin being loaded, so this means after the “onBeforeChange” event;
but before that skin gets fully loaded/updated/repaint everything, so this means before the “onAfterChange” event.
Right now, I added a “OnChange” event just after +/- line 3132:
Code:try
ResetSkinData;
InitCommonData;
except
on E: Exception do begin
FSkinName := OldName;
ShowError(E.Message);
end;
end;
===============
if Assigned(FOnChange) then
FOnChange(Self);
===============Thank you for your time.
May 8, 2019 at 5:09 am #59430SupportKeymasterI will think about such event.
May 14, 2019 at 12:59 am #59457JM-DGParticipantI 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;May 22, 2019 at 4:54 am #59475SupportKeymasterThe 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.
May 22, 2019 at 10:38 pm #59480JM-DGParticipant'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.
-
AuthorPosts
- You must be logged in to reply to this topic.