#include "wx/dcclient.h"
#include "wx/button.h"
#include "wx/menu.h"
+ #include "wx/dialog.h"
+ #include "wx/settings.h"
+ #include "wx/msgdlg.h"
+ #include "wx/scrolbar.h"
+ #include "wx/statbox.h"
+ #include "wx/textctrl.h"
+ #include "wx/toolbar.h"
+ #include "wx/layout.h"
+ #include "wx/statusbr.h"
+ #include "wx/menuitem.h"
#endif
-#include "wx/layout.h"
-#include "wx/dialog.h"
-#include "wx/scrolbar.h"
-#include "wx/statbox.h"
-#include "wx/settings.h"
-#include "wx/msgdlg.h"
#include "wx/tooltip.h"
-#include "wx/statusbr.h"
-#include "wx/menuitem.h"
#include "wx/spinctrl.h"
#include "wx/geometry.h"
-#include "wx/textctrl.h"
-
-#include "wx/toolbar.h"
#if wxUSE_CARET
#include "wx/caret.h"
#include <string.h>
-extern wxList wxPendingDelete;
-
#ifdef __WXUNIVERSAL__
IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase)
#else
// wxRemoveMacControlAssociation( this ) ;
// If we delete an item, we should initialize the parent panel,
// because it could now be invalid.
- wxWindow *parent = GetParent() ;
- if ( parent )
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ if ( tlw )
{
- if (parent->GetDefaultItem() == (wxButton*) this)
- parent->SetDefaultItem(NULL);
+ if ( tlw->GetDefaultItem() == (wxButton*) this)
+ tlw->SetDefaultItem(NULL);
}
if ( m_peer && m_peer->Ok() )
// adjust font, controlsize etc
DoSetWindowVariant( m_windowVariant ) ;
- m_peer->SetLabel( wxStripMenuCodes(m_label) ) ;
+ m_peer->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics) ) ;
if (!m_macIsUserPane)
SetInitialBestSize(size);
menu->SetInvokingWindow(this);
menu->UpdateUI();
- if ( x == -1 && y == -1 )
+ if ( x == wxDefaultCoord && y == wxDefaultCoord )
{
wxPoint mouse = wxGetMousePosition();
x = mouse.x;
void wxWindowMac::SetLabel(const wxString& title)
{
- m_label = wxStripMenuCodes(title) ;
+ m_label = wxStripMenuCodes(title, wxStrip_Mnemonics) ;
if ( m_peer && m_peer->Ok() )
m_peer->SetLabel( m_label ) ;
int range, bool refresh)
{
bool showScroller;
+ bool triggerSizeEvent = false;
if ( orient == wxHORIZONTAL )
{
{
showScroller = ((range != 0) && (range > thumbVisible));
if ( m_hScrollBar->IsShown() != showScroller )
- m_hScrollBar->Show( showScroller ) ;
+ {
+ m_hScrollBar->Show( showScroller );
+ triggerSizeEvent = true;
+ }
m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
}
{
showScroller = ((range != 0) && (range > thumbVisible));
if ( m_vScrollBar->IsShown() != showScroller )
+ {
m_vScrollBar->Show( showScroller ) ;
+ triggerSizeEvent = true;
+ }
m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
}
}
MacRepositionScrollBars() ;
+ if ( triggerSizeEvent )
+ {
+ wxSizeEvent event(GetSize(), m_windowId);
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+ }
}
// Does a physical scroll