[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

@@ -2,7 +2,7 @@
// Name: checklst.cpp // Name: checklst.cpp
// Purpose: implementation of wxCheckListBox class // Purpose: implementation of wxCheckListBox class
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
// Created: 1998-01-01 // Created: 1998-01-01
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Stefan Csomor // Copyright: (c) Stefan Csomor
@@ -62,10 +62,10 @@ bool wxCheckListBox::Create(wxWindow *parent,
} }
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrowserItemID itemID, static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrowserItemID itemID,
DataBrowserItemNotification message, DataBrowserItemDataRef itemData) DataBrowserItemNotification message, DataBrowserItemDataRef itemData)
#else #else
static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrowserItemID itemID, static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrowserItemID itemID,
DataBrowserItemNotification message) DataBrowserItemNotification message)
#endif #endif
{ {
@@ -108,100 +108,100 @@ static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrow
event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : TRUE ); event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : TRUE );
wxPostEvent( list->GetEventHandler() , event ) ; wxPostEvent( list->GetEventHandler() , event ) ;
// direct notification is not always having the listbox GetSelection() having in synch with event // direct notification is not always having the listbox GetSelection() having in synch with event
// list->GetEventHandler()->ProcessEvent(event) ; // list->GetEventHandler()->ProcessEvent(event) ;
} }
} }
} }
} }
static pascal OSStatus ListBoxGetSetItemData(ControlRef browser, 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 )
{
switch (property)
{
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 ) ;
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;
default: if ( ! changeValue )
break; {
} switch (property)
} {
else
{ case kTextColumnId:
switch( property ) {
{ long ref = GetControlReference( browser ) ;
case kCheckboxColumnId : if ( ref )
{ {
long ref = GetControlReference( browser ) ; wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
if ( ref )
{
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 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;
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
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,11 +211,11 @@ 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") );
if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) )
return false; return false;
@@ -226,7 +226,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
m_peer = new wxMacControl(this) ; m_peer = new wxMacControl(this) ;
verify_noerr( ::CreateDataBrowserControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, kDataBrowserListView , m_peer->GetControlRefAddr() ) ); verify_noerr( ::CreateDataBrowserControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, kDataBrowserListView , m_peer->GetControlRefAddr() ) );
DataBrowserSelectionFlags options = kDataBrowserDragSelect ; DataBrowserSelectionFlags options = kDataBrowserDragSelect ;
if ( style & wxLB_MULTIPLE ) if ( style & wxLB_MULTIPLE )
@@ -241,47 +241,47 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
{ {
options += kDataBrowserSelectOnlyOne ; options += kDataBrowserSelectOnlyOne ;
} }
verify_noerr(m_peer->SetSelectionFlags( options ) ); verify_noerr(m_peer->SetSelectionFlags( options ) );
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 ) ) ;
@@ -291,12 +291,12 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
DataBrowserCallbacks callbacks ; DataBrowserCallbacks callbacks ;
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);
@@ -314,8 +314,8 @@ 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();
@@ -248,7 +248,7 @@ bool wxClipboard::AddData( wxDataObject *data )
size_t sz = data->GetDataSize( array[i] ) ; size_t sz = data->GetDataSize( array[i] ) ;
void* buf = malloc( sz + 1 ) ; void* buf = malloc( sz + 1 ) ;
if ( buf ) if ( buf )
{ {
// empty the buffer because in some case GetDataHere does not fill buf // empty the buffer because in some case GetDataHere does not fill buf
memset(buf, 0, sz+1); memset(buf, 0, sz+1);
data->GetDataHere( array[i] , buf ) ; data->GetDataHere( array[i] , buf ) ;
@@ -293,23 +293,23 @@ void wxClipboard::Close()
wxCHECK_RET( m_open, wxT("clipboard not open") ); wxCHECK_RET( m_open, wxT("clipboard not open") );
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;
m_data = (wxDataObject*) NULL; m_data = (wxDataObject*) NULL;
} }
} }
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);
@@ -1666,9 +1666,9 @@ void wxDC::MacInstallFont() const
Pattern whiteColor ; Pattern whiteColor ;
::BackPat(GetQDGlobalsWhite(&whiteColor)); ::BackPat(GetQDGlobalsWhite(&whiteColor));
} }
wxASSERT( m_font.Ok() ) ; wxASSERT( m_font.Ok() ) ;
::TextFont( m_font.MacGetFontNum() ) ; ::TextFont( m_font.MacGetFontNum() ) ;
::TextSize( (short)(m_scaleY * m_font.MacGetFontSize()) ) ; ::TextSize( (short)(m_scaleY * m_font.MacGetFontSize()) ) ;
@@ -1745,7 +1745,7 @@ void wxDC::MacInstallFont() const
atsuTags, atsuSizes, atsuValues); atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't Modify ATSU style") ) ; wxASSERT_MSG( status == noErr , wxT("couldn't Modify ATSU style") ) ;
} }
Pattern gPatterns[] = Pattern gPatterns[] =

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

