corrected redraw problems with native controls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-03-04 19:10:47 +00:00
parent 360a4636dd
commit 90b22acaa8
4 changed files with 146 additions and 6 deletions

View File

@@ -25,6 +25,8 @@
#include "wx/button.h" #include "wx/button.h"
#include "wx/panel.h" #include "wx/panel.h"
#include "wx/textctrl.h" #include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/filefn.h" #include "wx/filefn.h"
#include "wx/utils.h" #include "wx/utils.h"
@@ -159,7 +161,41 @@ void wxTextCtrl::SetValue(const wxString& st)
else else
value = st ; value = st ;
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ; UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
UMADrawControl( m_macControl ) ; WindowRef window = GetMacRootWindow() ;
if ( window )
{
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )
{
wxMacDrawingHelper help( win ) ;
// the mac control manager always assumes to have the origin at 0,0
SetOrigin( 0 , 0 ) ;
bool hasTabBehind = false ;
wxWindow* parent = GetParent() ;
while ( parent )
{
if( parent->MacGetWindowData() )
{
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
break ;
}
if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
{
if ( ((wxControl*)parent)->GetMacControl() )
SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
break ;
}
parent = parent->GetParent() ;
}
UMADrawControl( m_macControl ) ;
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
} }
// Clipboard operations // Clipboard operations
@@ -214,7 +250,41 @@ void wxTextCtrl::Paste()
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ; UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
TEFromScrap() ; TEFromScrap() ;
TEPaste( teH ) ; TEPaste( teH ) ;
UMADrawControl( m_macControl ) ; WindowRef window = GetMacRootWindow() ;
if ( window )
{
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )
{
wxMacDrawingHelper help( win ) ;
// the mac control manager always assumes to have the origin at 0,0
SetOrigin( 0 , 0 ) ;
bool hasTabBehind = false ;
wxWindow* parent = GetParent() ;
while ( parent )
{
if( parent->MacGetWindowData() )
{
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
break ;
}
if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
{
if ( ((wxControl*)parent)->GetMacControl() )
SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
break ;
}
parent = parent->GetParent() ;
}
UMADrawControl( m_macControl ) ;
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
} }
} }

View File

@@ -1743,7 +1743,7 @@ void wxWindow::MacMouseMoved( EventRecord *ev , short part)
} }
void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating ) void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating )
{ {
wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating); wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId);
event.m_timeStamp = ev->when ; event.m_timeStamp = ev->when ;
event.SetEventObject(this); event.SetEventObject(this);

View File

@@ -25,6 +25,8 @@
#include "wx/button.h" #include "wx/button.h"
#include "wx/panel.h" #include "wx/panel.h"
#include "wx/textctrl.h" #include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/filefn.h" #include "wx/filefn.h"
#include "wx/utils.h" #include "wx/utils.h"
@@ -159,7 +161,41 @@ void wxTextCtrl::SetValue(const wxString& st)
else else
value = st ; value = st ;
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ; UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
UMADrawControl( m_macControl ) ; WindowRef window = GetMacRootWindow() ;
if ( window )
{
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )
{
wxMacDrawingHelper help( win ) ;
// the mac control manager always assumes to have the origin at 0,0
SetOrigin( 0 , 0 ) ;
bool hasTabBehind = false ;
wxWindow* parent = GetParent() ;
while ( parent )
{
if( parent->MacGetWindowData() )
{
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
break ;
}
if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
{
if ( ((wxControl*)parent)->GetMacControl() )
SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
break ;
}
parent = parent->GetParent() ;
}
UMADrawControl( m_macControl ) ;
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
} }
// Clipboard operations // Clipboard operations
@@ -214,7 +250,41 @@ void wxTextCtrl::Paste()
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ; UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
TEFromScrap() ; TEFromScrap() ;
TEPaste( teH ) ; TEPaste( teH ) ;
UMADrawControl( m_macControl ) ; WindowRef window = GetMacRootWindow() ;
if ( window )
{
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )
{
wxMacDrawingHelper help( win ) ;
// the mac control manager always assumes to have the origin at 0,0
SetOrigin( 0 , 0 ) ;
bool hasTabBehind = false ;
wxWindow* parent = GetParent() ;
while ( parent )
{
if( parent->MacGetWindowData() )
{
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
break ;
}
if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
{
if ( ((wxControl*)parent)->GetMacControl() )
SetUpControlBackground( ((wxControl*)parent)->GetMacControl() , -1 , true ) ;
break ;
}
parent = parent->GetParent() ;
}
UMADrawControl( m_macControl ) ;
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
} }
} }

View File

@@ -1743,7 +1743,7 @@ void wxWindow::MacMouseMoved( EventRecord *ev , short part)
} }
void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating ) void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating )
{ {
wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating); wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId);
event.m_timeStamp = ev->when ; event.m_timeStamp = ev->when ;
event.SetEventObject(this); event.SetEventObject(this);