[1231183] 'cleanup: mismatched indentation' and other cleanings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-22 18:08:18 +00:00
parent 0a164d4c4e
commit 3dee36ae33
12 changed files with 500 additions and 505 deletions

View File

@@ -1443,7 +1443,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
event.SetEventObject(def); event.SetEventObject(def);
def->Command(event); def->Command(event);
return true ; return true ;
} }
} }
/* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */ /* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) ) else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) )

View File

@@ -119,89 +119,89 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemID itemID, DataBrowserPropertyID property,
DataBrowserItemDataRef itemData, Boolean changeValue) DataBrowserItemDataRef itemData, Boolean changeValue)
{ {
OSStatus err = errDataBrowserPropertyNotSupported; OSStatus err = errDataBrowserPropertyNotSupported;
if ( ! changeValue ) if ( ! changeValue )
{ {
switch (property) switch (property)
{ {
case kTextColumnId: case kTextColumnId:
{ {
long ref = GetControlReference( browser ) ; long ref = GetControlReference( browser ) ;
if ( ref ) if ( ref )
{ {
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
int i = itemID - 1 ; int i = itemID - 1 ;
if (i >= 0 && i < list->GetCount() ) if (i >= 0 && i < list->GetCount() )
{ {
wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ; wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ;
verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ; verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ;
err = noErr ; err = noErr ;
} }
} }
} }
break; break;
case kCheckboxColumnId : case kCheckboxColumnId :
{ {
long ref = GetControlReference( browser ) ; long ref = GetControlReference( browser ) ;
if ( ref ) if ( ref )
{ {
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
int i = itemID - 1 ; int i = itemID - 1 ;
if (i >= 0 && i < list->GetCount() ) if (i >= 0 && i < list->GetCount() )
{ {
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ; verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ;
err = noErr ; err = noErr ;
} }
} }
} }
break ; break ;
case kDataBrowserItemIsEditableProperty: case kDataBrowserItemIsEditableProperty:
{ {
err = ::SetDataBrowserItemDataBooleanValue(itemData, true); err = ::SetDataBrowserItemDataBooleanValue(itemData, true);
} }
break; break;
default: default:
break; break;
} }
} }
else else
{ {
switch( property ) switch( property )
{ {
case kCheckboxColumnId : case kCheckboxColumnId :
{ {
long ref = GetControlReference( browser ) ; long ref = GetControlReference( browser ) ;
if ( ref ) if ( ref )
{ {
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ; wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
int i = itemID - 1 ; int i = itemID - 1 ;
if (i >= 0 && i < list->GetCount() ) if (i >= 0 && i < list->GetCount() )
{ {
// we have to change this behind the back, since Check() would be triggering another update round // we have to change this behind the back, since Check() would be triggering another update round
bool newVal = !list->IsChecked( i ) ; bool newVal = !list->IsChecked( i ) ;
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , newVal ? kThemeButtonOn : kThemeButtonOff ) ) ; verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , newVal ? kThemeButtonOn : kThemeButtonOff ) ) ;
err = noErr ; err = noErr ;
list->m_checks[ i ] = newVal ; list->m_checks[ i ] = newVal ;
wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, list->GetId()); wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, list->GetId());
event.SetInt(i); event.SetInt(i);
event.SetEventObject(list); event.SetEventObject(list);
list->GetEventHandler()->ProcessEvent(event); list->GetEventHandler()->ProcessEvent(event);
} }
} }
} }
break ; break ;
default : default :
break ; break ;
} }
} }
return err; return err;
} }
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxPoint& pos,
@@ -211,7 +211,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
m_macIsUserPane = FALSE ; m_macIsUserPane = false ;
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
_T("only one of listbox selection modes can be specified") ); _T("only one of listbox selection modes can be specified") );
@@ -245,43 +245,43 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
DataBrowserListViewColumnDesc columnDesc ; DataBrowserListViewColumnDesc columnDesc ;
columnDesc.headerBtnDesc.titleOffset = 0; columnDesc.headerBtnDesc.titleOffset = 0;
columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc; columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;
columnDesc.headerBtnDesc.btnFontStyle.flags = columnDesc.headerBtnDesc.btnFontStyle.flags =
kControlUseFontMask | kControlUseJustMask; kControlUseFontMask | kControlUseJustMask;
columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent; columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent;
columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault; columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault;
columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont; columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont;
columnDesc.headerBtnDesc.btnFontStyle.style = normal; columnDesc.headerBtnDesc.btnFontStyle.style = normal;
columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" ); columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" );
// check column // check column
columnDesc.headerBtnDesc.minimumWidth = 30 ; columnDesc.headerBtnDesc.minimumWidth = 30 ;
columnDesc.headerBtnDesc.maximumWidth = 30; columnDesc.headerBtnDesc.maximumWidth = 30;
columnDesc.propertyDesc.propertyID = kCheckboxColumnId; columnDesc.propertyDesc.propertyID = kCheckboxColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserCheckboxType; columnDesc.propertyDesc.propertyType = kDataBrowserCheckboxType;
columnDesc.propertyDesc.propertyFlags = kDataBrowserPropertyIsMutable | kDataBrowserTableViewSelectionColumn | columnDesc.propertyDesc.propertyFlags = kDataBrowserPropertyIsMutable | kDataBrowserTableViewSelectionColumn |
kDataBrowserDefaultPropertyFlags; kDataBrowserDefaultPropertyFlags;
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ; verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
// text column // text column
columnDesc.headerBtnDesc.minimumWidth = 0; columnDesc.headerBtnDesc.minimumWidth = 0;
columnDesc.headerBtnDesc.maximumWidth = 10000; columnDesc.headerBtnDesc.maximumWidth = 10000;
columnDesc.propertyDesc.propertyID = kTextColumnId; columnDesc.propertyDesc.propertyID = kTextColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserTextType; columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
| kDataBrowserListViewTypeSelectColumn | kDataBrowserListViewTypeSelectColumn
#endif #endif
; ;
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ; verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
verify_noerr( m_peer->AutoSizeListViewColumns() ) ; verify_noerr( m_peer->AutoSizeListViewColumns() ) ;
verify_noerr( m_peer->SetHasScrollBars( false , true ) ) ; verify_noerr( m_peer->SetHasScrollBars( false , true ) ) ;
@@ -292,11 +292,11 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
callbacks.version = kDataBrowserLatestCallbacks; callbacks.version = kDataBrowserLatestCallbacks;
InitDataBrowserCallbacks(&callbacks); InitDataBrowserCallbacks(&callbacks);
callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(ListBoxGetSetItemData); callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(ListBoxGetSetItemData);
callbacks.u.v1.itemNotificationCallback = callbacks.u.v1.itemNotificationCallback =
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
(DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc) ; (DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc) ;
#else #else
NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProc) ; NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProc) ;
#endif #endif
m_peer->SetCallbacks( &callbacks); m_peer->SetCallbacks( &callbacks);
@@ -315,7 +315,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
SetBestSize(size); // Needed because it is a wxControlWithItems SetBestSize(size); // Needed because it is a wxControlWithItems
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -324,7 +324,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
bool wxCheckListBox::IsChecked(size_t item) const bool wxCheckListBox::IsChecked(size_t item) const
{ {
wxCHECK_MSG( item < m_checks.GetCount(), FALSE, wxCHECK_MSG( item < m_checks.GetCount(), false,
_T("invalid index in wxCheckListBox::IsChecked") ); _T("invalid index in wxCheckListBox::IsChecked") );
return m_checks[item] != 0; return m_checks[item] != 0;
@@ -362,7 +362,7 @@ int wxCheckListBox::DoAppend(const wxString& item)
int pos = wxListBox::DoAppend(item); int pos = wxListBox::DoAppend(item);
// the item is initially unchecked // the item is initially unchecked
m_checks.Insert(FALSE, pos); m_checks.Insert(false, pos);
return pos; return pos;
} }
@@ -374,7 +374,7 @@ void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
size_t count = items.GetCount(); size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_checks.Insert(FALSE, pos + n); m_checks.Insert(false, pos + n);
} }
} }
@@ -386,7 +386,7 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
size_t count = items.GetCount(); size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_checks.Add(FALSE); m_checks.Add(false);
} }
} }

View File

@@ -197,12 +197,12 @@ void wxClipboard::Clear()
bool wxClipboard::Flush() bool wxClipboard::Flush()
{ {
return FALSE; return false;
} }
bool wxClipboard::Open() bool wxClipboard::Open()
{ {
wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") ); wxCHECK_MSG( !m_open, false, wxT("clipboard already open") );
m_open = true ; m_open = true ;
return true ; return true ;
} }
@@ -214,9 +214,9 @@ bool wxClipboard::IsOpened() const
bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::SetData( wxDataObject *data )
{ {
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); wxCHECK_MSG( data, false, wxT("data is invalid") );
Clear(); Clear();
// as we can only store one wxDataObject, this is the same in this // as we can only store one wxDataObject, this is the same in this
@@ -226,9 +226,9 @@ bool wxClipboard::SetData( wxDataObject *data )
bool wxClipboard::AddData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data )
{ {
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); wxCHECK_MSG( data, false, wxT("data is invalid") );
/* we can only store one wxDataObject */ /* we can only store one wxDataObject */
Clear(); Clear();
@@ -294,8 +294,8 @@ void wxClipboard::Close()
m_open = false ; m_open = false ;
// Get rid of cached object. If this is not done copying from another application will // Get rid of cached object. If this is not done copying from another application will
// only work once // only work once
if (m_data) if (m_data)
{ {
delete m_data; delete m_data;
@@ -306,10 +306,10 @@ void wxClipboard::Close()
bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
{ {
if ( m_data ) if ( m_data )
{ {
return m_data->IsSupported( dataFormat ) ; return m_data->IsSupported( dataFormat ) ;
} }
#if TARGET_CARBON #if TARGET_CARBON
OSStatus err = noErr; OSStatus err = noErr;
ScrapRef scrapRef; ScrapRef scrapRef;
@@ -324,11 +324,11 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
{ {
if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr)
{ {
return TRUE ; return true ;
} }
} }
} }
return FALSE; return false;
#else #else
long offset ; long offset ;
@@ -344,7 +344,7 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
bool wxClipboard::GetData( wxDataObject& data ) bool wxClipboard::GetData( wxDataObject& data )
{ {
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
size_t formatcount = data.GetFormatCount() + 1 ; size_t formatcount = data.GetFormatCount() + 1 ;
wxDataFormat *array = new wxDataFormat[ formatcount ]; wxDataFormat *array = new wxDataFormat[ formatcount ];

View File

@@ -165,7 +165,7 @@ protected:
event.SetEventObject(def); event.SetEventObject(def);
def->Command(event); def->Command(event);
return ; return ;
} }
} }
return; return;
@@ -219,7 +219,7 @@ private:
}; };
BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice) BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice)
EVT_CHOICE(-1, wxComboBoxChoice::OnChoice) EVT_CHOICE(wxID_ANY, wxComboBoxChoice::OnChoice)
END_EVENT_TABLE() END_EVENT_TABLE()
wxComboBox::~wxComboBox() wxComboBox::~wxComboBox()
@@ -275,13 +275,13 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) {
{ {
// we might not be fully constructed yet, therefore watch out... // we might not be fully constructed yet, therefore watch out...
if ( m_choice ) if ( m_choice )
m_choice->SetSize(0, 0 , width, -1); m_choice->SetSize(0, 0 , width, wxDefaultCoord);
} }
else else
{ {
wxCoord wText = width - POPUPWIDTH - MARGIN; wxCoord wText = width - POPUPWIDTH - MARGIN;
m_text->SetSize(0, 0, wText, height); m_text->SetSize(0, 0, wText, height);
m_choice->SetSize(0 + wText + MARGIN, 0, POPUPWIDTH, -1); m_choice->SetSize(0 + wText + MARGIN, 0, POPUPWIDTH, wxDefaultCoord);
} }
#endif #endif
} }
@@ -419,7 +419,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
else else
{ {
m_text = new wxComboBoxText(this); m_text = new wxComboBoxText(this);
if ( size.y == -1 ) { if ( size.y == wxDefaultCoord ) {
csize.y = m_text->GetSize().y ; csize.y = m_text->GetSize().y ;
} }
} }
@@ -846,4 +846,3 @@ wxInt32 wxComboBox::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
ProcessCommand(event); ProcessCommand(event);
return noErr ; return noErr ;
} }

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Stefan Csomor // Copyright: (c) Stefan Csomor
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -365,7 +365,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
PixMapHandle bmappixels ; PixMapHandle bmappixels ;
// Set foreground and background colours (for bitmaps depth = 1) // Set foreground and background colours (for bitmaps depth = 1)
if(bmp.GetDepth() == 1) if(bmp.GetDepth() == 1)
{ {
RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel()); RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()); RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
RGBForeColor(&fore); RGBForeColor(&fore);

View File

@@ -243,12 +243,12 @@ wxString wxDir::GetName() const
wxString name; wxString name;
if ( m_data ) if ( m_data )
{ {
name = M_DIR->GetName(); name = M_DIR->GetName();
if ( !name.empty() && (name.Last() == _T('/')) ) if ( !name.empty() && (name.Last() == _T('/')) )
{ {
// chop off the last (back)slash // chop off the last (back)slash
name.Truncate(name.length() - 1); name.Truncate(name.length() - 1);
} }
} }
return name; return name;

View File

@@ -717,8 +717,8 @@ GSocketError GSocket::SetNonOriented()
GSocketError GSocket::Connect(GSocketStream stream) GSocketError GSocket::Connect(GSocketStream stream)
{ {
InetAddress addr ; InetAddress addr ;
TEndpointInfo info; TEndpointInfo info;
OSStatus err = kOTNoError; OSStatus err = kOTNoError;
TCall peer ; TCall peer ;
assert(this); assert(this);
@@ -746,21 +746,21 @@ GSocketError GSocket::Connect(GSocketStream stream)
/* Create the socket */ /* Create the socket */
#if TARGET_CARBON #if TARGET_CARBON
m_endpoint = m_endpoint =
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ; OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
#else #else
m_endpoint = m_endpoint =
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ; OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
#endif #endif
if ( m_endpoint == kOTInvalidEndpointRef || err != kOTNoError ) if ( m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
{ {
m_endpoint = kOTInvalidEndpointRef ; m_endpoint = kOTInvalidEndpointRef ;
m_error = GSOCK_IOERR; m_error = GSOCK_IOERR;
return GSOCK_IOERR; return GSOCK_IOERR;
} }
err = OTBind( m_endpoint , nil , nil ) ; err = OTBind( m_endpoint , nil , nil ) ;
if ( err != kOTNoError ) if ( err != kOTNoError )
{ {
return GSOCK_IOERR; return GSOCK_IOERR;
} }
SetDefaultEndpointModes( m_endpoint , this ) ; SetDefaultEndpointModes( m_endpoint , this ) ;
// TODO // TODO
@@ -786,7 +786,7 @@ GSocketError GSocket::Connect(GSocketStream stream)
{ {
if (Output_Timeout() == GSOCK_TIMEDOUT) if (Output_Timeout() == GSOCK_TIMEDOUT)
{ {
OTSndOrderlyDisconnect( m_endpoint ) ; OTSndOrderlyDisconnect( m_endpoint ) ;
m_endpoint = kOTInvalidEndpointRef ; m_endpoint = kOTInvalidEndpointRef ;
/* m_error is set in _GSocket_Output_Timeout */ /* m_error is set in _GSocket_Output_Timeout */
return GSOCK_TIMEDOUT; return GSOCK_TIMEDOUT;
@@ -926,21 +926,21 @@ GSocketEventFlags GSocket::Select(GSocketEventFlags flags)
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_INPUT_FLAG ) ) if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_INPUT_FLAG ) )
{ {
size_t sz = 0 ; size_t sz = 0 ;
OTCountDataBytes( m_endpoint , &sz ) ; OTCountDataBytes( m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 ) if ( state == T_INCON || sz > 0 )
{ {
m_detected |= GSOCK_INPUT_FLAG ; m_detected |= GSOCK_INPUT_FLAG ;
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]); (m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
} }
} }
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_OUTPUT_FLAG ) ) if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_OUTPUT_FLAG ) )
{ {
if ( state == T_DATAXFER || state == T_INREL ) if ( state == T_DATAXFER || state == T_INREL )
{ {
m_detected |=GSOCK_OUTPUT_FLAG ; m_detected |=GSOCK_OUTPUT_FLAG ;
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]); (m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
} }
} }
*/ */
return ( flags & m_detected ) ; return ( flags & m_detected ) ;
@@ -1060,31 +1060,31 @@ void GSocket::UnsetCallback(GSocketEventFlags flags)
int GSocket::Recv_Stream(char *buffer, int size) int GSocket::Recv_Stream(char *buffer, int size)
{ {
OTFlags flags ; OTFlags flags ;
OTResult res ; OTResult res ;
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
OTCountDataBytes( m_endpoint , &sz ) ; OTCountDataBytes( m_endpoint , &sz ) ;
if ( size > (int)sz ) if ( size > (int)sz )
size = sz ; size = sz ;
res = OTRcv( m_endpoint , buffer , size , &flags ) ; res = OTRcv( m_endpoint , buffer , size , &flags ) ;
if ( res < 0 ) if ( res < 0 )
{ {
return -1 ; return -1 ;
} }
// we simulate another read event if there are still bytes // we simulate another read event if there are still bytes
if ( m_takesEvents ) if ( m_takesEvents )
{ {
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
OTCountDataBytes( m_endpoint , &sz ) ; OTCountDataBytes( m_endpoint , &sz ) ;
if ( sz > 0 ) if ( sz > 0 )
{ {
m_detected |= GSOCK_INPUT_FLAG ; m_detected |= GSOCK_INPUT_FLAG ;
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]); (m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
} }
} }
return res ; return res ;
} }
int GSocket::Recv_Dgram(char *buffer, int size) int GSocket::Recv_Dgram(char *buffer, int size)
@@ -1127,11 +1127,11 @@ int GSocket::Recv_Dgram(char *buffer, int size)
int GSocket::Send_Stream(const char *buffer, int size) int GSocket::Send_Stream(const char *buffer, int size)
{ {
OTFlags flags = 0 ; OTFlags flags = 0 ;
OTResult res ; OTResult res ;
res = OTSnd( m_endpoint , (void*) buffer , size , flags ) ; res = OTSnd( m_endpoint , (void*) buffer , size , flags ) ;
return res ; return res ;
} }
int GSocket::Send_Dgram(const char *buffer, int size) int GSocket::Send_Dgram(const char *buffer, int size)
@@ -1272,7 +1272,7 @@ GSocketError _GAddress_translate_from(GAddress *address,
GSocketError _GAddress_translate_to(GAddress *address, GSocketError _GAddress_translate_to(GAddress *address,
InetAddress *addr) InetAddress *addr)
{ {
if ( !GSocket_Verify_Inited() ) if ( !GSocket_Verify_Inited() )
return GSOCK_IOERR ; return GSOCK_IOERR ;
memset(addr, 0 , sizeof(struct InetAddress)); memset(addr, 0 , sizeof(struct InetAddress));
OTInitInetAddress( addr , address->m_port , address->m_host ) ; OTInitInetAddress( addr , address->m_port , address->m_host ) ;
@@ -1307,7 +1307,7 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname)
ret = OTInetStringToAddress( gInetSvcRef , (char*) hostname , &hinfo ) ; ret = OTInetStringToAddress( gInetSvcRef , (char*) hostname , &hinfo ) ;
if ( ret != kOTNoError ) if ( ret != kOTNoError )
{ {
address->m_host = INADDR_NONE ; address->m_host = INADDR_NONE ;
address->m_error = GSOCK_NOHOST; address->m_error = GSOCK_NOHOST;
return GSOCK_NOHOST; return GSOCK_NOHOST;
} }
@@ -1334,15 +1334,15 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
struct service_entry struct service_entry
{ {
const char * name ; const char * name ;
unsigned short port ; unsigned short port ;
const char * protocol ; const char * protocol ;
} ; } ;
typedef struct service_entry service_entry ; typedef struct service_entry service_entry ;
service_entry gServices[] = service_entry gServices[] =
{ {
{ "http" , 80 , "tcp" } { "http" , 80 , "tcp" }
} ; } ;
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
@@ -1360,14 +1360,14 @@ GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
} }
for ( i = 0 ; i < sizeof( gServices) / sizeof( service_entry ) ; ++i ) for ( i = 0 ; i < sizeof( gServices) / sizeof( service_entry ) ; ++i )
{ {
if ( strcmp( port , gServices[i].name ) == 0 ) if ( strcmp( port , gServices[i].name ) == 0 )
{ {
if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) ) if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) )
{ {
address->m_port = gServices[i].port ; address->m_port = gServices[i].port ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
} }
} }
if (isdigit(port[0])) if (isdigit(port[0]))
@@ -1392,7 +1392,7 @@ GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port)
GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf) GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf)
{ {
InetDomainName name ; InetDomainName name ;
if ( !GSocket_Verify_Inited() ) if ( !GSocket_Verify_Inited() )
return GSOCK_IOERR ; return GSOCK_IOERR ;
assert(address != NULL); assert(address != NULL);
@@ -1421,36 +1421,36 @@ unsigned short GAddress_INET_GetPort(GAddress *address)
void GSocket::Enable_Events() void GSocket::Enable_Events()
{ {
if ( m_takesEvents ) if ( m_takesEvents )
return ; return ;
{ {
OTResult state ; OTResult state ;
m_takesEvents = true ; m_takesEvents = true ;
state = OTGetEndpointState(m_endpoint); state = OTGetEndpointState(m_endpoint);
{ {
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
OTCountDataBytes( m_endpoint , &sz ) ; OTCountDataBytes( m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 ) if ( state == T_INCON || sz > 0 )
{ {
m_detected |= GSOCK_INPUT_FLAG ; m_detected |= GSOCK_INPUT_FLAG ;
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]); (m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
} }
} }
{ {
if ( state == T_DATAXFER || state == T_INREL ) if ( state == T_DATAXFER || state == T_INREL )
{ {
m_detected |=GSOCK_OUTPUT_FLAG ; m_detected |=GSOCK_OUTPUT_FLAG ;
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]); (m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
} }
} }
} }
} }
void GSocket::Disable_Events() void GSocket::Disable_Events()
{ {
m_takesEvents = false ; m_takesEvents = false ;
} }
/* _GSocket_Input_Timeout: /* _GSocket_Input_Timeout:
@@ -1469,17 +1469,17 @@ GSocketError GSocket::Input_Timeout()
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < m_timeout * 1000.0 ) while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < m_timeout * 1000.0 )
{ {
OTResult state ; OTResult state ;
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
state = OTGetEndpointState(m_endpoint); state = OTGetEndpointState(m_endpoint);
OTCountDataBytes( m_endpoint , &sz ) ; OTCountDataBytes( m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 ) if ( state == T_INCON || sz > 0 )
{ {
m_takesEvents = formerTakesEvents ; m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
Microseconds(&now); Microseconds(&now);
} }
m_takesEvents = formerTakesEvents ; m_takesEvents = formerTakesEvents ;
m_error = GSOCK_TIMEDOUT; m_error = GSOCK_TIMEDOUT;
@@ -1504,15 +1504,15 @@ GSocketError GSocket::Output_Timeout()
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < m_timeout * 1000.0 ) while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < m_timeout * 1000.0 )
{ {
OTResult state ; OTResult state ;
state = OTGetEndpointState(m_endpoint); state = OTGetEndpointState(m_endpoint);
if ( state == T_DATAXFER || state == T_INREL ) if ( state == T_DATAXFER || state == T_INREL )
{ {
m_takesEvents = formerTakesEvents ; m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
Microseconds(&now); Microseconds(&now);
} }
m_takesEvents = formerTakesEvents ; m_takesEvents = formerTakesEvents ;
m_error = GSOCK_TIMEDOUT; m_error = GSOCK_TIMEDOUT;
@@ -1569,39 +1569,39 @@ void _GSocket_Internal_Proc(unsigned long e , void* d )
*/ */
if ( /* (socket != NULL) && */ (socket->m_takesEvents)) if ( /* (socket != NULL) && */ (socket->m_takesEvents))
{ {
switch (ev) switch (ev)
{ {
case T_LISTEN : case T_LISTEN :
event = GSOCK_CONNECTION ; event = GSOCK_CONNECTION ;
break ; break ;
case T_CONNECT : case T_CONNECT :
event = GSOCK_CONNECTION ; event = GSOCK_CONNECTION ;
event2 = GSOCK_OUTPUT ; event2 = GSOCK_OUTPUT ;
{ {
TCall retCall; TCall retCall;
retCall.addr.buf = NULL; retCall.addr.buf = NULL;
retCall.addr.maxlen = 0; retCall.addr.maxlen = 0;
retCall.opt.buf = NULL; retCall.opt.buf = NULL;
retCall.opt.maxlen = 0; retCall.opt.maxlen = 0;
retCall.udata.buf = NULL; retCall.udata.buf = NULL;
retCall.udata.maxlen= 0; retCall.udata.maxlen = 0;
OTRcvConnect( socket->m_endpoint , &retCall ) ; OTRcvConnect( socket->m_endpoint , &retCall ) ;
} }
break ; break ;
case T_DISCONNECT : case T_DISCONNECT :
event = GSOCK_LOST ; event = GSOCK_LOST ;
break ; break ;
case T_GODATA : case T_GODATA :
case T_GOEXDATA : case T_GOEXDATA :
event = GSOCK_OUTPUT ; event = GSOCK_OUTPUT ;
break ; break ;
case T_DATA : case T_DATA :
event = GSOCK_INPUT ; event = GSOCK_INPUT ;
break ; break ;
case T_EXDATA : case T_EXDATA :
event = GSOCK_INPUT ; event = GSOCK_INPUT ;
break ; break ;
} }
if (event != GSOCK_MAX_EVENT) if (event != GSOCK_MAX_EVENT)
{ {

View File

@@ -261,19 +261,19 @@ bool wxQTMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
if ( ! if ( !
#if wxUSE_CREATEMOVIECONTROL #if wxUSE_CREATEMOVIECONTROL
ctrl->wxWindow::Create(parent, id, pos, size, ctrl->wxWindow::Create(parent, id, pos, size,
wxWindow::MacRemoveBordersFromStyle(style), wxWindow::MacRemoveBordersFromStyle(style),
name) name)
#else #else
ctrl->wxControl::Create(parent, id, pos, size, ctrl->wxControl::Create(parent, id, pos, size,
wxWindow::MacRemoveBordersFromStyle(style), wxWindow::MacRemoveBordersFromStyle(style),
validator, name) validator, name)
#endif #endif
) )
return false; return false;
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
ctrl->SetValidator(validator); ctrl->SetValidator(validator);
#endif #endif
m_ctrl = ctrl; m_ctrl = ctrl;
@@ -411,28 +411,28 @@ void wxQTMediaBackend::FinishLoad()
movieTrackEnabledOnly) != NULL) movieTrackEnabledOnly) != NULL)
{ {
#if wxUSE_CREATEMOVIECONTROL #if wxUSE_CREATEMOVIECONTROL
// //
//Native CreateMovieControl QT control (Thanks to Kevin Olliver's //Native CreateMovieControl QT control (Thanks to Kevin Olliver's
//wxQTMovie for some of this). //wxQTMovie for some of this).
// //
#define GetControlPeer(whatever) ctrl->m_peer #define GetControlPeer(whatever) ctrl->m_peer
wxMediaCtrl* ctrl = (wxMediaCtrl*) m_ctrl; wxMediaCtrl* ctrl = (wxMediaCtrl*) m_ctrl;
Rect bounds = wxMacGetBoundsForControl(m_ctrl, Rect bounds = wxMacGetBoundsForControl(m_ctrl,
m_ctrl->GetPosition(), m_ctrl->GetPosition(),
m_ctrl->GetSize()); m_ctrl->GetSize());
//Dispose of old control for new one //Dispose of old control for new one
if (GetControlPeer(m_ctrl) && GetControlPeer(m_ctrl)->Ok() ) if (GetControlPeer(m_ctrl) && GetControlPeer(m_ctrl)->Ok() )
GetControlPeer(m_ctrl)->Dispose(); GetControlPeer(m_ctrl)->Dispose();
//Options- //Options-
//kMovieControlOptionXXX //kMovieControlOptionXXX
//HideController - hide the movie controller //HideController - hide the movie controller
//LocateTopLeft - movie is pinned to top left rather than centered in the control //LocateTopLeft - movie is pinned to top left rather than centered in the control
//EnableEditing - Allows programmatic editing and dragn'drop //EnableEditing - Allows programmatic editing and dragn'drop
//HandleEditingHI- Installs event stuff for edit menu - forces EnableEditing also //HandleEditingHI- Installs event stuff for edit menu - forces EnableEditing also
//SetKeysEnabled - Allows keyboard input //SetKeysEnabled - Allows keyboard input
//ManuallyIdled - app handles movie idling rather than internal timer event loop //ManuallyIdled - app handles movie idling rather than internal timer event loop
::CreateMovieControl( ::CreateMovieControl(
(WindowRef) (WindowRef)
ctrl->MacGetTopLevelWindowRef(), //parent ctrl->MacGetTopLevelWindowRef(), //parent
@@ -447,9 +447,9 @@ void wxQTMediaBackend::FinishLoad()
::EmbedControl(ctrl->m_peer->GetControlRef(), (ControlRef)ctrl->GetParent()->GetHandle()); ::EmbedControl(ctrl->m_peer->GetControlRef(), (ControlRef)ctrl->GetParent()->GetHandle());
#else #else
// //
//"Emulation" //"Emulation"
// //
SetMovieGWorld(m_movie, SetMovieGWorld(m_movie,
(CGrafPtr) (CGrafPtr)
GetWindowPort( GetWindowPort(
@@ -671,8 +671,3 @@ void wxQTMediaBackend::Move(int x, int y, int w, int h)
FORCE_LINK_ME(basewxmediabackends); FORCE_LINK_ME(basewxmediabackends);
#endif //wxUSE_MEDIACTRL #endif //wxUSE_MEDIACTRL

View File

@@ -44,7 +44,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
const wxString& strHelp, const wxString& strHelp,
wxItemKind kind, wxItemKind kind,
wxMenu *pSubMenu) wxMenu *pSubMenu)
: wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) :wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu)
{ {
wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ; wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ;
@@ -56,7 +56,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
} }
m_radioGroup.start = -1; m_radioGroup.start = -1;
m_isRadioGroupStart = FALSE; m_isRadioGroupStart = false;
} }
wxMenuItem::~wxMenuItem() wxMenuItem::~wxMenuItem()
@@ -69,7 +69,7 @@ wxMenuItem::~wxMenuItem()
void wxMenuItem::SetBitmap(const wxBitmap& bitmap) void wxMenuItem::SetBitmap(const wxBitmap& bitmap)
{ {
m_bitmap = bitmap; m_bitmap = bitmap;
UpdateItemBitmap() ; UpdateItemBitmap();
} }
void wxMenuItem::UpdateItemBitmap() void wxMenuItem::UpdateItemBitmap()
@@ -125,14 +125,14 @@ void wxMenuItem::UpdateItemStatus()
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
return ; return ;
UMAEnableMenuItem( mhandle , index , m_isEnabled ) ; UMAEnableMenuItem( mhandle , index , m_isEnabled ) ;
if ( IsCheckable() && IsChecked() ) if ( IsCheckable() && IsChecked() )
::SetItemMark( mhandle , index , 0x12 ) ; // checkmark ::SetItemMark( mhandle , index , 0x12 ) ; // checkmark
else else
::SetItemMark( mhandle , index , 0 ) ; // no mark ::SetItemMark( mhandle , index , 0 ) ; // no mark
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
} }
@@ -148,8 +148,8 @@ void wxMenuItem::UpdateItemText()
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
return ; return ;
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
} }
@@ -255,7 +255,7 @@ void wxMenuItem::SetText(const wxString& text)
void wxMenuItem::SetAsRadioGroupStart() void wxMenuItem::SetAsRadioGroupStart()
{ {
m_isRadioGroupStart = TRUE; m_isRadioGroupStart = true;
} }
void wxMenuItem::SetRadioGroupStart(int start) void wxMenuItem::SetRadioGroupStart(int start)

