View Single Post
  #8  
Old 28-05-2022, 00:21
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 596
Thanks: 599
Thanked 659 Times in 234 Posts
Carldric Clement is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
@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 didn't expect that code before. they just joined with some other point-like
(Bottom = Top + Bottom) and (Right = Left + Right).

I'm gonna try to do with these code on Designer.
Reply With Quote