several patches and extensions
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 17 Aug 2003 21:15:39 +0000 (21:15 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 17 Aug 2003 21:15:39 +0000 (21:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/app.cpp
src/mac/carbon/app.cpp
src/mac/carbon/msgdlg.cpp
src/mac/carbon/toplevel.cpp
src/mac/msgdlg.cpp
src/mac/toplevel.cpp

index 4d20f6ee2719efb1d543cae14c86f47f085b7d67..8529b9e59ba7f985f4c5e7a27d456639646504e3 100644 (file)
@@ -1361,6 +1361,12 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
             event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
             focus->GetEventHandler()->ProcessEvent( event ) ;
         }
+        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
+        {
+            event.m_keyCode = WXK_COMMAND ;
+            event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
+            focus->GetEventHandler()->ProcessEvent( event ) ;
+        }
         s_lastModifiers = ev->modifiers ;
     }
 }
index 4d20f6ee2719efb1d543cae14c86f47f085b7d67..8529b9e59ba7f985f4c5e7a27d456639646504e3 100644 (file)
@@ -1361,6 +1361,12 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
             event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
             focus->GetEventHandler()->ProcessEvent( event ) ;
         }
+        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
+        {
+            event.m_keyCode = WXK_COMMAND ;
+            event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
+            focus->GetEventHandler()->ProcessEvent( event ) ;
+        }
         s_lastModifiers = ev->modifiers ;
     }
 }
index 670d30644e13967db34cd632e754a64dff3d3597..b859197877f22fca2b07a38d3d9e253a3d9ee449 100644 (file)
@@ -122,7 +122,7 @@ int wxMessageDialog::ShowModal()
             {
                 // thats a cancel missing
                 param.defaultText     = (CFStringRef) kAlertDefaultOKText ;
-                param.cancelText     = NULL;
+                param.cancelText     = (CFStringRef) kAlertDefaultCancelText ;
                 param.otherText     = NULL;
                 param.helpButton     = false ;
                 param.defaultButton = kAlertStdAlertOKButton;
@@ -197,9 +197,8 @@ int wxMessageDialog::ShowModal()
         {
             if (m_dialogStyle & wxCANCEL)
             {
-                // thats a cancel missing
                 param.defaultText     = (StringPtr) kAlertDefaultOKText ;
-                param.cancelText     = NULL;
+                param.cancelText     = (StringPtr) kAlertDefaultCancelText ;
                 param.otherText     = NULL;
                 param.helpButton     = false ;
                 param.defaultButton = kAlertStdAlertOKButton;
index 1e188494c53b3eaf71d71d3f2d44d538d6bdcbcc..b774abc5d0928587144e3f0386b61f596cfeb0d1 100644 (file)
@@ -226,6 +226,12 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
                     event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
                     focus->GetEventHandler()->ProcessEvent( event ) ;
                 }
+                if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & cmdKey )
+                {
+                    event.m_keyCode = WXK_COMMAND ;
+                    event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
+                    focus->GetEventHandler()->ProcessEvent( event ) ;
+                }
                 wxTheApp->s_lastModifiers = modifiers ;
             }
              break ;
@@ -528,23 +534,35 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac()
 
 void wxTopLevelWindowMac::Maximize(bool maximize)
 {
-    // not available on mac
+    ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
+
+    Rect tempRect ;
+    GrafPtr port ;
+    GetPort( &port ) ;
+    Point pt = { 0, 0 } ;
+    SetPortWindowPort((WindowRef)m_macWindow) ;
+    LocalToGlobal( &pt ) ;
+    SetPort( port ) ;
+
+    GetWindowPortBounds((WindowRef)m_macWindow, &tempRect ) ;
+    SetSize( pt.h , pt.v , tempRect.right-tempRect.left ,
+        tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING);
 }
 
 bool wxTopLevelWindowMac::IsMaximized() const
 {
-    return false ;
+    return IsWindowInStandardState(  (WindowRef)m_macWindow , NULL , NULL ) ;
 }
 
 void wxTopLevelWindowMac::Iconize(bool iconize)
 {
-    // not available on mac
+    if ( IsWindowCollapsable((WindowRef)m_macWindow) )
+        CollapseWindow((WindowRef)m_macWindow , iconize ) ;
 }
 
 bool wxTopLevelWindowMac::IsIconized() const
 {
-    // mac dialogs cannot be iconized
-    return FALSE;
+    return IsWindowCollapsed((WindowRef)m_macWindow ) ;
 }
 
 void wxTopLevelWindowMac::Restore()
index 670d30644e13967db34cd632e754a64dff3d3597..b859197877f22fca2b07a38d3d9e253a3d9ee449 100644 (file)
@@ -122,7 +122,7 @@ int wxMessageDialog::ShowModal()
             {
                 // thats a cancel missing
                 param.defaultText     = (CFStringRef) kAlertDefaultOKText ;
-                param.cancelText     = NULL;
+                param.cancelText     = (CFStringRef) kAlertDefaultCancelText ;
                 param.otherText     = NULL;
                 param.helpButton     = false ;
                 param.defaultButton = kAlertStdAlertOKButton;
@@ -197,9 +197,8 @@ int wxMessageDialog::ShowModal()
         {
             if (m_dialogStyle & wxCANCEL)
             {
-                // thats a cancel missing
                 param.defaultText     = (StringPtr) kAlertDefaultOKText ;
-                param.cancelText     = NULL;
+                param.cancelText     = (StringPtr) kAlertDefaultCancelText ;
                 param.otherText     = NULL;
                 param.helpButton     = false ;
                 param.defaultButton = kAlertStdAlertOKButton;
index 1e188494c53b3eaf71d71d3f2d44d538d6bdcbcc..b774abc5d0928587144e3f0386b61f596cfeb0d1 100644 (file)
@@ -226,6 +226,12 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
                     event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
                     focus->GetEventHandler()->ProcessEvent( event ) ;
                 }
+                if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & cmdKey )
+                {
+                    event.m_keyCode = WXK_COMMAND ;
+                    event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
+                    focus->GetEventHandler()->ProcessEvent( event ) ;
+                }
                 wxTheApp->s_lastModifiers = modifiers ;
             }
              break ;
@@ -528,23 +534,35 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac()
 
 void wxTopLevelWindowMac::Maximize(bool maximize)
 {
-    // not available on mac
+    ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
+
+    Rect tempRect ;
+    GrafPtr port ;
+    GetPort( &port ) ;
+    Point pt = { 0, 0 } ;
+    SetPortWindowPort((WindowRef)m_macWindow) ;
+    LocalToGlobal( &pt ) ;
+    SetPort( port ) ;
+
+    GetWindowPortBounds((WindowRef)m_macWindow, &tempRect ) ;
+    SetSize( pt.h , pt.v , tempRect.right-tempRect.left ,
+        tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING);
 }
 
 bool wxTopLevelWindowMac::IsMaximized() const
 {
-    return false ;
+    return IsWindowInStandardState(  (WindowRef)m_macWindow , NULL , NULL ) ;
 }
 
 void wxTopLevelWindowMac::Iconize(bool iconize)
 {
-    // not available on mac
+    if ( IsWindowCollapsable((WindowRef)m_macWindow) )
+        CollapseWindow((WindowRef)m_macWindow , iconize ) ;
 }
 
 bool wxTopLevelWindowMac::IsIconized() const
 {
-    // mac dialogs cannot be iconized
-    return FALSE;
+    return IsWindowCollapsed((WindowRef)m_macWindow ) ;
 }
 
 void wxTopLevelWindowMac::Restore()