projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing two unicode compile errors
[wxWidgets.git]
/
src
/
mac
/
carbon
/
radiobox.cpp
diff --git
a/src/mac/carbon/radiobox.cpp
b/src/mac/carbon/radiobox.cpp
index 020354b76082c16f165a92e6c52043655bacbaa0..930080feb0f617c899a86f3250c6d58daf1b3aeb 100644
(file)
--- a/
src/mac/carbon/radiobox.cpp
+++ b/
src/mac/carbon/radiobox.cpp
@@
-9,10
+9,6
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-//-------------------------------------------------------------------------------------
-// headers
-//-------------------------------------------------------------------------------------
-
#include "wx/wxprec.h"
#if wxUSE_RADIOBOX
#include "wx/wxprec.h"
#if wxUSE_RADIOBOX
@@
-36,10
+32,10
@@
void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
{
wxCommandEvent event( wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId );
int i = GetSelection() ;
{
wxCommandEvent event( wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId );
int i = GetSelection() ;
- event.SetInt(
i
);
- event.SetString(
GetString( i )
);
+ event.SetInt(
i
);
+ event.SetString(
GetString(i)
);
event.SetEventObject( this );
event.SetEventObject( this );
- ProcessCommand(
event
);
+ ProcessCommand(
event
);
}
}
}
}
@@
-101,13
+97,13
@@
bool wxRadioBox::Create( wxWindow *parent,
int i;
int i;
- m_noItems = (
size_
t)n;
+ m_noItems = (
unsigned in
t)n;
m_noRowsOrCols = majorDim;
m_radioButtonCycle = NULL;
SetMajorDim( majorDim == 0 ? n : majorDim, style );
m_noRowsOrCols = majorDim;
m_radioButtonCycle = NULL;
SetMajorDim( majorDim == 0 ? n : majorDim, style );
- m_label = label
;
+ m_label = label;
Rect bounds = wxMacGetBoundsForControl( this, pos, size );
if ( bounds.right <= bounds.left )
Rect bounds = wxMacGetBoundsForControl( this, pos, size );
if ( bounds.right <= bounds.left )
@@
-154,7
+150,7
@@
bool wxRadioBox::Enable(bool enable)
return false;
current = m_radioButtonCycle;
return false;
current = m_radioButtonCycle;
- for (
size_
t i = 0; i < m_noItems; i++)
+ for (
unsigned in
t i = 0; i < m_noItems; i++)
{
current->Enable( enable );
current = current->NextInCycle();
{
current->Enable( enable );
current = current->NextInCycle();
@@
-165,16
+161,13
@@
bool wxRadioBox::Enable(bool enable)
// Enables or disables an given button
//
// Enables or disables an given button
//
-bool wxRadioBox::Enable(int item, bool enable)
+bool wxRadioBox::Enable(
unsigned
int item, bool enable)
{
{
- int i;
- wxRadioButton *current;
-
if (!IsValid( item ))
return false;
if (!IsValid( item ))
return false;
- i = 0;
- current = m_radioButtonCycle;
+
unsigned int
i = 0;
+
wxRadioButton *
current = m_radioButtonCycle;
while (i != item)
{
i++;
while (i != item)
{
i++;
@@
-193,15
+186,14
@@
wxString wxRadioBox::GetLabel() const
// Returns the label for the given button
//
// Returns the label for the given button
//
-wxString wxRadioBox::GetString(int item) const
+wxString wxRadioBox::GetString(
unsigned
int item) const
{
{
- int i;
wxRadioButton *current;
if (!IsValid( item ))
return wxEmptyString;
wxRadioButton *current;
if (!IsValid( item ))
return wxEmptyString;
- i = 0;
+
unsigned int
i = 0;
current = m_radioButtonCycle;
while (i != item)
{
current = m_radioButtonCycle;
while (i != item)
{
@@
-239,16
+231,13
@@
void wxRadioBox::SetLabel(const wxString& label)
// Sets the label of a given button
//
// Sets the label of a given button
//
-void wxRadioBox::SetString(int item,const wxString& label)
+void wxRadioBox::SetString(
unsigned
int item,const wxString& label)
{
{
- int i;
- wxRadioButton *current;
-
if (!IsValid( item ))
return;
if (!IsValid( item ))
return;
- i = 0;
- current = m_radioButtonCycle;
+
unsigned int
i = 0;
+
wxRadioButton *
current = m_radioButtonCycle;
while (i != item)
{
i++;
while (i != item)
{
i++;
@@
-287,7
+276,7
@@
bool wxRadioBox::Show(bool show)
wxRadioButton *current;
current = m_radioButtonCycle;
wxRadioButton *current;
current = m_radioButtonCycle;
- for (
size_
t i=0; i<m_noItems; i++)
+ for (
unsigned in
t i=0; i<m_noItems; i++)
{
current->Show( show );
current = current->NextInCycle();
{
current->Show( show );
current = current->NextInCycle();
@@
-300,16
+289,13
@@
bool wxRadioBox::Show(bool show)
// Shows or hides the given button
//
// Shows or hides the given button
//
-bool wxRadioBox::Show(int item, bool show)
+bool wxRadioBox::Show(
unsigned
int item, bool show)
{
{
- int i;
- wxRadioButton *current;
-
if (!IsValid( item ))
return false;
if (!IsValid( item ))
return false;
- i = 0;
- current = m_radioButtonCycle;
+
unsigned int
i = 0;
+
wxRadioButton *
current = m_radioButtonCycle;
while (i != item)
{
i++;
while (i != item)
{
i++;
@@
-387,9
+373,9
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
maxWidth = -1;
maxHeight = -1;
maxWidth = -1;
maxHeight = -1;
- for (
size_
t i = 0 ; i < m_noItems; i++)
+ for (
unsigned in
t i = 0 ; i < m_noItems; i++)
{
{
- GetTextExtent(
GetString( i
), &eachWidth[i], &eachHeight[i] );
+ GetTextExtent(
GetString(i
), &eachWidth[i], &eachHeight[i] );
eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
eachHeight[i] = (int)((3 * eachHeight[i]) / 2);
eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
eachHeight[i] = (int)((3 * eachHeight[i]) / 2);
@@
-433,7
+419,7
@@
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
y_offset = y_start;
current = m_radioButtonCycle;
y_offset = y_start;
current = m_radioButtonCycle;
- for (
i = 0 ; i <
m_noItems; i++)
+ for (
i = 0 ; i < (int)
m_noItems; i++)
{
// not to do for the zero button!
if ((i > 0) && ((i % GetMajorDim()) == 0))
{
// not to do for the zero button!
if ((i > 0) && ((i % GetMajorDim()) == 0))
@@
-477,9
+463,9
@@
wxSize wxRadioBox::DoGetBestSize() const
maxWidth = -1;
maxHeight = -1;
maxWidth = -1;
maxHeight = -1;
- for (
size_
t i = 0 ; i < m_noItems; i++)
+ for (
unsigned in
t i = 0 ; i < m_noItems; i++)
{
{
- GetTextExtent(
GetString( i
), &eachWidth, &eachHeight, NULL, NULL, &font );
+ GetTextExtent(
GetString(i
), &eachWidth, &eachHeight, NULL, NULL, &font );
eachWidth = (int)(eachWidth + RADIO_SIZE);
eachHeight = (int)((3 * eachHeight) / 2);
if (maxWidth < eachWidth)
eachWidth = (int)(eachWidth + RADIO_SIZE);
eachHeight = (int)((3 * eachHeight) / 2);
if (maxWidth < eachWidth)