corrected redraw problems in controls (the erroneusly revalidated their draw area thus eating other pending redraws

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-05-10 06:28:28 +00:00
parent d493b66a90
commit e7b596fbff
4 changed files with 58 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ short nextMenuId = 100 ; // wxMenu takes the lower ids
wxChoice::~wxChoice() wxChoice::~wxChoice()
{ {
// DeleteMenu( m_macPopUpMenuId ) ; // DeleteMenu( m_macPopUpMenuId ) ;
DisposeMenu( m_macPopUpMenuHandle ) ; // DisposeMenu( m_macPopUpMenuHandle ) ;
} }
bool wxChoice::Create(wxWindow *parent, wxWindowID id, bool wxChoice::Create(wxWindow *parent, wxWindowID id,

View File

@@ -11,6 +11,10 @@
// init // init
#if !TARGET_CARBON
#define GetControlOwner( control ) (**control).contrlOwner
#endif
static bool sUMAHasAppearance = false ; static bool sUMAHasAppearance = false ;
static long sUMAAppearanceVersion = 0 ; static long sUMAAppearanceVersion = 0 ;
extern int gAGABackgroundColor ; extern int gAGABackgroundColor ;
@@ -453,6 +457,8 @@ void UMACloseWindow(WindowRef inWindowRef)
void UMAActivateControl( ControlHandle inControl ) void UMAActivateControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -468,10 +474,13 @@ void UMAActivateControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMADrawControl( ControlHandle inControl ) void UMADrawControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -487,10 +496,13 @@ void UMADrawControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMAMoveControl( ControlHandle inControl , short x , short y ) void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -506,10 +518,13 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMASizeControl( ControlHandle inControl , short x , short y ) void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -525,10 +540,13 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMADeactivateControl( ControlHandle inControl ) void UMADeactivateControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -544,6 +562,7 @@ void UMADeactivateControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMASetThemeWindowBackground (WindowRef inWindow, void UMASetThemeWindowBackground (WindowRef inWindow,
@@ -640,6 +659,8 @@ void UMADisposeControl (ControlHandle theControl)
void UMAHiliteControl (ControlHandle theControl, void UMAHiliteControl (ControlHandle theControl,
ControlPartCode hiliteState) ControlPartCode hiliteState)
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::HiliteControl( theControl , hiliteState ) ; ::HiliteControl( theControl , hiliteState ) ;
@@ -648,11 +669,14 @@ void UMAHiliteControl (ControlHandle theControl,
{ {
::HiliteControl( theControl , hiliteState ) ; ::HiliteControl( theControl , hiliteState ) ;
} }
InvalRgn( updateRgn ) ;
} }
void UMAShowControl (ControlHandle theControl) void UMAShowControl (ControlHandle theControl)
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::ShowControl( theControl ) ; ::ShowControl( theControl ) ;
@@ -661,6 +685,7 @@ void UMAShowControl (ControlHandle theControl)
{ {
::ShowControl( theControl ) ; ::ShowControl( theControl ) ;
} }
InvalRgn( updateRgn ) ;
} }
@@ -913,6 +938,8 @@ void UMAIdleControls (WindowPtr inWindow)
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( inWindow , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -928,6 +955,7 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )

View File

@@ -27,7 +27,7 @@ short nextMenuId = 100 ; // wxMenu takes the lower ids
wxChoice::~wxChoice() wxChoice::~wxChoice()
{ {
// DeleteMenu( m_macPopUpMenuId ) ; // DeleteMenu( m_macPopUpMenuId ) ;
DisposeMenu( m_macPopUpMenuHandle ) ; // DisposeMenu( m_macPopUpMenuHandle ) ;
} }
bool wxChoice::Create(wxWindow *parent, wxWindowID id, bool wxChoice::Create(wxWindow *parent, wxWindowID id,

View File

@@ -11,6 +11,10 @@
// init // init
#if !TARGET_CARBON
#define GetControlOwner( control ) (**control).contrlOwner
#endif
static bool sUMAHasAppearance = false ; static bool sUMAHasAppearance = false ;
static long sUMAAppearanceVersion = 0 ; static long sUMAAppearanceVersion = 0 ;
extern int gAGABackgroundColor ; extern int gAGABackgroundColor ;
@@ -453,6 +457,8 @@ void UMACloseWindow(WindowRef inWindowRef)
void UMAActivateControl( ControlHandle inControl ) void UMAActivateControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -468,10 +474,13 @@ void UMAActivateControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMADrawControl( ControlHandle inControl ) void UMADrawControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -487,10 +496,13 @@ void UMADrawControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMAMoveControl( ControlHandle inControl , short x , short y ) void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -506,10 +518,13 @@ void UMAMoveControl( ControlHandle inControl , short x , short y )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMASizeControl( ControlHandle inControl , short x , short y ) void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -525,10 +540,13 @@ void UMASizeControl( ControlHandle inControl , short x , short y )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMADeactivateControl( ControlHandle inControl ) void UMADeactivateControl( ControlHandle inControl )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -544,6 +562,7 @@ void UMADeactivateControl( ControlHandle inControl )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
void UMASetThemeWindowBackground (WindowRef inWindow, void UMASetThemeWindowBackground (WindowRef inWindow,
@@ -640,6 +659,8 @@ void UMADisposeControl (ControlHandle theControl)
void UMAHiliteControl (ControlHandle theControl, void UMAHiliteControl (ControlHandle theControl,
ControlPartCode hiliteState) ControlPartCode hiliteState)
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::HiliteControl( theControl , hiliteState ) ; ::HiliteControl( theControl , hiliteState ) ;
@@ -648,11 +669,14 @@ void UMAHiliteControl (ControlHandle theControl,
{ {
::HiliteControl( theControl , hiliteState ) ; ::HiliteControl( theControl , hiliteState ) ;
} }
InvalRgn( updateRgn ) ;
} }
void UMAShowControl (ControlHandle theControl) void UMAShowControl (ControlHandle theControl)
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
::ShowControl( theControl ) ; ::ShowControl( theControl ) ;
@@ -661,6 +685,7 @@ void UMAShowControl (ControlHandle theControl)
{ {
::ShowControl( theControl ) ; ::ShowControl( theControl ) ;
} }
InvalRgn( updateRgn ) ;
} }
@@ -913,6 +938,8 @@ void UMAIdleControls (WindowPtr inWindow)
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( inWindow , updateRgn ) ;
#if UMA_USE_APPEARANCE #if UMA_USE_APPEARANCE
if ( UMAHasAppearance() ) if ( UMAHasAppearance() )
{ {
@@ -928,6 +955,7 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{ {
} }
#endif #endif
InvalRgn( updateRgn ) ;
} }
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )