[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:
@@ -1443,7 +1443,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
|
||||
event.SetEventObject(def);
|
||||
def->Command(event);
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
|
||||
else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) )
|
||||
|
@@ -119,89 +119,89 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
|
||||
DataBrowserItemID itemID, DataBrowserPropertyID property,
|
||||
DataBrowserItemDataRef itemData, Boolean changeValue)
|
||||
{
|
||||
OSStatus err = errDataBrowserPropertyNotSupported;
|
||||
OSStatus err = errDataBrowserPropertyNotSupported;
|
||||
|
||||
if ( ! changeValue )
|
||||
{
|
||||
switch (property)
|
||||
{
|
||||
if ( ! changeValue )
|
||||
{
|
||||
switch (property)
|
||||
{
|
||||
|
||||
case kTextColumnId:
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
case kTextColumnId:
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
int i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ;
|
||||
verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ;
|
||||
err = noErr ;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case kCheckboxColumnId :
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
{
|
||||
wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ;
|
||||
verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ;
|
||||
err = noErr ;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case kCheckboxColumnId :
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
int i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ;
|
||||
err = noErr ;
|
||||
}
|
||||
}
|
||||
}
|
||||
break ;
|
||||
case kDataBrowserItemIsEditableProperty:
|
||||
{
|
||||
err = ::SetDataBrowserItemDataBooleanValue(itemData, true);
|
||||
}
|
||||
break;
|
||||
{
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ;
|
||||
err = noErr ;
|
||||
}
|
||||
}
|
||||
}
|
||||
break ;
|
||||
case kDataBrowserItemIsEditableProperty:
|
||||
{
|
||||
err = ::SetDataBrowserItemDataBooleanValue(itemData, true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( property )
|
||||
{
|
||||
case kCheckboxColumnId :
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( property )
|
||||
{
|
||||
case kCheckboxColumnId :
|
||||
{
|
||||
long ref = GetControlReference( browser ) ;
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
int i = itemID - 1 ;
|
||||
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 ) ;
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , newVal ? kThemeButtonOn : kThemeButtonOff ) ) ;
|
||||
err = noErr ;
|
||||
list->m_checks[ i ] = newVal ;
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , newVal ? kThemeButtonOn : kThemeButtonOff ) ) ;
|
||||
err = noErr ;
|
||||
list->m_checks[ i ] = newVal ;
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, list->GetId());
|
||||
event.SetInt(i);
|
||||
event.SetEventObject(list);
|
||||
list->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break ;
|
||||
}
|
||||
break ;
|
||||
|
||||
default :
|
||||
break ;
|
||||
}
|
||||
}
|
||||
default :
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
return err;
|
||||
}
|
||||
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
@@ -211,7 +211,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_macIsUserPane = FALSE ;
|
||||
m_macIsUserPane = false ;
|
||||
|
||||
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
|
||||
_T("only one of listbox selection modes can be specified") );
|
||||
@@ -245,43 +245,43 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
DataBrowserListViewColumnDesc columnDesc ;
|
||||
columnDesc.headerBtnDesc.titleOffset = 0;
|
||||
columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;
|
||||
columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;
|
||||
|
||||
columnDesc.headerBtnDesc.btnFontStyle.flags =
|
||||
kControlUseFontMask | kControlUseJustMask;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.flags =
|
||||
kControlUseFontMask | kControlUseJustMask;
|
||||
|
||||
columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.style = normal;
|
||||
columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" );
|
||||
columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont;
|
||||
columnDesc.headerBtnDesc.btnFontStyle.style = normal;
|
||||
columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" );
|
||||
|
||||
// check column
|
||||
|
||||
columnDesc.headerBtnDesc.minimumWidth = 30 ;
|
||||
columnDesc.headerBtnDesc.maximumWidth = 30;
|
||||
columnDesc.headerBtnDesc.minimumWidth = 30 ;
|
||||
columnDesc.headerBtnDesc.maximumWidth = 30;
|
||||
|
||||
columnDesc.propertyDesc.propertyID = kCheckboxColumnId;
|
||||
columnDesc.propertyDesc.propertyType = kDataBrowserCheckboxType;
|
||||
columnDesc.propertyDesc.propertyFlags = kDataBrowserPropertyIsMutable | kDataBrowserTableViewSelectionColumn |
|
||||
columnDesc.propertyDesc.propertyID = kCheckboxColumnId;
|
||||
columnDesc.propertyDesc.propertyType = kDataBrowserCheckboxType;
|
||||
columnDesc.propertyDesc.propertyFlags = kDataBrowserPropertyIsMutable | kDataBrowserTableViewSelectionColumn |
|
||||
kDataBrowserDefaultPropertyFlags;
|
||||
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
|
||||
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
|
||||
|
||||
// text column
|
||||
|
||||
columnDesc.headerBtnDesc.minimumWidth = 0;
|
||||
columnDesc.headerBtnDesc.maximumWidth = 10000;
|
||||
columnDesc.headerBtnDesc.minimumWidth = 0;
|
||||
columnDesc.headerBtnDesc.maximumWidth = 10000;
|
||||
|
||||
columnDesc.propertyDesc.propertyID = kTextColumnId;
|
||||
columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
|
||||
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn
|
||||
columnDesc.propertyDesc.propertyID = kTextColumnId;
|
||||
columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
|
||||
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||
| kDataBrowserListViewTypeSelectColumn
|
||||
| kDataBrowserListViewTypeSelectColumn
|
||||
#endif
|
||||
;
|
||||
;
|
||||
|
||||
|
||||
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
|
||||
verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ;
|
||||
|
||||
verify_noerr( m_peer->AutoSizeListViewColumns() ) ;
|
||||
verify_noerr( m_peer->SetHasScrollBars( false , true ) ) ;
|
||||
@@ -292,11 +292,11 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
callbacks.version = kDataBrowserLatestCallbacks;
|
||||
InitDataBrowserCallbacks(&callbacks);
|
||||
callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(ListBoxGetSetItemData);
|
||||
callbacks.u.v1.itemNotificationCallback =
|
||||
callbacks.u.v1.itemNotificationCallback =
|
||||
#if TARGET_API_MAC_OSX
|
||||
(DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc) ;
|
||||
(DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc) ;
|
||||
#else
|
||||
NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProc) ;
|
||||
NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProc) ;
|
||||
#endif
|
||||
m_peer->SetCallbacks( &callbacks);
|
||||
|
||||
@@ -315,7 +315,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
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
|
||||
{
|
||||
wxCHECK_MSG( item < m_checks.GetCount(), FALSE,
|
||||
wxCHECK_MSG( item < m_checks.GetCount(), false,
|
||||
_T("invalid index in wxCheckListBox::IsChecked") );
|
||||
|
||||
return m_checks[item] != 0;
|
||||
@@ -362,7 +362,7 @@ int wxCheckListBox::DoAppend(const wxString& item)
|
||||
int pos = wxListBox::DoAppend(item);
|
||||
|
||||
// the item is initially unchecked
|
||||
m_checks.Insert(FALSE, pos);
|
||||
m_checks.Insert(false, pos);
|
||||
|
||||
return pos;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
size_t count = items.GetCount();
|
||||
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();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
{
|
||||
m_checks.Add(FALSE);
|
||||
m_checks.Add(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -197,12 +197,12 @@ void wxClipboard::Clear()
|
||||
|
||||
bool wxClipboard::Flush()
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxClipboard::Open()
|
||||
{
|
||||
wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") );
|
||||
wxCHECK_MSG( !m_open, false, wxT("clipboard already open") );
|
||||
m_open = true ;
|
||||
return true ;
|
||||
}
|
||||
@@ -214,9 +214,9 @@ bool wxClipboard::IsOpened() const
|
||||
|
||||
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();
|
||||
// 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 )
|
||||
{
|
||||
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 */
|
||||
Clear();
|
||||
@@ -294,8 +294,8 @@ void wxClipboard::Close()
|
||||
|
||||
m_open = false ;
|
||||
|
||||
// Get rid of cached object. If this is not done copying from another application will
|
||||
// only work once
|
||||
// Get rid of cached object. If this is not done copying from another application will
|
||||
// only work once
|
||||
if (m_data)
|
||||
{
|
||||
delete m_data;
|
||||
@@ -306,10 +306,10 @@ void wxClipboard::Close()
|
||||
|
||||
bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
|
||||
{
|
||||
if ( m_data )
|
||||
{
|
||||
return m_data->IsSupported( dataFormat ) ;
|
||||
}
|
||||
if ( m_data )
|
||||
{
|
||||
return m_data->IsSupported( dataFormat ) ;
|
||||
}
|
||||
#if TARGET_CARBON
|
||||
OSStatus err = noErr;
|
||||
ScrapRef scrapRef;
|
||||
@@ -324,11 +324,11 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
|
||||
{
|
||||
if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr)
|
||||
{
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#else
|
||||
long offset ;
|
||||
@@ -344,7 +344,7 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
|
||||
|
||||
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 ;
|
||||
wxDataFormat *array = new wxDataFormat[ formatcount ];
|
||||
|
@@ -165,7 +165,7 @@ protected:
|
||||
event.SetEventObject(def);
|
||||
def->Command(event);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -219,7 +219,7 @@ private:
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice)
|
||||
EVT_CHOICE(-1, wxComboBoxChoice::OnChoice)
|
||||
EVT_CHOICE(wxID_ANY, wxComboBoxChoice::OnChoice)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
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...
|
||||
if ( m_choice )
|
||||
m_choice->SetSize(0, 0 , width, -1);
|
||||
m_choice->SetSize(0, 0 , width, wxDefaultCoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCoord wText = width - POPUPWIDTH - MARGIN;
|
||||
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
|
||||
}
|
||||
@@ -419,7 +419,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
else
|
||||
{
|
||||
m_text = new wxComboBoxText(this);
|
||||
if ( size.y == -1 ) {
|
||||
if ( size.y == wxDefaultCoord ) {
|
||||
csize.y = m_text->GetSize().y ;
|
||||
}
|
||||
}
|
||||
@@ -846,4 +846,3 @@ wxInt32 wxComboBox::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
|
||||
ProcessCommand(event);
|
||||
return noErr ;
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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 ;
|
||||
// Set foreground and background colours (for bitmaps depth = 1)
|
||||
if(bmp.GetDepth() == 1)
|
||||
{
|
||||
{
|
||||
RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
|
||||
RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
|
||||
RGBForeColor(&fore);
|
||||
|
@@ -243,12 +243,12 @@ wxString wxDir::GetName() const
|
||||
wxString name;
|
||||
if ( m_data )
|
||||
{
|
||||
name = M_DIR->GetName();
|
||||
if ( !name.empty() && (name.Last() == _T('/')) )
|
||||
{
|
||||
// chop off the last (back)slash
|
||||
name.Truncate(name.length() - 1);
|
||||
}
|
||||
name = M_DIR->GetName();
|
||||
if ( !name.empty() && (name.Last() == _T('/')) )
|
||||
{
|
||||
// chop off the last (back)slash
|
||||
name.Truncate(name.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
|
@@ -717,8 +717,8 @@ GSocketError GSocket::SetNonOriented()
|
||||
GSocketError GSocket::Connect(GSocketStream stream)
|
||||
{
|
||||
InetAddress addr ;
|
||||
TEndpointInfo info;
|
||||
OSStatus err = kOTNoError;
|
||||
TEndpointInfo info;
|
||||
OSStatus err = kOTNoError;
|
||||
TCall peer ;
|
||||
|
||||
assert(this);
|
||||
@@ -746,21 +746,21 @@ GSocketError GSocket::Connect(GSocketStream stream)
|
||||
/* Create the socket */
|
||||
#if TARGET_CARBON
|
||||
m_endpoint =
|
||||
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
|
||||
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
|
||||
#else
|
||||
m_endpoint =
|
||||
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
|
||||
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
|
||||
#endif
|
||||
if ( m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
|
||||
{
|
||||
m_endpoint = kOTInvalidEndpointRef ;
|
||||
m_error = GSOCK_IOERR;
|
||||
return GSOCK_IOERR;
|
||||
m_endpoint = kOTInvalidEndpointRef ;
|
||||
m_error = GSOCK_IOERR;
|
||||
return GSOCK_IOERR;
|
||||
}
|
||||
err = OTBind( m_endpoint , nil , nil ) ;
|
||||
if ( err != kOTNoError )
|
||||
{
|
||||
return GSOCK_IOERR;
|
||||
return GSOCK_IOERR;
|
||||
}
|
||||
SetDefaultEndpointModes( m_endpoint , this ) ;
|
||||
// TODO
|
||||
@@ -786,7 +786,7 @@ GSocketError GSocket::Connect(GSocketStream stream)
|
||||
{
|
||||
if (Output_Timeout() == GSOCK_TIMEDOUT)
|
||||
{
|
||||
OTSndOrderlyDisconnect( m_endpoint ) ;
|
||||
OTSndOrderlyDisconnect( m_endpoint ) ;
|
||||
m_endpoint = kOTInvalidEndpointRef ;
|
||||
/* m_error is set in _GSocket_Output_Timeout */
|
||||
return GSOCK_TIMEDOUT;
|
||||
@@ -926,21 +926,21 @@ GSocketEventFlags GSocket::Select(GSocketEventFlags flags)
|
||||
|
||||
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_INPUT_FLAG ) )
|
||||
{
|
||||
size_t sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
size_t sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
}
|
||||
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( m_detected & GSOCK_OUTPUT_FLAG ) )
|
||||
{
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_detected |=GSOCK_OUTPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
|
||||
}
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_detected |=GSOCK_OUTPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
return ( flags & m_detected ) ;
|
||||
@@ -1060,31 +1060,31 @@ void GSocket::UnsetCallback(GSocketEventFlags flags)
|
||||
|
||||
int GSocket::Recv_Stream(char *buffer, int size)
|
||||
{
|
||||
OTFlags flags ;
|
||||
OTResult res ;
|
||||
OTByteCount sz = 0 ;
|
||||
OTFlags flags ;
|
||||
OTResult res ;
|
||||
OTByteCount sz = 0 ;
|
||||
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( size > (int)sz )
|
||||
size = sz ;
|
||||
res = OTRcv( m_endpoint , buffer , size , &flags ) ;
|
||||
if ( res < 0 )
|
||||
{
|
||||
return -1 ;
|
||||
}
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( size > (int)sz )
|
||||
size = sz ;
|
||||
res = OTRcv( m_endpoint , buffer , size , &flags ) ;
|
||||
if ( res < 0 )
|
||||
{
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
// we simulate another read event if there are still bytes
|
||||
if ( m_takesEvents )
|
||||
{
|
||||
OTByteCount sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
}
|
||||
return res ;
|
||||
// we simulate another read event if there are still bytes
|
||||
if ( m_takesEvents )
|
||||
{
|
||||
OTByteCount sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
}
|
||||
return res ;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
OTFlags flags = 0 ;
|
||||
OTResult res ;
|
||||
OTFlags flags = 0 ;
|
||||
OTResult res ;
|
||||
|
||||
res = OTSnd( m_endpoint , (void*) buffer , size , flags ) ;
|
||||
return res ;
|
||||
res = OTSnd( m_endpoint , (void*) buffer , size , flags ) ;
|
||||
return res ;
|
||||
}
|
||||
|
||||
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,
|
||||
InetAddress *addr)
|
||||
{
|
||||
if ( !GSocket_Verify_Inited() )
|
||||
if ( !GSocket_Verify_Inited() )
|
||||
return GSOCK_IOERR ;
|
||||
memset(addr, 0 , sizeof(struct InetAddress));
|
||||
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 ) ;
|
||||
if ( ret != kOTNoError )
|
||||
{
|
||||
address->m_host = INADDR_NONE ;
|
||||
address->m_host = INADDR_NONE ;
|
||||
address->m_error = GSOCK_NOHOST;
|
||||
return GSOCK_NOHOST;
|
||||
}
|
||||
@@ -1334,15 +1334,15 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
|
||||
|
||||
struct service_entry
|
||||
{
|
||||
const char * name ;
|
||||
unsigned short port ;
|
||||
const char * protocol ;
|
||||
const char * name ;
|
||||
unsigned short port ;
|
||||
const char * protocol ;
|
||||
} ;
|
||||
typedef struct service_entry service_entry ;
|
||||
|
||||
service_entry gServices[] =
|
||||
{
|
||||
{ "http" , 80 , "tcp" }
|
||||
{ "http" , 80 , "tcp" }
|
||||
} ;
|
||||
|
||||
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 )
|
||||
{
|
||||
if ( strcmp( port , gServices[i].name ) == 0 )
|
||||
{
|
||||
if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) )
|
||||
{
|
||||
address->m_port = gServices[i].port ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
}
|
||||
if ( strcmp( port , gServices[i].name ) == 0 )
|
||||
{
|
||||
if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) )
|
||||
{
|
||||
address->m_port = gServices[i].port ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
InetDomainName name ;
|
||||
if ( !GSocket_Verify_Inited() )
|
||||
if ( !GSocket_Verify_Inited() )
|
||||
return GSOCK_IOERR ;
|
||||
|
||||
assert(address != NULL);
|
||||
@@ -1421,36 +1421,36 @@ unsigned short GAddress_INET_GetPort(GAddress *address)
|
||||
|
||||
void GSocket::Enable_Events()
|
||||
{
|
||||
if ( m_takesEvents )
|
||||
return ;
|
||||
if ( m_takesEvents )
|
||||
return ;
|
||||
|
||||
{
|
||||
OTResult state ;
|
||||
m_takesEvents = true ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
{
|
||||
OTResult state ;
|
||||
m_takesEvents = true ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
|
||||
{
|
||||
OTByteCount sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
}
|
||||
{
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_detected |=GSOCK_OUTPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
OTByteCount sz = 0 ;
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_detected |= GSOCK_INPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_INPUT])(this, GSOCK_INPUT, m_data[GSOCK_INPUT]);
|
||||
}
|
||||
}
|
||||
{
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_detected |=GSOCK_OUTPUT_FLAG ;
|
||||
(m_cbacks[GSOCK_OUTPUT])(this, GSOCK_OUTPUT, m_data[GSOCK_OUTPUT]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GSocket::Disable_Events()
|
||||
{
|
||||
m_takesEvents = false ;
|
||||
m_takesEvents = false ;
|
||||
}
|
||||
|
||||
/* _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 )
|
||||
{
|
||||
OTResult state ;
|
||||
OTByteCount sz = 0 ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
OTResult state ;
|
||||
OTByteCount sz = 0 ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
Microseconds(&now);
|
||||
OTCountDataBytes( m_endpoint , &sz ) ;
|
||||
if ( state == T_INCON || sz > 0 )
|
||||
{
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
Microseconds(&now);
|
||||
}
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
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 )
|
||||
{
|
||||
OTResult state ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
OTResult state ;
|
||||
state = OTGetEndpointState(m_endpoint);
|
||||
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
Microseconds(&now);
|
||||
if ( state == T_DATAXFER || state == T_INREL )
|
||||
{
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
return GSOCK_NOERROR;
|
||||
}
|
||||
Microseconds(&now);
|
||||
}
|
||||
m_takesEvents = formerTakesEvents ;
|
||||
m_error = GSOCK_TIMEDOUT;
|
||||
@@ -1569,39 +1569,39 @@ void _GSocket_Internal_Proc(unsigned long e , void* d )
|
||||
*/
|
||||
if ( /* (socket != NULL) && */ (socket->m_takesEvents))
|
||||
{
|
||||
switch (ev)
|
||||
{
|
||||
case T_LISTEN :
|
||||
event = GSOCK_CONNECTION ;
|
||||
break ;
|
||||
case T_CONNECT :
|
||||
event = GSOCK_CONNECTION ;
|
||||
event2 = GSOCK_OUTPUT ;
|
||||
{
|
||||
TCall retCall;
|
||||
switch (ev)
|
||||
{
|
||||
case T_LISTEN :
|
||||
event = GSOCK_CONNECTION ;
|
||||
break ;
|
||||
case T_CONNECT :
|
||||
event = GSOCK_CONNECTION ;
|
||||
event2 = GSOCK_OUTPUT ;
|
||||
{
|
||||
TCall retCall;
|
||||
|
||||
retCall.addr.buf = NULL;
|
||||
retCall.addr.maxlen = 0;
|
||||
retCall.opt.buf = NULL;
|
||||
retCall.opt.maxlen = 0;
|
||||
retCall.udata.buf = NULL;
|
||||
retCall.udata.maxlen= 0;
|
||||
OTRcvConnect( socket->m_endpoint , &retCall ) ;
|
||||
}
|
||||
break ;
|
||||
case T_DISCONNECT :
|
||||
event = GSOCK_LOST ;
|
||||
break ;
|
||||
case T_GODATA :
|
||||
case T_GOEXDATA :
|
||||
event = GSOCK_OUTPUT ;
|
||||
break ;
|
||||
case T_DATA :
|
||||
event = GSOCK_INPUT ;
|
||||
break ;
|
||||
case T_EXDATA :
|
||||
event = GSOCK_INPUT ;
|
||||
break ;
|
||||
retCall.addr.buf = NULL;
|
||||
retCall.addr.maxlen = 0;
|
||||
retCall.opt.buf = NULL;
|
||||
retCall.opt.maxlen = 0;
|
||||
retCall.udata.buf = NULL;
|
||||
retCall.udata.maxlen = 0;
|
||||
OTRcvConnect( socket->m_endpoint , &retCall ) ;
|
||||
}
|
||||
break ;
|
||||
case T_DISCONNECT :
|
||||
event = GSOCK_LOST ;
|
||||
break ;
|
||||
case T_GODATA :
|
||||
case T_GOEXDATA :
|
||||
event = GSOCK_OUTPUT ;
|
||||
break ;
|
||||
case T_DATA :
|
||||
event = GSOCK_INPUT ;
|
||||
break ;
|
||||
case T_EXDATA :
|
||||
event = GSOCK_INPUT ;
|
||||
break ;
|
||||
}
|
||||
if (event != GSOCK_MAX_EVENT)
|
||||
{
|
||||
|
@@ -261,19 +261,19 @@ bool wxQTMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
|
||||
if ( !
|
||||
|
||||
#if wxUSE_CREATEMOVIECONTROL
|
||||
ctrl->wxWindow::Create(parent, id, pos, size,
|
||||
wxWindow::MacRemoveBordersFromStyle(style),
|
||||
name)
|
||||
ctrl->wxWindow::Create(parent, id, pos, size,
|
||||
wxWindow::MacRemoveBordersFromStyle(style),
|
||||
name)
|
||||
#else
|
||||
ctrl->wxControl::Create(parent, id, pos, size,
|
||||
wxWindow::MacRemoveBordersFromStyle(style),
|
||||
validator, name)
|
||||
ctrl->wxControl::Create(parent, id, pos, size,
|
||||
wxWindow::MacRemoveBordersFromStyle(style),
|
||||
validator, name)
|
||||
#endif
|
||||
)
|
||||
return false;
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
ctrl->SetValidator(validator);
|
||||
ctrl->SetValidator(validator);
|
||||
#endif
|
||||
|
||||
m_ctrl = ctrl;
|
||||
@@ -411,28 +411,28 @@ void wxQTMediaBackend::FinishLoad()
|
||||
movieTrackEnabledOnly) != NULL)
|
||||
{
|
||||
#if wxUSE_CREATEMOVIECONTROL
|
||||
//
|
||||
//Native CreateMovieControl QT control (Thanks to Kevin Olliver's
|
||||
//wxQTMovie for some of this).
|
||||
//
|
||||
#define GetControlPeer(whatever) ctrl->m_peer
|
||||
wxMediaCtrl* ctrl = (wxMediaCtrl*) m_ctrl;
|
||||
Rect bounds = wxMacGetBoundsForControl(m_ctrl,
|
||||
m_ctrl->GetPosition(),
|
||||
m_ctrl->GetSize());
|
||||
//
|
||||
//Native CreateMovieControl QT control (Thanks to Kevin Olliver's
|
||||
//wxQTMovie for some of this).
|
||||
//
|
||||
#define GetControlPeer(whatever) ctrl->m_peer
|
||||
wxMediaCtrl* ctrl = (wxMediaCtrl*) m_ctrl;
|
||||
Rect bounds = wxMacGetBoundsForControl(m_ctrl,
|
||||
m_ctrl->GetPosition(),
|
||||
m_ctrl->GetSize());
|
||||
|
||||
//Dispose of old control for new one
|
||||
if (GetControlPeer(m_ctrl) && GetControlPeer(m_ctrl)->Ok() )
|
||||
GetControlPeer(m_ctrl)->Dispose();
|
||||
//Dispose of old control for new one
|
||||
if (GetControlPeer(m_ctrl) && GetControlPeer(m_ctrl)->Ok() )
|
||||
GetControlPeer(m_ctrl)->Dispose();
|
||||
|
||||
//Options-
|
||||
//kMovieControlOptionXXX
|
||||
//HideController - hide the movie controller
|
||||
//LocateTopLeft - movie is pinned to top left rather than centered in the control
|
||||
//EnableEditing - Allows programmatic editing and dragn'drop
|
||||
//HandleEditingHI- Installs event stuff for edit menu - forces EnableEditing also
|
||||
//SetKeysEnabled - Allows keyboard input
|
||||
//ManuallyIdled - app handles movie idling rather than internal timer event loop
|
||||
//Options-
|
||||
//kMovieControlOptionXXX
|
||||
//HideController - hide the movie controller
|
||||
//LocateTopLeft - movie is pinned to top left rather than centered in the control
|
||||
//EnableEditing - Allows programmatic editing and dragn'drop
|
||||
//HandleEditingHI- Installs event stuff for edit menu - forces EnableEditing also
|
||||
//SetKeysEnabled - Allows keyboard input
|
||||
//ManuallyIdled - app handles movie idling rather than internal timer event loop
|
||||
::CreateMovieControl(
|
||||
(WindowRef)
|
||||
ctrl->MacGetTopLevelWindowRef(), //parent
|
||||
@@ -447,9 +447,9 @@ void wxQTMediaBackend::FinishLoad()
|
||||
|
||||
::EmbedControl(ctrl->m_peer->GetControlRef(), (ControlRef)ctrl->GetParent()->GetHandle());
|
||||
#else
|
||||
//
|
||||
//"Emulation"
|
||||
//
|
||||
//
|
||||
//"Emulation"
|
||||
//
|
||||
SetMovieGWorld(m_movie,
|
||||
(CGrafPtr)
|
||||
GetWindowPort(
|
||||
@@ -671,8 +671,3 @@ void wxQTMediaBackend::Move(int x, int y, int w, int h)
|
||||
FORCE_LINK_ME(basewxmediabackends);
|
||||
|
||||
#endif //wxUSE_MEDIACTRL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -44,7 +44,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
||||
const wxString& strHelp,
|
||||
wxItemKind kind,
|
||||
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") ) ;
|
||||
|
||||
@@ -56,7 +56,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
||||
}
|
||||
|
||||
m_radioGroup.start = -1;
|
||||
m_isRadioGroupStart = FALSE;
|
||||
m_isRadioGroupStart = false;
|
||||
}
|
||||
|
||||
wxMenuItem::~wxMenuItem()
|
||||
@@ -69,7 +69,7 @@ wxMenuItem::~wxMenuItem()
|
||||
void wxMenuItem::SetBitmap(const wxBitmap& bitmap)
|
||||
{
|
||||
m_bitmap = bitmap;
|
||||
UpdateItemBitmap() ;
|
||||
UpdateItemBitmap();
|
||||
}
|
||||
|
||||
void wxMenuItem::UpdateItemBitmap()
|
||||
@@ -125,14 +125,14 @@ void wxMenuItem::UpdateItemStatus()
|
||||
if( mhandle == NULL || index == 0)
|
||||
return ;
|
||||
|
||||
UMAEnableMenuItem( mhandle , index , m_isEnabled ) ;
|
||||
if ( IsCheckable() && IsChecked() )
|
||||
UMAEnableMenuItem( mhandle , index , m_isEnabled ) ;
|
||||
if ( IsCheckable() && IsChecked() )
|
||||
::SetItemMark( mhandle , index , 0x12 ) ; // checkmark
|
||||
else
|
||||
::SetItemMark( mhandle , index , 0 ) ; // no mark
|
||||
|
||||
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
|
||||
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
|
||||
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
|
||||
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
|
||||
UMASetMenuItemShortcut( mhandle , index , entry ) ;
|
||||
delete entry ;
|
||||
}
|
||||
@@ -148,8 +148,8 @@ void wxMenuItem::UpdateItemText()
|
||||
if( mhandle == NULL || index == 0)
|
||||
return ;
|
||||
|
||||
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
|
||||
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
|
||||
UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
|
||||
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
|
||||
UMASetMenuItemShortcut( mhandle , index , entry ) ;
|
||||
delete entry ;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void wxMenuItem::SetText(const wxString& text)
|
||||
|
||||
void wxMenuItem::SetAsRadioGroupStart()
|
||||
{
|
||||
m_isRadioGroupStart = TRUE;
|
||||
m_isRadioGroupStart = true;
|
||||
}
|
||||
|
||||
void wxMenuItem::SetRadioGroupStart(int start)
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
@@ -30,7 +30,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_macIsUserPane = FALSE ;
|
||||
m_macIsUserPane = false ;
|
||||
|
||||
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
|
||||
return false;
|
||||
@@ -46,30 +46,30 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPostControlCreate(pos,size) ;
|
||||
|
||||
m_cycle = this ;
|
||||
m_cycle = this ;
|
||||
|
||||
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)
|
||||
if (HasFlag(wxRB_GROUP))
|
||||
{
|
||||
wxWindow *child = node->GetData();
|
||||
if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
|
||||
{
|
||||
chief = (wxRadioButton*) child;
|
||||
if (child->HasFlag(wxRB_GROUP)) break;
|
||||
}
|
||||
node = node->GetPrevious();
|
||||
AddInCycle( NULL ) ;
|
||||
}
|
||||
AddInCycle( chief ) ;
|
||||
}
|
||||
return TRUE;
|
||||
else
|
||||
{
|
||||
/* 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)
|
||||
@@ -84,12 +84,12 @@ void wxRadioButton::SetValue(bool val)
|
||||
cycle=this->NextInCycle();
|
||||
if (cycle!=NULL)
|
||||
{
|
||||
while (cycle!=this)
|
||||
{
|
||||
cycle->SetValue(false);
|
||||
cycle=cycle->NextInCycle();
|
||||
}
|
||||
}
|
||||
while (cycle!=this)
|
||||
{
|
||||
cycle->SetValue(false);
|
||||
cycle=cycle->NextInCycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,18 +134,20 @@ wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
|
||||
{
|
||||
wxRadioButton *next,*current;
|
||||
|
||||
if (cycle==NULL) {
|
||||
if (cycle==NULL)
|
||||
{
|
||||
m_cycle=this;
|
||||
return(this);
|
||||
}
|
||||
else {
|
||||
}
|
||||
else
|
||||
{
|
||||
current=cycle;
|
||||
while ((next=current->m_cycle)!=cycle)
|
||||
while ((next=current->m_cycle)!=cycle)
|
||||
current=current->m_cycle;
|
||||
m_cycle=cycle;
|
||||
current->m_cycle=this;
|
||||
return(cycle);
|
||||
}
|
||||
m_cycle=cycle;
|
||||
current->m_cycle=this;
|
||||
return(cycle);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -907,7 +907,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
event.SetEventObject(def);
|
||||
def->Command(event);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// this will make wxWidgets eat the ENTER key so that
|
||||
|
@@ -1831,15 +1831,15 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||
if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||
x = currentX;
|
||||
if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||
if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||
y = currentY;
|
||||
|
||||
AdjustForParentClientOrigin(x, y, sizeFlags);
|
||||
|
||||
wxSize size(-1, -1);
|
||||
if ( width == -1 )
|
||||
wxSize size = wxDefaultSize;
|
||||
if ( width == wxDefaultCoord )
|
||||
{
|
||||
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 ( size.x == -1 )
|
||||
if ( size.x == wxDefaultCoord )
|
||||
{
|
||||
size = DoGetBestSize();
|
||||
}
|
||||
@@ -1894,7 +1894,7 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
|
||||
|
||||
void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
|
||||
{
|
||||
if ( clientheight != -1 || clientheight != -1 )
|
||||
if ( clientheight != wxDefaultCoord || clientheight != wxDefaultCoord )
|
||||
{
|
||||
int currentclientwidth , currentclientheight ;
|
||||
int currentwidth , currentheight ;
|
||||
@@ -1902,7 +1902,7 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
|
||||
GetClientSize( ¤tclientwidth , ¤tclientheight ) ;
|
||||
GetSize( ¤twidth , ¤theight ) ;
|
||||
|
||||
DoSetSize( -1 , -1 , currentwidth + clientwidth - currentclientwidth ,
|
||||
DoSetSize( wxDefaultCoord , wxDefaultCoord , currentwidth + clientwidth - currentclientwidth ,
|
||||
currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ;
|
||||
}
|
||||
}
|
||||
@@ -2169,8 +2169,8 @@ void wxWindowMac::WarpPointer (int x_pos, int y_pos)
|
||||
|
||||
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)
|
||||
{
|
||||
if ( MacGetTopLevelWindow() == NULL )
|
||||
return ;
|
||||
if ( MacGetTopLevelWindow() == NULL )
|
||||
return ;
|
||||
#if TARGET_API_MAC_OSX
|
||||
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 )
|
||||
return ;
|
||||
|
||||
int width , height ;
|
||||
GetClientSize( &width , &height ) ;
|
||||
int width , height ;
|
||||
GetClientSize( &width , &height ) ;
|
||||
#if TARGET_API_MAC_OSX
|
||||
if ( 1 /* m_peer->IsCompositing() */ )
|
||||
{
|
||||
@@ -2467,7 +2467,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
||||
Rect scrollrect;
|
||||
RgnHandle updateRgn = NewRgn() ;
|
||||
|
||||
{
|
||||
{
|
||||
wxClientDC dc(this) ;
|
||||
wxMacPortSetter helper(&dc) ;
|
||||
|
||||
@@ -3246,13 +3246,12 @@ bool wxWindowMac::Reparent(wxWindowBase *newParentBase)
|
||||
wxWindowMac *newParent = (wxWindowMac *)newParentBase;
|
||||
|
||||
if ( !wxWindowBase::Reparent(newParent) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
//copied from MacPostControlCreate
|
||||
ControlRef container = (ControlRef) GetParent()->GetHandle() ;
|
||||
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
|
||||
::EmbedControl( m_peer->GetControlRef() , container ) ;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user