Fix creating wxRadioBox with no items in wxUniv
Don't select the first item if there are no items at all. See #23784. (cherry picked from commit d282cc96579ff36f00b4c2f1c9aea3cdca9dfa64)
This commit is contained in:
parent
f76ba198eb
commit
fce3346a18
@ -322,6 +322,7 @@ wxOSX:
|
||||
wxUniv:
|
||||
|
||||
- Fix resetting the hint in wxTextCtrl when it gets focus (Kvaz1r, #23511).
|
||||
- Fix creating wxRadioBox without any items (Kvaz1r, #23784).
|
||||
|
||||
|
||||
3.2.2.1: (released 2023-02-13)
|
||||
|
@ -162,8 +162,10 @@ bool wxRadioBox::Create(wxWindow *parent,
|
||||
wxSize actualSize = GetSize();
|
||||
DoMoveWindow(actualPos.x, actualPos.y, actualSize.x, actualSize.y);
|
||||
|
||||
// radiobox should already have selection so select at least one item
|
||||
SetSelection(0);
|
||||
// Select first radio button if we have any buttons at all, as the radiobox
|
||||
// should always have some selection.
|
||||
if ( n != 0 )
|
||||
SetSelection(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user