switch ( GetEventKind( event ) )
{
case kEventTextInputUnicodeForKeyEvent :
- // this is only called when no default handler has jumped in, e.g. a wxControl on a floater window does not
- // get its own kEventTextInputUnicodeForKeyEvent, so we reroute the event back to the control
- wxControl* control = wxDynamicCast( focus , wxControl ) ;
- if ( control )
{
- ControlRef macControl = (ControlRef) control->GetHandle() ;
- if ( macControl )
+ // this is only called when no default handler has jumped in, e.g. a wxControl on a floater window does not
+ // get its own kEventTextInputUnicodeForKeyEvent, so we reroute the event back to the control
+ wxControl* control = wxDynamicCast( focus , wxControl ) ;
+ if ( control )
{
- ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
- result = noErr ;
+ ControlRef macControl = (ControlRef) control->GetHandle() ;
+ if ( macControl )
+ {
+ ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
+ result = noErr ;
+ }
}
- }
#if 0
- // this may lead to double events sent to a window in case all handlers have skipped the key down event
- UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
- UInt32 message = (keyCode << 8) + charCode;
+ // this may lead to double events sent to a window in case all handlers have skipped the key down event
+ UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
+ UInt32 message = (keyCode << 8) + charCode;
- if ( (focus != NULL) &&
- wxTheApp->MacSendKeyDownEvent( focus , message , modifiers , when , point.h , point.v ) )
- {
- result = noErr ;
- }
+ if ( (focus != NULL) &&
+ wxTheApp->MacSendKeyDownEvent( focus , message , modifiers , when , point.h , point.v ) )
+ {
+ result = noErr ;
+ }
#endif
+ }
break ;
default:
{
wxPoint m_position ;
wxSize m_size ;
+ bool m_wasResizable ;
}
FullScreenData ;
if ( !wxTopLevelWindowBase::Show(show) )
return false;
- if (show)
- {
+ bool plainTransition = false;
+
#if wxUSE_SYSTEM_OPTIONS
- // code contributed by Ryan Wilcox December 18, 2003
- bool plainTransition = UMAGetSystemVersion() >= 0x1000 ;
- if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
- plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
+ // code contributed by Ryan Wilcox December 18, 2003
+ plainTransition = UMAGetSystemVersion() >= 0x1000 ;
+ if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
+ plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
+#endif
+ if (show)
+ {
if ( plainTransition )
::ShowWindow( (WindowRef)m_macWindow );
else
::TransitionWindow( (WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL );
-#else
-
- ::TransitionWindow( (WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL );
-#endif
::SelectWindow( (WindowRef)m_macWindow ) ;
}
else
{
-#if wxUSE_SYSTEM_OPTIONS
- bool plainTransition = UMAGetSystemVersion() >= 0x1000 ;
- if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
- plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
if ( plainTransition )
- {
- ::HideWindow((WindowRef) m_macWindow );
- }
+ ::HideWindow( (WindowRef)m_macWindow );
else
-#endif
- {
- ::TransitionWindow((WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowHideTransitionAction, NULL );
- }
+ ::TransitionWindow( (WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowHideTransitionAction, NULL );
}
MacPropagateVisibilityChanged() ;
m_macFullScreenData = data ;
data->m_position = GetPosition() ;
data->m_size = GetSize() ;
+ data->m_wasResizable = MacGetWindowAttributes() & kWindowResizableAttribute ;
if ( style & wxFULLSCREEN_NOMENUBAR )
HideMenuBar() ;
}
SetSize( x , y , w, h ) ;
+ if( data->m_wasResizable )
+ MacChangeWindowAttributes( kWindowNoAttributes , kWindowResizableAttribute ) ;
}
else
{
ShowMenuBar() ;
FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
+ if( data->m_wasResizable )
+ MacChangeWindowAttributes( kWindowResizableAttribute , kWindowNoAttributes ) ;
SetPosition( data->m_position ) ;
SetSize( data->m_size ) ;
#endif
}
-// we are still using coordinates of the content view; TODO: switch to structure bounds
-
+// we are still using coordinates of the content view
+// TODO: switch to structure bounds
+//
void wxTopLevelWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom )
{
- Rect content ;
- Rect structure ;
+ Rect content, structure ;
+
GetWindowBounds( (WindowRef) m_macWindow, kWindowStructureRgn , &structure ) ;
GetWindowBounds( (WindowRef) m_macWindow, kWindowContentRgn , &content ) ;