Skip to content

Commit

Permalink
When CUIRadioButton was changed, don't forget to send RADIOBUTTON_SET…
Browse files Browse the repository at this point in the history
… event (#943)
  • Loading branch information
Xottab-DUTY committed Jan 17, 2025
1 parent 09a22f1 commit e4d9d8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/xrUICore/Buttons/UIRadioButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ bool CUIRadioButton::InitTexture(pcstr /*texture*/, bool /*fatal = true*/)
return true;
}

void CUIRadioButton::SendMessage(CUIWindow* pWnd, s16 msg, void* pData)
{
if (!IsEnabled())
return;

inherited::SendMessage(pWnd, msg, pData);

if (msg == TAB_CHANGED && this == pWnd)
{
GetMessageTarget()->SendMessage(this, RADIOBUTTON_SET, nullptr);
}
}

bool CUIRadioButton::OnMouseDown(int mouse_btn)
{
const bool result = inherited::OnMouseDown(mouse_btn);
Expand Down
1 change: 1 addition & 0 deletions src/xrUICore/Buttons/UIRadioButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CUIRadioButton final : public CUITabButton
public:
virtual void InitButton(Fvector2 pos, Fvector2 size);
virtual bool InitTexture(pcstr texture, bool fatal = true);
void SendMessage(CUIWindow* pWnd, s16 msg, void* pData = nullptr) override;
bool OnMouseDown(int mouse_btn) override;
pcstr GetDebugType() override { return "CUIRadioButton"; }
};

0 comments on commit e4d9d8c

Please sign in to comment.