@Carldric Clement, in CIU the "MusicIcon" button when positioned over the "MusicButton" button (RectInRect) is set to disabled, so the actions of the "MusicButton" button change the state of "MusicIcon", but it behaves only visually (no Click or OnMouse actions ).
The same goes for MusicIconAR (together with MusicARButton) and also for MusicIconSI (together with SmallMusicButton).
- "MusicIconAR", "MusicIcon" and "MusicIconSI" is a normal Botva2 pot with 4 images (idle, selected, clicked, disabled) arranged vertically in an image (in the CIU theme example, only the disabled icon was created because it does not use the other images).
- "MusicButtonAR", "MusicButton" and "SmallMusicButton" is a CstmButtom by Yener90 with 4 images separately.
P.S: You can see the code at the end of the ButtonsTextures procedure in the CIU script.
Code:
BtnGetPosition(hMusicAR, Rt.Left, Rt.Top, Rt.Bottom, Rt.Right);
Rt.Bottom := Rt.Top + Rt.Bottom;
Rt.Right:= Rt.Left + Rt.Right;
if BtnY(MusicARBtn, CstmBtnInt) then
BtnSetEnabled(hMusicAR, not RectInRect(Rt, BoundsToRect(CstmBtn[CstmBtnInt].AreaX, CstmBtn[CstmBtnInt].AreaY, CstmBtn[CstmBtnInt].AreaW, CstmBtn[CstmBtnInt].AreaH)));
BtnGetPosition(hMusic, Rt.Left, Rt.Top, Rt.Bottom, Rt.Right);
Rt.Bottom := Rt.Top + Rt.Bottom;
Rt.Right:= Rt.Left + Rt.Right;
if BtnY(MusicBtn, CstmBtnInt) then
BtnSetEnabled(hMusic, not RectInRect(Rt, BoundsToRect(CstmBtn[CstmBtnInt].AreaX, CstmBtn[CstmBtnInt].AreaY, CstmBtn[CstmBtnInt].AreaW, CstmBtn[CstmBtnInt].AreaH)));
BtnGetPosition(hMusicSI, Rt.Left, Rt.Top, Rt.Bottom, Rt.Right);
Rt.Bottom := Rt.Top + Rt.Bottom;
Rt.Right:= Rt.Left + Rt.Right;
if BtnY(MusicSmallBtn, CstmBtnInt) then
BtnSetEnabled(hMusicSI, not RectInRect(Rt, BoundsToRect(CstmBtn[CstmBtnInt].AreaX, CstmBtn[CstmBtnInt].AreaY, CstmBtn[CstmBtnInt].AreaW, CstmBtn[CstmBtnInt].AreaH)));
BtnGetPosition(hPauseSI, Rt.Left, Rt.Top, Rt.Bottom, Rt.Right);
Rt.Bottom := Rt.Top + Rt.Bottom;
Rt.Right:= Rt.Left + Rt.Right;
if BtnY(PauseSmallBtn, CstmBtnInt) then
BtnSetEnabled(hPauseSI, not RectInRect(Rt, BoundsToRect(CstmBtn[CstmBtnInt].AreaX, CstmBtn[CstmBtnInt].AreaY, CstmBtn[CstmBtnInt].AreaW, CstmBtn[CstmBtnInt].AreaH)));
end;
I don't want to be intrusive in your work, I just want to try to help you understand some things that are not so visible in CIU's behavior.