View Single Post
  #7  
Old 27-05-2022, 13:15
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
@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.

Last edited by Cesar82; 27-05-2022 at 13:22.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Carldric Clement (28-05-2022)