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 DrawField(wxDC& dc, int i);
|
||||
virtual void SetStatusText(const wxString& text, int number = 0) ;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
virtual void MacSuperEnabled( bool enable ) ;
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
protected:
|
||||
|
||||
|
@@ -976,11 +976,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
|
||||
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() ;
|
||||
if ( window )
|
||||
window->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||
wxNode* node = wxTopLevelWindows.First();
|
||||
while (node)
|
||||
{
|
||||
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
|
||||
win->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
s_lastMouseDown = 0 ;
|
||||
if( convertClipboard )
|
||||
|
@@ -976,11 +976,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
|
||||
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() ;
|
||||
if ( window )
|
||||
window->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||
wxNode* node = wxTopLevelWindows.First();
|
||||
while (node)
|
||||
{
|
||||
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
|
||||
win->MacActivate( MacGetCurrentEvent() , false ) ;
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
s_lastMouseDown = 0 ;
|
||||
if( convertClipboard )
|
||||
|
@@ -438,37 +438,8 @@ void wxControl::MacSuperChangedPosition()
|
||||
|
||||
void wxControl::MacSuperEnabled( bool enabled )
|
||||
{
|
||||
Refresh(FALSE) ;
|
||||
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 )
|
||||
|
@@ -56,6 +56,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
|
||||
wxRect rect;
|
||||
GetFieldRect(i, rect);
|
||||
|
||||
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||
}
|
||||
|
||||
wxString text(GetStatusText(i));
|
||||
|
||||
long x, y;
|
||||
@@ -101,6 +106,9 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
|
||||
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
if ( IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
||||
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
||||
|
||||
@@ -110,7 +118,13 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
dc.SetPen(white);
|
||||
dc.DrawLine(0, 1 ,
|
||||
m_width , 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID));
|
||||
dc.DrawLine(0, 0 ,
|
||||
m_width , 0);
|
||||
}
|
||||
|
||||
int i;
|
||||
if ( GetFont().Ok() )
|
||||
@@ -124,3 +138,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
dc.SetFont(wxNullFont);
|
||||
# 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)
|
||||
return;
|
||||
|
||||
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||
}
|
||||
wxString paragraph;
|
||||
int i = 0 ;
|
||||
wxString text = m_label;
|
||||
|
@@ -500,9 +500,7 @@ void wxTopLevelWindowMac::MacActivate( EventRecord *ev , bool inIsActivating )
|
||||
|
||||
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
||||
|
||||
Refresh( FALSE ) ;
|
||||
// MacSuperEnabled( inIsActivating ) ;
|
||||
// MacUpdateImmediately() ;
|
||||
MacSuperEnabled( inIsActivating ) ;
|
||||
}
|
||||
|
||||
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
||||
|
@@ -720,6 +720,12 @@ void wxWindowMac::MacSuperShown( bool show )
|
||||
|
||||
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();
|
||||
while ( node )
|
||||
{
|
||||
|
@@ -438,37 +438,8 @@ void wxControl::MacSuperChangedPosition()
|
||||
|
||||
void wxControl::MacSuperEnabled( bool enabled )
|
||||
{
|
||||
Refresh(FALSE) ;
|
||||
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 )
|
||||
|
@@ -56,6 +56,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
|
||||
wxRect rect;
|
||||
GetFieldRect(i, rect);
|
||||
|
||||
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||
}
|
||||
|
||||
wxString text(GetStatusText(i));
|
||||
|
||||
long x, y;
|
||||
@@ -101,6 +106,9 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
|
||||
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
if ( IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
wxPen black( wxBLACK , 1 , wxSOLID ) ;
|
||||
wxPen white( wxWHITE , 1 , wxSOLID ) ;
|
||||
|
||||
@@ -110,7 +118,13 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
dc.SetPen(white);
|
||||
dc.DrawLine(0, 1 ,
|
||||
m_width , 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID));
|
||||
dc.DrawLine(0, 0 ,
|
||||
m_width , 0);
|
||||
}
|
||||
|
||||
int i;
|
||||
if ( GetFont().Ok() )
|
||||
@@ -124,3 +138,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
dc.SetFont(wxNullFont);
|
||||
# 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)
|
||||
return;
|
||||
|
||||
if ( !IsWindowHilited( MacGetRootWindow() ) )
|
||||
{
|
||||
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
|
||||
}
|
||||
wxString paragraph;
|
||||
int i = 0 ;
|
||||
wxString text = m_label;
|
||||
|
@@ -500,9 +500,7 @@ void wxTopLevelWindowMac::MacActivate( EventRecord *ev , bool inIsActivating )
|
||||
|
||||
UMAHighlightAndActivateWindow( m_macWindow , inIsActivating ) ;
|
||||
|
||||
Refresh( FALSE ) ;
|
||||
// MacSuperEnabled( inIsActivating ) ;
|
||||
// MacUpdateImmediately() ;
|
||||
MacSuperEnabled( inIsActivating ) ;
|
||||
}
|
||||
|
||||
void wxTopLevelWindowMac::MacKeyDown( EventRecord *ev )
|
||||
|
@@ -720,6 +720,12 @@ void wxWindowMac::MacSuperShown( bool show )
|
||||
|
||||
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();
|
||||
while ( node )
|
||||
{
|
||||
|
Reference in New Issue
Block a user