View File

@@ -6,7 +6,7 @@
// Created: ??/??/98 // Created: ??/??/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) AUTHOR // Copyright: (c) AUTHOR
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -30,7 +30,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
m_macIsUserPane = FALSE ; m_macIsUserPane = false ;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false; return false;
@@ -46,30 +46,30 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
MacPostControlCreate(pos,size) ; MacPostControlCreate(pos,size) ;
m_cycle = this ; m_cycle = this ;
if (HasFlag(wxRB_GROUP)) if (HasFlag(wxRB_GROUP))
{
AddInCycle( NULL ) ;
}
else
{
/* search backward for last group start */
wxRadioButton *chief = (wxRadioButton*) NULL;
wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
while (node)
{ {
wxWindow *child = node->GetData(); AddInCycle( NULL ) ;
if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
{
chief = (wxRadioButton*) child;
if (child->HasFlag(wxRB_GROUP)) break;
}
node = node->GetPrevious();
} }
AddInCycle( chief ) ; else
} {
return TRUE; /* search backward for last group start */
wxRadioButton *chief = (wxRadioButton*) NULL;
wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
while (node)
{
wxWindow *child = node->GetData();
if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
{
chief = (wxRadioButton*) child;
if (child->HasFlag(wxRB_GROUP)) break;
}
node = node->GetPrevious();
}
AddInCycle( chief ) ;
}
return true;
} }
void wxRadioButton::SetValue(bool val) void wxRadioButton::SetValue(bool val)
@@ -84,12 +84,12 @@ void wxRadioButton::SetValue(bool val)
cycle=this->NextInCycle(); cycle=this->NextInCycle();
if (cycle!=NULL) if (cycle!=NULL)
{ {
while (cycle!=this) while (cycle!=this)
{ {
cycle->SetValue(false); cycle->SetValue(false);
cycle=cycle->NextInCycle(); cycle=cycle->NextInCycle();
} }
} }
} }
} }
@@ -134,18 +134,20 @@ wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
{ {
wxRadioButton *next,*current; wxRadioButton *next,*current;
if (cycle==NULL) { if (cycle==NULL)
{
m_cycle=this; m_cycle=this;
return(this); return(this);
} }
else { else
{
current=cycle; current=cycle;
while ((next=current->m_cycle)!=cycle) while ((next=current->m_cycle)!=cycle)
current=current->m_cycle; current=current->m_cycle;
m_cycle=cycle; m_cycle=cycle;
current->m_cycle=this; current->m_cycle=this;
return(cycle); return(cycle);
} }
} }
#endif #endif