@@ -2,7 +2,7 @@
// Name: menuitem.cpp // Name: menuitem.cpp
// Purpose: wxMenuItem implementation // Purpose: wxMenuItem implementation
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
// Created: 1998-01-01 // Created: 1998-01-01
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Stefan Csomor // Copyright: (c) Stefan Csomor
@@ -43,11 +43,11 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
const wxString& text, const wxString& text,
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") ) ;
// In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines
// therefore these item must not be translated // therefore these item must not be translated
if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") )
@@ -56,32 +56,32 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
} }
m_radioGroup.start = -1; m_radioGroup.start = -1;
m_isRadioGroupStart = FALSE; m_isRadioGroupStart = false;
} }
wxMenuItem::~wxMenuItem() wxMenuItem::~wxMenuItem()
{ {
} }
// change item state // change item state
// ----------------- // -----------------
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()
{ {
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
return ; return ;
if ( m_bitmap.Ok() ) if ( m_bitmap.Ok() )
{ {
#if wxUSE_BMPBUTTON #if wxUSE_BMPBUTTON
@@ -90,19 +90,19 @@ void wxMenuItem::UpdateItemBitmap()
if ( info.contentType != kControlNoContent ) if ( info.contentType != kControlNoContent )
{ {
if ( info.contentType == kControlContentIconRef ) if ( info.contentType == kControlContentIconRef )
SetMenuItemIconHandle( mhandle , index , SetMenuItemIconHandle( mhandle , index ,
kMenuIconRefType , (Handle) info.u.iconRef ) ; kMenuIconRefType , (Handle) info.u.iconRef ) ;
} }
wxMacReleaseBitmapButton( &info ) ; wxMacReleaseBitmapButton( &info ) ;
#endif #endif
} }
} }
void wxMenuItem::UpdateItemStatus() void wxMenuItem::UpdateItemStatus()
{ {
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
#if TARGET_CARBON #if TARGET_CARBON
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId) if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
{ {
@@ -119,37 +119,37 @@ void wxMenuItem::UpdateItemStatus()
EnableMenuCommand( NULL , kHICommandQuit ) ; EnableMenuCommand( NULL , kHICommandQuit ) ;
} }
#endif #endif
{ {
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
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 ;
} }
} }
void wxMenuItem::UpdateItemText() void wxMenuItem::UpdateItemText()
{ {
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
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 ;
} }
@@ -176,7 +176,7 @@ void wxMenuItem::Enable(bool bDoEnable)
} }
void wxMenuItem::UncheckRadio() void wxMenuItem::UncheckRadio()
{ {
if ( m_isChecked ) if ( m_isChecked )
{ {
wxMenuItemBase::Check( false ) ; wxMenuItemBase::Check( false ) ;
UpdateItemStatus() ; UpdateItemStatus() ;
@@ -187,7 +187,7 @@ void wxMenuItem::Check(bool bDoCheck)
{ {
wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
if ( m_isChecked != bDoCheck ) if ( m_isChecked != bDoCheck )
{ {
if ( GetKind() == wxITEM_RADIO ) if ( GetKind() == wxITEM_RADIO )
{ {
@@ -195,7 +195,7 @@ void wxMenuItem::Check(bool bDoCheck)
{ {
wxMenuItemBase::Check( bDoCheck ) ; wxMenuItemBase::Check( bDoCheck ) ;
UpdateItemStatus() ; UpdateItemStatus() ;
// get the index of this item in the menu // get the index of this item in the menu
const wxMenuItemList& items = m_parentMenu->GetMenuItems(); const wxMenuItemList& items = m_parentMenu->GetMenuItems();
int pos = items.IndexOf(this); int pos = items.IndexOf(this);
@@ -246,7 +246,7 @@ void wxMenuItem::SetText(const wxString& text)
return; return;
wxMenuItemBase::SetText(text); wxMenuItemBase::SetText(text);
UpdateItemText() ; UpdateItemText() ;
} }
@@ -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,46 +30,46 @@ 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;
m_label = label ; m_label = label ;
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
m_peer = new wxMacControl(this) ; m_peer = new wxMacControl(this) ;
verify_noerr ( CreateRadioButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , verify_noerr ( CreateRadioButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
0 , false /* no autotoggle */ , m_peer->GetControlRefAddr() ) ); 0 , false /* no autotoggle */ , m_peer->GetControlRefAddr() ) );
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)
@@ -77,19 +77,19 @@ void wxRadioButton::SetValue(bool val)
wxRadioButton *cycle; wxRadioButton *cycle;
if ( m_peer->GetValue() == val ) if ( m_peer->GetValue() == val )
return ; return ;
m_peer->SetValue( val ) ; m_peer->SetValue( val ) ;
if (val) if (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();
} }
} }
} }
} }
@@ -104,12 +104,12 @@ void wxRadioButton::Command (wxCommandEvent & event)
ProcessCommand (event); ProcessCommand (event);
} }
wxInt32 wxRadioButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) ) wxInt32 wxRadioButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
{ {
// if already set -> no action // if already set -> no action
if ( GetValue() ) if ( GetValue() )
return noErr; return noErr;
wxRadioButton *cycle; wxRadioButton *cycle;
cycle=this->NextInCycle(); cycle=this->NextInCycle();
if (cycle!=NULL) { if (cycle!=NULL) {
@@ -133,19 +133,21 @@ wxInt32 wxRadioButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVE
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle) 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

@@ -64,7 +64,7 @@
#endif #endif
#ifndef __WXMAC_OSX__ #ifndef __WXMAC_OSX__
enum enum
{ {
kTXNVisibilityTag = 'visb' /*set the visibility state of the object */ kTXNVisibilityTag = 'visb' /*set the visibility state of the object */
}; };
@@ -335,7 +335,7 @@ public :
protected : protected :
OSStatus DoCreate(); OSStatus DoCreate();
void MacUpdatePosition() ; void MacUpdatePosition() ;
void MacActivatePaneText(Boolean setActive) ; void MacActivatePaneText(Boolean setActive) ;
void MacFocusPaneText(Boolean setFocus) ; void MacFocusPaneText(Boolean setFocus) ;
@@ -349,7 +349,7 @@ private :
Rect m_txnControlBounds ; Rect m_txnControlBounds ;
Rect m_txnVisBounds ; Rect m_txnVisBounds ;
#ifdef __WXMAC_OSX__ #ifdef __WXMAC_OSX__
static pascal void TXNScrollInfoProc (SInt32 iValue, SInt32 iMaximumValue, static pascal void TXNScrollInfoProc (SInt32 iValue, SInt32 iMaximumValue,
TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon) ; TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon) ;
static pascal void TXNScrollActionProc( ControlRef controlRef , ControlPartCode partCode ) ; static pascal void TXNScrollActionProc( ControlRef controlRef , ControlPartCode partCode ) ;
ControlRef m_sbHorizontal ; ControlRef m_sbHorizontal ;
@@ -456,13 +456,13 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
{ {
SetEditable( false ) ; SetEditable( false ) ;
} }
SetCursor( wxCursor( wxCURSOR_IBEAM ) ) ; SetCursor( wxCursor( wxCURSOR_IBEAM ) ) ;
return true; return true;
} }
void wxTextCtrl::MacSuperChangedPosition() void wxTextCtrl::MacSuperChangedPosition()
{ {
wxWindow::MacSuperChangedPosition() ; wxWindow::MacSuperChangedPosition() ;
GetPeer()->SuperChangedPosition() ; GetPeer()->SuperChangedPosition() ;
@@ -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
@@ -1392,9 +1392,9 @@ public :
TXNControlData m_data[1] ; TXNControlData m_data[1] ;
} ; } ;
wxMacMLTEControl::wxMacMLTEControl( wxTextCtrl *peer ) : wxMacTextControl( peer ) wxMacMLTEControl::wxMacMLTEControl( wxTextCtrl *peer ) : wxMacTextControl( peer )
{ {
SetNeedsFocusRect( true ) ; SetNeedsFocusRect( true ) ;
} }
wxString wxMacMLTEControl::GetStringValue() const wxString wxMacMLTEControl::GetStringValue() const
@@ -1486,7 +1486,7 @@ void wxMacMLTEControl::SetStringValue( const wxString &str)
TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle ) TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle )
{ {
TXNFrameOptions frameOptions = TXNFrameOptions frameOptions =
kTXNDontDrawCaretWhenInactiveMask kTXNDontDrawCaretWhenInactiveMask
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
| kTXNDoFontSubstitutionMask | kTXNDoFontSubstitutionMask
#endif #endif
@@ -1523,17 +1523,17 @@ TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle )
void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, bool visible ) void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, bool visible )
{ {
TXNControlTag iControlTags[] = TXNControlTag iControlTags[] =
{ {
kTXNDoFontSubstitution, kTXNDoFontSubstitution,
kTXNWordWrapStateTag , kTXNWordWrapStateTag ,
}; };
TXNControlData iControlData[] = TXNControlData iControlData[] =
{ {
{true}, {true},
{kTXNNoAutoWrap}, {kTXNNoAutoWrap},
}; };
int toptag = WXSIZEOF( iControlTags ) ; int toptag = WXSIZEOF( iControlTags ) ;
if ( m_windowStyle & wxTE_MULTILINE ) if ( m_windowStyle & wxTE_MULTILINE )
@@ -1568,7 +1568,7 @@ void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, boo
kTXNStartOffset, kTXNStartOffset,
kTXNEndOffset) ); kTXNEndOffset) );
} }
if ( m_windowStyle & wxTE_PASSWORD ) if ( m_windowStyle & wxTE_PASSWORD )
{ {
UniChar c = 0xA5 ; UniChar c = 0xA5 ;
@@ -2006,13 +2006,13 @@ int wxMacMLTEControl::GetLineLength(long lineNo) const
TXNScrollInfoUPP gTXNScrollInfoProc = NULL ; TXNScrollInfoUPP gTXNScrollInfoProc = NULL ;
ControlActionUPP gTXNScrollActionProc = NULL ; ControlActionUPP gTXNScrollActionProc = NULL ;
pascal void wxMacMLTEClassicControl::TXNScrollInfoProc (SInt32 iValue, SInt32 iMaximumValue, TXNScrollBarOrientation pascal void wxMacMLTEClassicControl::TXNScrollInfoProc (SInt32 iValue, SInt32 iMaximumValue, TXNScrollBarOrientation
iScrollBarOrientation, SInt32 iRefCon) iScrollBarOrientation, SInt32 iRefCon)
{ {
wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) iRefCon ; wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) iRefCon ;
SInt32 value = wxMax( iValue , 0 ) ; SInt32 value = wxMax( iValue , 0 ) ;
SInt32 maximum = wxMax( iMaximumValue , 0 ) ; SInt32 maximum = wxMax( iMaximumValue , 0 ) ;
if ( iScrollBarOrientation == kTXNHorizontal ) if ( iScrollBarOrientation == kTXNHorizontal )
{ {
if ( mlte->m_sbHorizontal ) if ( mlte->m_sbHorizontal )
@@ -2039,12 +2039,12 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) GetControlReference( controlRef ) ; wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) GetControlReference( controlRef ) ;
if ( mlte == NULL ) if ( mlte == NULL )
return ; return ;
if ( controlRef != mlte->m_sbVertical && controlRef != mlte->m_sbHorizontal ) if ( controlRef != mlte->m_sbVertical && controlRef != mlte->m_sbHorizontal )
return ; return ;
bool isHorizontal = ( controlRef == mlte->m_sbHorizontal ) ; bool isHorizontal = ( controlRef == mlte->m_sbHorizontal ) ;
SInt32 minimum = 0 ; SInt32 minimum = 0 ;
SInt32 maximum = GetControl32BitMaximum( controlRef ) ; SInt32 maximum = GetControl32BitMaximum( controlRef ) ;
SInt32 value = GetControl32BitValue( controlRef ) ; SInt32 value = GetControl32BitValue( controlRef ) ;
@@ -2064,7 +2064,7 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
delta = -GetControlViewSize( controlRef ) ; delta = -GetControlViewSize( controlRef ) ;
break ; break ;
case kControlIndicatorPart : case kControlIndicatorPart :
delta = value - delta = value -
( isHorizontal ? mlte->m_lastHorizontalValue : mlte->m_lastVerticalValue ) ; ( isHorizontal ? mlte->m_lastHorizontalValue : mlte->m_lastVerticalValue ) ;
break ; break ;
default : default :
@@ -2073,7 +2073,7 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
if ( delta != 0 ) if ( delta != 0 )
{ {
SInt32 newValue = value ; SInt32 newValue = value ;
if ( partCode != kControlIndicatorPart ) if ( partCode != kControlIndicatorPart )
{ {
if( value + delta < minimum ) if( value + delta < minimum )
@@ -2084,13 +2084,13 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
SetControl32BitValue( controlRef , value + delta ) ; SetControl32BitValue( controlRef , value + delta ) ;
newValue = value + delta ; newValue = value + delta ;
} }
SInt32 verticalDelta = isHorizontal ? 0 : delta ; SInt32 verticalDelta = isHorizontal ? 0 : delta ;
SInt32 horizontalDelta = isHorizontal ? delta : 0 ; SInt32 horizontalDelta = isHorizontal ? delta : 0 ;
err = TXNScroll( mlte->m_txn , kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, err = TXNScroll( mlte->m_txn , kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels,
&verticalDelta , &horizontalDelta ); &verticalDelta , &horizontalDelta );
if ( isHorizontal ) if ( isHorizontal )
mlte->m_lastHorizontalValue = newValue ; mlte->m_lastHorizontalValue = newValue ;
else else
@@ -2100,7 +2100,7 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
#endif #endif
// make correct activations // make correct activations
void wxMacMLTEClassicControl::MacActivatePaneText(Boolean setActive) void wxMacMLTEClassicControl::MacActivatePaneText(Boolean setActive)
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
@@ -2113,29 +2113,29 @@ void wxMacMLTEClassicControl::MacActivatePaneText(Boolean setActive)
TXNFocus( m_txn, setActive); TXNFocus( m_txn, setActive);
} }
void wxMacMLTEClassicControl::MacFocusPaneText(Boolean setFocus) void wxMacMLTEClassicControl::MacFocusPaneText(Boolean setFocus)
{ {
TXNFocus( m_txn, setFocus); TXNFocus( m_txn, setFocus);
} }
// guards against inappropriate redraw (hidden objects drawing onto window) // guards against inappropriate redraw (hidden objects drawing onto window)
void wxMacMLTEClassicControl::MacSetObjectVisibility(Boolean vis) void wxMacMLTEClassicControl::MacSetObjectVisibility(Boolean vis)
{ {
ControlRef controlFocus = 0 ; ControlRef controlFocus = 0 ;
GetKeyboardFocus( m_txnWindow , &controlFocus ) ; GetKeyboardFocus( m_txnWindow , &controlFocus ) ;
if ( controlFocus == m_controlRef && vis == false ) if ( controlFocus == m_controlRef && vis == false )
{ {
SetKeyboardFocus( m_txnWindow , m_controlRef , kControlFocusNoPart ) ; SetKeyboardFocus( m_txnWindow , m_controlRef , kControlFocusNoPart ) ;
} }
TXNControlTag iControlTags[1] = { kTXNVisibilityTag }; TXNControlTag iControlTags[1] = { kTXNVisibilityTag };
TXNControlData iControlData[1] = { {(UInt32) false } }; TXNControlData iControlData[1] = { {(UInt32) false } };
verify_noerr( TXNGetTXNObjectControls( m_txn , 1, verify_noerr( TXNGetTXNObjectControls( m_txn , 1,
iControlTags, iControlData ) ) ; iControlTags, iControlData ) ) ;
if ( iControlData[0].uValue != vis ) if ( iControlData[0].uValue != vis )
{ {
iControlData[0].uValue = vis ; iControlData[0].uValue = vis ;
@@ -2149,7 +2149,7 @@ void wxMacMLTEClassicControl::MacSetObjectVisibility(Boolean vis)
// make sure that the TXNObject is at the right position // make sure that the TXNObject is at the right position
void wxMacMLTEClassicControl::MacUpdatePosition() void wxMacMLTEClassicControl::MacUpdatePosition()
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
@@ -2157,14 +2157,14 @@ void wxMacMLTEClassicControl::MacUpdatePosition()
Rect bounds ; Rect bounds ;
UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds); UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds);
wxRect visRect = textctrl->MacGetClippedClientRect() ; wxRect visRect = textctrl->MacGetClippedClientRect() ;
Rect visBounds = { visRect.y , visRect.x , visRect.y + visRect.height , visRect.x + visRect.width } ; Rect visBounds = { visRect.y , visRect.x , visRect.y + visRect.height , visRect.x + visRect.width } ;
int x , y ; int x , y ;
x = y = 0 ; x = y = 0 ;
textctrl->MacWindowToRootWindow( &x , &y ) ; textctrl->MacWindowToRootWindow( &x , &y ) ;
OffsetRect( &visBounds , x , y ) ; OffsetRect( &visBounds , x , y ) ;
if ( !EqualRect( &bounds , &m_txnControlBounds ) || !EqualRect( &visBounds , &m_txnVisBounds) ) if ( !EqualRect( &bounds , &m_txnControlBounds ) || !EqualRect( &visBounds , &m_txnVisBounds) )
{ {
m_txnControlBounds = bounds ; m_txnControlBounds = bounds ;
@@ -2186,10 +2186,10 @@ void wxMacMLTEClassicControl::MacUpdatePosition()
sbBounds.top = h - 14 ; sbBounds.top = h - 14 ;
sbBounds.right = w + 1 ; sbBounds.right = w + 1 ;
sbBounds.bottom = h + 1 ; sbBounds.bottom = h + 1 ;
if ( !isCompositing ) if ( !isCompositing )
OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ; OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ;
SetControlBounds( m_sbHorizontal , &sbBounds ) ; SetControlBounds( m_sbHorizontal , &sbBounds ) ;
SetControlViewSize( m_sbHorizontal , w ) ; SetControlViewSize( m_sbHorizontal , w ) ;
} }
@@ -2201,7 +2201,7 @@ void wxMacMLTEClassicControl::MacUpdatePosition()
sbBounds.top = -1 ; sbBounds.top = -1 ;
sbBounds.right = w + 1 ; sbBounds.right = w + 1 ;
sbBounds.bottom = m_sbHorizontal ? h - 14 : h + 1 ; sbBounds.bottom = m_sbHorizontal ? h - 14 : h + 1 ;
if ( !isCompositing ) if ( !isCompositing )
OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ; OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ;
@@ -2209,39 +2209,39 @@ void wxMacMLTEClassicControl::MacUpdatePosition()
SetControlViewSize( m_sbVertical , h ) ; SetControlViewSize( m_sbVertical , h ) ;
} }
} }
Rect oldviewRect ; Rect oldviewRect ;
TXNLongRect olddestRect ; TXNLongRect olddestRect ;
TXNGetRectBounds( m_txn , &oldviewRect , &olddestRect , NULL ) ; TXNGetRectBounds( m_txn , &oldviewRect , &olddestRect , NULL ) ;
Rect viewRect = { m_txnControlBounds.top, m_txnControlBounds.left, Rect viewRect = { m_txnControlBounds.top, m_txnControlBounds.left,
m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ; m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ;
TXNLongRect destRect = { m_txnControlBounds.top, m_txnControlBounds.left, TXNLongRect destRect = { m_txnControlBounds.top, m_txnControlBounds.left,
m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ; m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ;
if ( olddestRect.right >= 10000 ) if ( olddestRect.right >= 10000 )
destRect.right = destRect.left + 32000 ; destRect.right = destRect.left + 32000 ;
if ( olddestRect.bottom >= 0x20000000 ) if ( olddestRect.bottom >= 0x20000000 )
destRect.bottom = destRect.top + 0x40000000 ; destRect.bottom = destRect.top + 0x40000000 ;
SectRect( &viewRect , &visBounds , &viewRect ) ; SectRect( &viewRect , &visBounds , &viewRect ) ;
TXNSetRectBounds( m_txn , &viewRect , &destRect , true ) ; TXNSetRectBounds( m_txn , &viewRect , &destRect , true ) ;
/* /*
TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left, TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left,
m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ), m_txnFrameID); m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ), m_txnFrameID);
*/ */
#else #else
TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left, TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left,
wxMax( m_txnControlBounds.bottom , m_txnControlBounds.top ) , wxMax( m_txnControlBounds.bottom , m_txnControlBounds.top ) ,
wxMax( m_txnControlBounds.right , m_txnControlBounds.left ) , m_txnFrameID); wxMax( m_txnControlBounds.right , m_txnControlBounds.left ) , m_txnFrameID);
// the SetFrameBounds method unter classic sometimes does not correctly scroll a selection into sight after a // the SetFrameBounds method unter classic sometimes does not correctly scroll a selection into sight after a
// movement, therefore we have to force it // movement, therefore we have to force it
TXNLongRect textRect ; TXNLongRect textRect ;
TXNGetRectBounds( m_txn , NULL , NULL , &textRect ) ; TXNGetRectBounds( m_txn , NULL , NULL , &textRect ) ;
if ( textRect.left < m_txnControlBounds.left ) if ( textRect.left < m_txnControlBounds.left )
{ {
TXNShowSelection( m_txn , false ) ; TXNShowSelection( m_txn , false ) ;
@@ -2250,13 +2250,13 @@ void wxMacMLTEClassicControl::MacUpdatePosition()
} }
} }
void wxMacMLTEClassicControl::SetRect( Rect *r ) void wxMacMLTEClassicControl::SetRect( Rect *r )
{ {
wxMacControl::SetRect( r ) ; wxMacControl::SetRect( r ) ;
MacUpdatePosition() ; MacUpdatePosition() ;
} }
void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 thePart) void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 thePart)
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
@@ -2269,7 +2269,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 thePart)
} }
} }
wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt16 y) wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt16 y)
{ {
Point where = { y , x } ; Point where = { y , x } ;
ControlPartCode result; ControlPartCode result;
@@ -2278,7 +2278,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt1
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
return 0 ; return 0 ;
if (textctrl->MacIsReallyShown() ) if (textctrl->MacIsReallyShown() )
{ {
if (PtInRect(where, &m_txnControlBounds)) if (PtInRect(where, &m_txnControlBounds))
@@ -2302,7 +2302,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt1
return result; return result;
} }
wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* actionProc ) wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* actionProc )
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
@@ -2339,15 +2339,15 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxIn
return partCodeResult; return partCodeResult;
} }
void wxMacMLTEClassicControl::MacControlUserPaneIdleProc() void wxMacMLTEClassicControl::MacControlUserPaneIdleProc()
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
return ; return ;
if (textctrl->MacIsReallyShown()) if (textctrl->MacIsReallyShown())
{ {
if (IsControlActive(m_controlRef)) if (IsControlActive(m_controlRef))
{ {
Point mousep; Point mousep;
@@ -2356,7 +2356,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneIdleProc()
TXNIdle(m_txn); TXNIdle(m_txn);
if (PtInRect(mousep, &m_txnControlBounds)) if (PtInRect(mousep, &m_txnControlBounds))
{ {
RgnHandle theRgn; RgnHandle theRgn;
RectRgn((theRgn = NewRgn()), &m_txnControlBounds); RectRgn((theRgn = NewRgn()), &m_txnControlBounds);
@@ -2367,7 +2367,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneIdleProc()
} }
} }
wxInt16 wxMacMLTEClassicControl::MacControlUserPaneKeyDownProc (wxInt16 keyCode, wxInt16 charCode, wxInt16 modifiers) wxInt16 wxMacMLTEClassicControl::MacControlUserPaneKeyDownProc (wxInt16 keyCode, wxInt16 charCode, wxInt16 modifiers)
{ {
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef); wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
if ( textctrl == NULL ) if ( textctrl == NULL )
@@ -2381,16 +2381,16 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneKeyDownProc (wxInt16 keyCode,
ev.modifiers = modifiers ; ev.modifiers = modifiers ;
ev.message = (( keyCode << 8 ) & keyCodeMask ) + ( charCode & charCodeMask ) ; ev.message = (( keyCode << 8 ) & keyCodeMask ) + ( charCode & charCodeMask ) ;
TXNKeyDown( m_txn , &ev); TXNKeyDown( m_txn , &ev);
return kControlEntireControl; return kControlEntireControl;
} }
void wxMacMLTEClassicControl::MacControlUserPaneActivateProc( bool activating) void wxMacMLTEClassicControl::MacControlUserPaneActivateProc( bool activating)
{ {
MacActivatePaneText( activating ); MacActivatePaneText( activating );
} }
wxInt16 wxMacMLTEClassicControl::MacControlUserPaneFocusProc(wxInt16 action) wxInt16 wxMacMLTEClassicControl::MacControlUserPaneFocusProc(wxInt16 action)
{ {
ControlPartCode focusResult; ControlPartCode focusResult;
@@ -2400,19 +2400,19 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneFocusProc(wxInt16 action)
return 0; return 0;
wxMacWindowClipper clipper( textctrl ) ; wxMacWindowClipper clipper( textctrl ) ;
ControlRef controlFocus = 0 ; ControlRef controlFocus = 0 ;
GetKeyboardFocus( m_txnWindow , &controlFocus ) ; GetKeyboardFocus( m_txnWindow , &controlFocus ) ;
bool wasFocused = ( controlFocus == m_controlRef ) ; bool wasFocused = ( controlFocus == m_controlRef ) ;
switch (action) switch (action)
{ {
case kControlFocusPrevPart: case kControlFocusPrevPart:
case kControlFocusNextPart: case kControlFocusNextPart:
MacFocusPaneText( ( !wasFocused)); MacFocusPaneText( ( !wasFocused));
focusResult = (!wasFocused) ? (ControlPartCode) kControlEditTextPart : (ControlPartCode) kControlFocusNoPart; focusResult = (!wasFocused) ? (ControlPartCode) kControlEditTextPart : (ControlPartCode) kControlFocusNoPart;
break; break;
case kControlFocusNoPart: case kControlFocusNoPart:
default: default:
MacFocusPaneText( false); MacFocusPaneText( false);
@@ -2599,10 +2599,10 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
#endif #endif
/* calculate the rectangles used by the control */ /* calculate the rectangles used by the control */
UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds); UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds);
m_txnControlBounds = bounds ; m_txnControlBounds = bounds ;
m_txnVisBounds = bounds ; m_txnVisBounds = bounds ;
CGrafPtr origPort = NULL ; CGrafPtr origPort = NULL ;
GDHandle origDev = NULL ; GDHandle origDev = NULL ;
GetGWorld( &origPort , &origDev ) ; GetGWorld( &origPort , &origDev ) ;
@@ -2622,7 +2622,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
m_sbVertical = 0 ; m_sbVertical = 0 ;
m_lastHorizontalValue = 0 ; m_lastHorizontalValue = 0 ;
m_lastVerticalValue = 0 ; m_lastVerticalValue = 0 ;
Rect sb = { 0 , 0 , 0 , 0 } ; Rect sb = { 0 , 0 , 0 , 0 } ;
if ( frameOptions & kTXNWantVScrollBarMask ) if ( frameOptions & kTXNWantVScrollBarMask )
{ {
@@ -2653,21 +2653,21 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
&m_txn, &m_txnFrameID, NULL ) ); &m_txn, &m_txnFrameID, NULL ) );
/* /*
TXNCarbonEventInfo cInfo ; TXNCarbonEventInfo cInfo ;
cInfo.useCarbonEvents = false ; cInfo.useCarbonEvents = false ;
cInfo.filler = 0 ; cInfo.filler = 0 ;
cInfo.flags = 0 ; cInfo.flags = 0 ;
cInfo.fDictionary = NULL ; cInfo.fDictionary = NULL ;
TXNControlTag iControlTags[] = TXNControlTag iControlTags[] =
{ {
kTXNUseCarbonEvents , kTXNUseCarbonEvents ,
}; };
TXNControlData iControlData[] = TXNControlData iControlData[] =
{ {
{(UInt32) &cInfo }, {(UInt32) &cInfo },
}; };
int toptag = WXSIZEOF( iControlTags ) ; int toptag = WXSIZEOF( iControlTags ) ;
verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag, verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag,

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) ;
@@ -3244,15 +3244,14 @@ wxInt32 wxWindowMac::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENT
bool wxWindowMac::Reparent(wxWindowBase *newParentBase) 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;
}