projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compare charset strings case-insensitively (and so avoid conversions between utf...
[wxWidgets.git]
/
src
/
msw
/
radiobox.cpp
diff --git
a/src/msw/radiobox.cpp
b/src/msw/radiobox.cpp
index 66534b1e2ad23d0a99b148c7a07cf4be5db4a368..45424eb27e37cde7784ba9935b21ff6ddcde787d 100644
(file)
--- a/
src/msw/radiobox.cpp
+++ b/
src/msw/radiobox.cpp
@@
-211,7
+211,7
@@
bool wxRadioBox::Create(wxWindow *parent,
SetSize(pos.x, pos.y, size.x, size.y);
// Now that we have items determine what is the best size and set it.
SetSize(pos.x, pos.y, size.x, size.y);
// Now that we have items determine what is the best size and set it.
- Set
Best
Size(size);
+ Set
Initial
Size(size);
return true;
}
return true;
}
@@
-323,7
+323,7
@@
void wxRadioBox::SendNotificationEvent()
unsigned int wxRadioBox::GetCount() const
{
unsigned int wxRadioBox::GetCount() const
{
- return m_radioButtons
->GetCount()
;
+ return m_radioButtons
? m_radioButtons->GetCount() : 0u
;
}
void wxRadioBox::SetString(unsigned int item, const wxString& label)
}
void wxRadioBox::SetString(unsigned int item, const wxString& label)
@@
-495,7
+495,7
@@
wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
// and also wide enough for its label
int widthLabel;
// and also wide enough for its label
int widthLabel;
- GetTextExtent(
wxStripMenuCodes(GetLabel()
), &widthLabel, NULL);
+ GetTextExtent(
GetLabelText(
), &widthLabel, NULL);
widthLabel += RADIO_SIZE; // FIXME this is bogus too
if ( widthLabel > width )
width = widthLabel;
widthLabel += RADIO_SIZE; // FIXME this is bogus too
if ( widthLabel > width )
width = widthLabel;
@@
-505,6
+505,13
@@
wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
wxSize wxRadioBox::DoGetBestSize() const
{
wxSize wxRadioBox::DoGetBestSize() const
{
+ if ( !m_radioButtons )
+ {
+ // if we're not fully initialized yet, we can't meaningfully compute
+ // our best size, we'll do it later
+ return wxSize(1, 1);
+ }
+
wxSize best = GetTotalButtonSize(GetMaxButtonSize());
CacheBestSize(best);
return best;
wxSize best = GetTotalButtonSize(GetMaxButtonSize());
CacheBestSize(best);
return best;