View File

@@ -907,7 +907,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
event.SetEventObject(def); event.SetEventObject(def);
def->Command(event); def->Command(event);
return ; return ;
} }
} }
// this will make wxWidgets eat the ENTER key so that // this will make wxWidgets eat the ENTER key so that

View File

@@ -1831,15 +1831,15 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags)
return; return;
} }
if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
x = currentX; x = currentX;
if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
y = currentY; y = currentY;
AdjustForParentClientOrigin(x, y, sizeFlags); AdjustForParentClientOrigin(x, y, sizeFlags);
wxSize size(-1, -1); wxSize size = wxDefaultSize;
if ( width == -1 ) if ( width == wxDefaultCoord )
{ {
if ( sizeFlags & wxSIZE_AUTO_WIDTH ) if ( sizeFlags & wxSIZE_AUTO_WIDTH )
{ {
@@ -1853,11 +1853,11 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags)
} }
} }
if ( height == -1 ) if ( height == wxDefaultCoord )
{ {
if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
{ {
if ( size.x == -1 ) if ( size.x == wxDefaultCoord )
{ {
size = DoGetBestSize(); size = DoGetBestSize();
} }
@@ -1894,7 +1894,7 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight) void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
{ {
if ( clientheight != -1 || clientheight != -1 ) if ( clientheight != wxDefaultCoord || clientheight != wxDefaultCoord )
{ {
int currentclientwidth , currentclientheight ; int currentclientwidth , currentclientheight ;
int currentwidth , currentheight ; int currentwidth , currentheight ;
@@ -1902,7 +1902,7 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
GetClientSize( &currentclientwidth , &currentclientheight ) ; GetClientSize( &currentclientwidth , &currentclientheight ) ;
GetSize( &currentwidth , &currentheight ) ; GetSize( &currentwidth , &currentheight ) ;
DoSetSize( -1 , -1 , currentwidth + clientwidth - currentclientwidth , DoSetSize( wxDefaultCoord , wxDefaultCoord , currentwidth + clientwidth - currentclientwidth ,
currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ; currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ;
} }
} }
@@ -2169,8 +2169,8 @@ void wxWindowMac::WarpPointer (int x_pos, int y_pos)
void wxWindowMac::OnEraseBackground(wxEraseEvent& event) void wxWindowMac::OnEraseBackground(wxEraseEvent& event)
{ {
if ( MacGetTopLevelWindow() == NULL ) if ( MacGetTopLevelWindow() == NULL )
return ; return ;
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
if ( MacGetTopLevelWindow()->MacUsesCompositing() && (m_macBackgroundBrush.Ok() == false || m_macBackgroundBrush.GetStyle() == wxTRANSPARENT ) ) if ( MacGetTopLevelWindow()->MacUsesCompositing() && (m_macBackgroundBrush.Ok() == false || m_macBackgroundBrush.GetStyle() == wxTRANSPARENT ) )
{ {
@@ -2405,8 +2405,8 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
if( dx == 0 && dy ==0 ) if( dx == 0 && dy ==0 )
return ; return ;
int width , height ; int width , height ;
GetClientSize( &width , &height ) ; GetClientSize( &width , &height ) ;
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
if ( 1 /* m_peer->IsCompositing() */ ) if ( 1 /* m_peer->IsCompositing() */ )
{ {
@@ -2467,7 +2467,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
Rect scrollrect; Rect scrollrect;
RgnHandle updateRgn = NewRgn() ; RgnHandle updateRgn = NewRgn() ;
{ {
wxClientDC dc(this) ; wxClientDC dc(this) ;
wxMacPortSetter helper(&dc) ; wxMacPortSetter helper(&dc) ;
@@ -3246,13 +3246,12 @@ bool wxWindowMac::Reparent(wxWindowBase *newParentBase)
wxWindowMac *newParent = (wxWindowMac *)newParentBase; wxWindowMac *newParent = (wxWindowMac *)newParentBase;
if ( !wxWindowBase::Reparent(newParent) ) if ( !wxWindowBase::Reparent(newParent) )
return FALSE; return false;
//copied from MacPostControlCreate //copied from MacPostControlCreate
ControlRef container = (ControlRef) GetParent()->GetHandle() ; ControlRef container = (ControlRef) GetParent()->GetHandle() ;
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
::EmbedControl( m_peer->GetControlRef() , container ) ; ::EmbedControl( m_peer->GetControlRef() , container ) ;
return TRUE; return true;
} }