several patches and extensions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-08-17 21:15:39 +00:00
parent 43cfe46c31
commit b7aec135d7
6 changed files with 62 additions and 16 deletions

View 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 ;
}
}

View 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 ;
}
}

View 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;

View 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()

View 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;

View 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()