///////////////////////////////////////////////////////////////////////////////
// Name: mac/toplevel.cpp
-// Purpose: implements wxTopLevelWindow for MSW
-// Author: Vadim Zeitlin
+// Purpose: implements wxTopLevelWindow for Mac
+// Author: Stefan Csomor
// Modified by:
// Created: 24.09.01
// RCS-ID: $Id$
-// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright: (c) 2001-2004 Stefan Csomor
// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
{ kEventClassKeyboard, kEventRawKeyUp } ,
{ kEventClassKeyboard, kEventRawKeyModifiersChanged } ,
+ { kEventClassWindow , kEventWindowShown } ,
{ kEventClassWindow , kEventWindowUpdate } ,
{ kEventClassWindow , kEventWindowActivated } ,
{ kEventClassWindow , kEventWindowDeactivated } ,
toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ;
result = noErr ;
break ;
+ case kEventWindowShown :
+ toplevelWindow->Refresh() ;
+ result = noErr ;
+ break ;
case kEventWindowClose :
toplevelWindow->Close() ;
result = noErr ;
attr |= kWindowCloseBoxAttribute ;
}
- attr |= kWindowLiveResizeAttribute; //turn on live resizing
-
+ if (UMAGetSystemVersion() >= 0x1000)
+ {
+ //turn on live resizing (OS X only)
+ attr |= kWindowLiveResizeAttribute;
+ }
+
#if TARGET_CARBON
#if 0 // having problems right now with that
if (HasFlag(wxSTAY_ON_TOP))
- wclass = kUtilityWindowClass;
+ wclass = kUtilityWindowClass;
#endif
#endif
//this setup lets us have compositing and non-compositing
//windows in the same application.
-
+
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0400
if ( wxTopLevelWindowMac::s_macWindowCompositing )
{
attr |= kWindowCompositingAttribute;
m_macUsesCompositing = TRUE;
}
else
+#endif
{
m_macUsesCompositing = FALSE;
}
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
wxAssociateWinWithMacWindow( m_macWindow , this ) ;
- UMASetWTitle( (WindowRef)m_macWindow , title ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
if ( wxTopLevelWindowMac::s_macWindowCompositing )
{
::GetRootControl( (WindowRef)m_macWindow, (ControlHandle*)&m_macRootControl ) ;
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
wxWindow::SetTitle( title ) ;
- UMASetWTitle( (WindowRef)m_macWindow , title ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
}
bool wxTopLevelWindowMac::Show(bool show)