MacOS conforming activate/deactivate
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -38,10 +38,11 @@ class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
|
|||||||
virtual void DrawFieldText(wxDC& dc, int i);
|
virtual void DrawFieldText(wxDC& dc, int i);
|
||||||
virtual void DrawField(wxDC& dc, int i);
|
virtual void DrawField(wxDC& dc, int i);
|
||||||
virtual void SetStatusText(const wxString& text, int number = 0) ;
|
virtual void SetStatusText(const wxString& text, int number = 0) ;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
|
virtual void MacSuperEnabled( bool enable ) ;
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@@ -976,11 +976,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
|
|
||||||
void wxApp::MacSuspend( bool convertClipboard )
|
void wxApp::MacSuspend( bool convertClipboard )
|
||||||
{
|
{
|
||||||
// we have to deactive the window manually
|
// we have to deactive the top level windows manually
|
||||||
|
|
||||||
wxTopLevelWindow* window = (wxTopLevelWindow*) GetTopWindow() ;
|
wxNode* node = wxTopLevelWindows.First();
|
||||||
if ( window )
|
while (node)
|
||||||
window->MacActivate( MacGetCurrentEvent() , false ) ;
|
{
|
||||||
|
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
|
||||||
|
win->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||||
|
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
|
||||||
s_lastMouseDown = 0 ;
|
s_lastMouseDown = 0 ;
|
||||||
if( convertClipboard )
|
if( convertClipboard )
|
||||||
|
@@ -976,11 +976,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
|
|
||||||
void wxApp::MacSuspend( bool convertClipboard )
|
void wxApp::MacSuspend( bool convertClipboard )
|
||||||
{
|
{
|
||||||
// we have to deactive the window manually
|
// we have to deactive the top level windows manually
|
||||||
|
|
||||||
wxTopLevelWindow* window = (wxTopLevelWindow*) GetTopWindow() ;
|
wxNode* node = wxTopLevelWindows.First();
|
||||||
if ( window )
|
while (node)
|
||||||
window->MacActivate( MacGetCurrentEvent() , false ) ;
|
{
|
||||||
|
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
|
||||||
|
win->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||||
|
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
|
||||||
s_lastMouseDown = 0 ;
|
s_lastMouseDown = 0 ;
|
||||||
if( convertClipboard )
|
if( convertClipboard )
|
||||||
|
@@ -438,37 +438,8 @@ void wxControl::MacSuperChangedPosition()
|
|||||||
|
|
||||||
void wxControl::MacSuperEnabled( bool enabled )
|
void wxControl::MacSuperEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
|
Refresh(FALSE) ;
|
||||||
wxWindow::MacSuperEnabled( enabled ) ;
|
wxWindow::MacSuperEnabled( enabled ) ;
|
||||||
/*
|
|
||||||
if ( m_macControl )
|
|
||||||
{
|
|
||||||
if ( UMAHasAppearance() )
|
|
||||||
{
|
|
||||||
if ( !enabled )
|
|
||||||
{
|
|
||||||
::DeactivateControl( m_macControl ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( m_macEnabled )
|
|
||||||
::ActivateControl( m_macControl ) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( !enabled )
|
|
||||||
{
|
|
||||||
::HiliteControl( m_macControl , 255 ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( m_macEnabled )
|
|
||||||
::HiliteControl( m_macControl , 0 ) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wxWindow::MacSuperEnabled( enabled ) ;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxControl::MacSuperShown( bool show )
|
void wxControl::MacSuperShown( bool show )
|
||||||
|
@@ -56,6 +56,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
|
|||||||
wxRect rect;
|
wxRect rect;
|
||||||
GetFieldRect(i, rect);
|
GetFieldRect(i, rect);
|
||||||
|
|
||||||
|
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
|
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||||
|
}
|
||||||
|
|
||||||
wxString text(GetStatusText(i));
|
wxString text(GetStatusText(i));
|
||||||
|
|
||||||
long x, y;
|
long x, y;
|
||||||
@@ -101,6 +106,9 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
|
|||||||
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
|
if ( IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
||||||
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
||||||
|
|
||||||
@@ -110,7 +118,13 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetPen(white);
|
dc.SetPen(white);
|
||||||
dc.DrawLine(0, 1 ,
|
dc.DrawLine(0, 1 ,
|
||||||
m_width , 1);
|
m_width , 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID));
|
||||||
|
dc.DrawLine(0, 0 ,
|
||||||
|
m_width , 0);
|
||||||
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
if ( GetFont().Ok() )
|
if ( GetFont().Ok() )
|
||||||
@@ -124,3 +138,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetFont(wxNullFont);
|
dc.SetFont(wxNullFont);
|
||||||
# endif // MSW
|
# endif // MSW
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStatusBarMac::MacSuperEnabled( bool enabled )
|
||||||
|
{
|
||||||
|
Refresh(FALSE) ;
|
||||||
|
wxWindow::MacSuperEnabled( enabled ) ;
|
||||||
|
}
|
@@ -128,6 +128,10 @@ void wxStaticText::OnDraw( wxDC &dc )
|
|||||||
if (m_width <= 0 || m_height <= 0)
|
if (m_width <= 0 || m_height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
|
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||||
|
}
|
||||||
wxString paragraph;
|
wxString paragraph;
|
||||||
int i = 0 ;
|
int i = 0 ;
|
||||||
wxString text = m_label;
|
wxString text = m_label;
|
||||||
|
@@ -500,9 +500,7 @@ void wxTopLevelWindowMac::MacActivate( EventRecord *ev , bool inIsActivating )
|
|||||||
|
|
||||||
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
||||||
|
|
||||||
Refresh( FALSE ) ;
|
MacSuperEnabled( inIsActivating ) ;
|
||||||
// MacSuperEnabled( inIsActivating ) ;
|
|
||||||
// MacUpdateImmediately() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
||||||
|
@@ -720,6 +720,12 @@ void wxWindowMac::MacSuperShown( bool show )
|
|||||||
|
|
||||||
void wxWindowMac::MacSuperEnabled( bool enabled )
|
void wxWindowMac::MacSuperEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
|
if ( !IsTopLevel() )
|
||||||
|
{
|
||||||
|
// to be absolutely correct we'd have to invalidate (with eraseBkground
|
||||||
|
// because unter MacOSX the frames are drawn with an addXXX mode)
|
||||||
|
// the borders area
|
||||||
|
}
|
||||||
wxNode *node = GetChildren().First();
|
wxNode *node = GetChildren().First();
|
||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
|
@@ -438,37 +438,8 @@ void wxControl::MacSuperChangedPosition()
|
|||||||
|
|
||||||
void wxControl::MacSuperEnabled( bool enabled )
|
void wxControl::MacSuperEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
|
Refresh(FALSE) ;
|
||||||
wxWindow::MacSuperEnabled( enabled ) ;
|
wxWindow::MacSuperEnabled( enabled ) ;
|
||||||
/*
|
|
||||||
if ( m_macControl )
|
|
||||||
{
|
|
||||||
if ( UMAHasAppearance() )
|
|
||||||
{
|
|
||||||
if ( !enabled )
|
|
||||||
{
|
|
||||||
::DeactivateControl( m_macControl ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( m_macEnabled )
|
|
||||||
::ActivateControl( m_macControl ) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( !enabled )
|
|
||||||
{
|
|
||||||
::HiliteControl( m_macControl , 255 ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( m_macEnabled )
|
|
||||||
::HiliteControl( m_macControl , 0 ) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wxWindow::MacSuperEnabled( enabled ) ;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxControl::MacSuperShown( bool show )
|
void wxControl::MacSuperShown( bool show )
|
||||||
|
@@ -56,6 +56,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
|
|||||||
wxRect rect;
|
wxRect rect;
|
||||||
GetFieldRect(i, rect);
|
GetFieldRect(i, rect);
|
||||||
|
|
||||||
|
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
|
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||||
|
}
|
||||||
|
|
||||||
wxString text(GetStatusText(i));
|
wxString text(GetStatusText(i));
|
||||||
|
|
||||||
long x, y;
|
long x, y;
|
||||||
@@ -101,6 +106,9 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
|
|||||||
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
|
if ( IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
||||||
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
||||||
|
|
||||||
@@ -110,7 +118,13 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetPen(white);
|
dc.SetPen(white);
|
||||||
dc.DrawLine(0, 1 ,
|
dc.DrawLine(0, 1 ,
|
||||||
m_width , 1);
|
m_width , 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID));
|
||||||
|
dc.DrawLine(0, 0 ,
|
||||||
|
m_width , 0);
|
||||||
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
if ( GetFont().Ok() )
|
if ( GetFont().Ok() )
|
||||||
@@ -124,3 +138,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
dc.SetFont(wxNullFont);
|
dc.SetFont(wxNullFont);
|
||||||
# endif // MSW
|
# endif // MSW
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStatusBarMac::MacSuperEnabled( bool enabled )
|
||||||
|
{
|
||||||
|
Refresh(FALSE) ;
|
||||||
|
wxWindow::MacSuperEnabled( enabled ) ;
|
||||||
|
}
|
@@ -128,6 +128,10 @@ void wxStaticText::OnDraw( wxDC &dc )
|
|||||||
if (m_width <= 0 || m_height <= 0)
|
if (m_width <= 0 || m_height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||||
|
{
|
||||||
|
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||||
|
}
|
||||||
wxString paragraph;
|
wxString paragraph;
|
||||||
int i = 0 ;
|
int i = 0 ;
|
||||||
wxString text = m_label;
|
wxString text = m_label;
|
||||||
|
@@ -500,9 +500,7 @@ void wxTopLevelWindowMac::MacActivate( EventRecord *ev , bool inIsActivating )
|
|||||||
|
|
||||||
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
||||||
|
|
||||||
Refresh( FALSE ) ;
|
MacSuperEnabled( inIsActivating ) ;
|
||||||
// MacSuperEnabled( inIsActivating ) ;
|
|
||||||
// MacUpdateImmediately() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
||||||
|
@@ -720,6 +720,12 @@ void wxWindowMac::MacSuperShown( bool show )
|
|||||||
|
|
||||||
void wxWindowMac::MacSuperEnabled( bool enabled )
|
void wxWindowMac::MacSuperEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
|
if ( !IsTopLevel() )
|
||||||
|
{
|
||||||
|
// to be absolutely correct we'd have to invalidate (with eraseBkground
|
||||||
|
// because unter MacOSX the frames are drawn with an addXXX mode)
|
||||||
|
// the borders area
|
||||||
|
}
|
||||||
wxNode *node = GetChildren().First();
|
wxNode *node = GetChildren().First();
|
||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user