projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bring in the definition of wxSizer, making non-precomp builds working again after...
[wxWidgets.git]
/
src
/
osx
/
radiobox_osx.cpp
diff --git
a/src/osx/radiobox_osx.cpp
b/src/osx/radiobox_osx.cpp
index 6ad4a138f9503895b6a90eab239ff5cec2a287a9..4ba2abf0193eb5d43041369849709ccf4d25e9f1 100644
(file)
--- a/
src/osx/radiobox_osx.cpp
+++ b/
src/osx/radiobox_osx.cpp
@@
-52,7
+52,7
@@
wxRadioBox::wxRadioBox()
wxRadioBox::~wxRadioBox()
{
wxRadioBox::~wxRadioBox()
{
-
m_isBeingDeleted = true
;
+
SendDestroyEvent()
;
wxRadioButton *next, *current;
wxRadioButton *next, *current;
@@
-399,7
+399,7
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i] );
eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
{
GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i] );
eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
- eachHeight[i] = (int)
((3 * eachHeight[i]) / 2)
;
+ eachHeight[i] = (int)
eachHeight[i]
;
if (maxWidth < eachWidth[i])
maxWidth = eachWidth[i];
if (maxWidth < eachWidth[i])
maxWidth = eachWidth[i];
@@
-407,7
+407,7
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
maxHeight = eachHeight[i];
}
maxHeight = eachHeight[i];
}
- totHeight = GetRowCount() * maxHeight;
+ totHeight = GetRowCount() * maxHeight
+ (GetRowCount() - 1) * maxHeight / 2
;
totWidth = GetColumnCount() * (maxWidth + charWidth);
wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) ) ;
totWidth = GetColumnCount() * (maxWidth + charWidth);
wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) ) ;
@@
-434,8
+434,8
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
// arrange radio buttons
int x_start, y_start;
// arrange radio buttons
int x_start, y_start;
- x_start =
0
;
- y_start =
0
;
+ x_start =
( width - sz.x ) / 2
;
+ y_start =
( height - sz.y ) / 2
;
x_offset = x_start;
y_offset = y_start;
x_offset = x_start;
y_offset = y_start;
@@
-454,7
+454,7
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
else
{
x_offset = x_start;
else
{
x_offset = x_start;
- y_offset +=
maxHeight
; //+ charHeight / 2
+ y_offset +=
3 * maxHeight / 2
; //+ charHeight / 2
}
}
}
}
@@
-462,7
+462,7
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
current = current->NextInCycle();
if (m_windowStyle & wxRA_SPECIFY_ROWS)
current = current->NextInCycle();
if (m_windowStyle & wxRA_SPECIFY_ROWS)
- y_offset +=
maxHeight
; // + charHeight / 2
+ y_offset +=
3 * maxHeight / 2
; // + charHeight / 2
else
x_offset += maxWidth + charWidth;
}
else
x_offset += maxWidth + charWidth;
}
@@
-489,20
+489,24
@@
wxSize wxRadioBox::DoGetBestSize() const
{
GetTextExtent(GetString(i), &eachWidth, &eachHeight, NULL, NULL, &font );
eachWidth = (int)(eachWidth + RADIO_SIZE);
{
GetTextExtent(GetString(i), &eachWidth, &eachHeight, NULL, NULL, &font );
eachWidth = (int)(eachWidth + RADIO_SIZE);
- eachHeight = (int)
((3 * eachHeight) / 2)
;
+ eachHeight = (int)
eachHeight
;
if (maxWidth < eachWidth)
maxWidth = eachWidth;
if (maxHeight < eachHeight)
maxHeight = eachHeight;
}
if (maxWidth < eachWidth)
maxWidth = eachWidth;
if (maxHeight < eachHeight)
maxHeight = eachHeight;
}
- totHeight = GetRowCount() * maxHeight;
+ totHeight = GetRowCount() * maxHeight
+ (GetRowCount() - 1) * maxHeight / 2
;
totWidth = GetColumnCount() * (maxWidth + charWidth);
wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) );
totWidth = sz.x;
totHeight = sz.y;
totWidth = GetColumnCount() * (maxWidth + charWidth);
wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) );
totWidth = sz.x;
totHeight = sz.y;
+ // optimum size is an additional 5 pt border to all sides
+ totWidth += 10;
+ totHeight += 10;
+
// handle radio box title as well
GetTextExtent( GetLabel(), &eachWidth, NULL );
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth;
// handle radio box title as well
GetTextExtent( GetLabel(), &eachWidth, NULL );
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth;
@@
-512,4
+516,13
@@
wxSize wxRadioBox::DoGetBestSize() const
return wxSize( totWidth, totHeight );
}
return wxSize( totWidth, totHeight );
}
+bool wxRadioBox::SetFont(const wxFont& font)
+{
+ bool retval = wxWindowBase::SetFont( font );
+
+ // dont' update the native control, it has its own small font
+
+ return retval;
+}
+
#endif // wxUSE_RADIOBOX
#endif // wxUSE_RADIOBOX