-#include "wx/dc.h"
-#include "wx/dcclient.h"
-#include "wx/utils.h"
-#include "wx/app.h"
-#include "wx/panel.h"
-#include "wx/layout.h"
-#include "wx/dialog.h"
-#include "wx/listbox.h"
-#include "wx/scrolbar.h"
-#include "wx/statbox.h"
-#include "wx/button.h"
-#include "wx/settings.h"
-#include "wx/msgdlg.h"
-#include "wx/frame.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+ #include "wx/app.h"
+ #include "wx/utils.h"
+ #include "wx/panel.h"
+ #include "wx/frame.h"
+ #include "wx/dc.h"
+ #include "wx/dcclient.h"
+ #include "wx/button.h"
+ #include "wx/menu.h"
+ #include "wx/dialog.h"
+ #include "wx/settings.h"
+ #include "wx/msgdlg.h"
+ #include "wx/scrolbar.h"
+ #include "wx/statbox.h"
+ #include "wx/listbox.h"
+ #include "wx/layout.h"
+ #include "wx/statusbr.h"
+ #include "wx/menuitem.h"
+#endif
+
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
#endif // __WXUNIVERSAL__/__WXMAC__
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
#endif // __WXUNIVERSAL__/__WXMAC__
BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
EVT_NC_PAINT(wxWindowMac::OnNcPaint)
EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
EVT_NC_PAINT(wxWindowMac::OnNcPaint)
EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
#define wxMAC_DEBUG_REDRAW 0
#ifndef wxMAC_DEBUG_REDRAW
#define wxMAC_DEBUG_REDRAW 0
#define wxMAC_DEBUG_REDRAW 0
#ifndef wxMAC_DEBUG_REDRAW
#define wxMAC_DEBUG_REDRAW 0
#endif // wxUSE_STATBOX
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
#endif // wxUSE_STATBOX
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ;
if ( control && control->GetMacControl() )
{
UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNextPart ) ;
}
wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ;
if ( control && control->GetMacControl() )
{
UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNextPart ) ;
}
wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event) ;
wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event) ;
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
- RgnHandle innerOldRgn, innerNewRgn ;
- innerOldRgn = NewRgn() ;
- innerNewRgn = NewRgn() ;
-
- SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
- oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
- DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
- InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
-
- SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
- newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
- DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
- InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
-
- DisposeRgn( innerOldRgn ) ;
- DisposeRgn( innerNewRgn ) ;
+ RgnHandle innerOldRgn, innerNewRgn ;
+ innerOldRgn = NewRgn() ;
+ innerNewRgn = NewRgn() ;
+
+ SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
+ oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
+ DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
+ InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
+
+ SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
+ newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
+ DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
+ InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
+
+ DisposeRgn( innerOldRgn ) ;
+ DisposeRgn( innerNewRgn ) ;
int major,minor;
wxGetOsVersion( &major, &minor );
RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
int major,minor;
wxGetOsVersion( &major, &minor );
RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ;
RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ;
// OS X has lighter border edges than classic:
RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ;
RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ;
// OS X has lighter border edges than classic:
- if (major >= 10)
- {
- darkShadow.red = 0x8E8E;
- darkShadow.green = 0x8E8E;
- darkShadow.blue = 0x8E8E;
- lightShadow.red = 0xBDBD;
- lightShadow.green = 0xBDBD;
- lightShadow.blue = 0xBDBD;
- }
-
+ if (major >= 10)
+ {
+ darkShadow.red = 0x8E8E;
+ darkShadow.green = 0x8E8E;
+ darkShadow.blue = 0x8E8E;
+ lightShadow.red = 0xBDBD;
+ lightShadow.green = 0xBDBD;
+ lightShadow.blue = 0xBDBD;
+ }
+
SectRect( &scrollrect , &r , &scrollrect ) ;
}
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
SectRect( &scrollrect , &r , &scrollrect ) ;
}
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
// in order not to loose updates
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
RgnHandle formerUpdateRgn = NewRgn() ;
// in order not to loose updates
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
RgnHandle formerUpdateRgn = NewRgn() ;
- wevent.m_eventObject = this;
-
- if (event.m_eventType == wxEVT_SCROLL_TOP)
- wevent.m_eventType = wxEVT_SCROLLWIN_TOP;
- else if (event.m_eventType == wxEVT_SCROLL_BOTTOM)
- wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM;
- else if (event.m_eventType == wxEVT_SCROLL_LINEUP)
- wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP;
- else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN)
- wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN;
- else if (event.m_eventType == wxEVT_SCROLL_PAGEUP)
- wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP;
- else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN)
- wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
- else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK)
- wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
- else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE)
- wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE;
+ wevent.SetEventObject(this);
+
+ if (event.GetEventType() == wxEVT_SCROLL_TOP)
+ wevent.SetEventType( wxEVT_SCROLLWIN_TOP );
+ else if (event.GetEventType() == wxEVT_SCROLL_BOTTOM)
+ wevent.SetEventType( wxEVT_SCROLLWIN_BOTTOM );
+ else if (event.GetEventType() == wxEVT_SCROLL_LINEUP)
+ wevent.SetEventType( wxEVT_SCROLLWIN_LINEUP );
+ else if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN)
+ wevent.SetEventType( wxEVT_SCROLLWIN_LINEDOWN );
+ else if (event.GetEventType() == wxEVT_SCROLL_PAGEUP)
+ wevent.SetEventType( wxEVT_SCROLLWIN_PAGEUP );
+ else if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
+ wevent.SetEventType( wxEVT_SCROLLWIN_PAGEDOWN );
+ else if (event.GetEventType() == wxEVT_SCROLL_THUMBTRACK)
+ wevent.SetEventType( wxEVT_SCROLLWIN_THUMBTRACK );
+ else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE)
+ wevent.SetEventType( wxEVT_SCROLLWIN_THUMBRELEASE );
int top = 0 , left = 0 ;
MacWindowToRootWindow( &left , &top ) ;
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
int top = 0 , left = 0 ;
MacWindowToRootWindow( &left , &top ) ;
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
// getting the update region in macos local coordinates
GetWindowUpdateRgn( rootWindow , updateRgn ) ;
GrafPtr port ;
// getting the update region in macos local coordinates
GetWindowUpdateRgn( rootWindow , updateRgn ) ;
GrafPtr port ;
SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
}
SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
}
{
SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ;
hiddenWindows.Append( child ) ;
}
}
{
SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ;
hiddenWindows.Append( child ) ;
}
}
for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext())
{
wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ;
for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext())
{
wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ;
SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
SectRgn( childupdate , updatergn , childupdate ) ;
OffsetRgn( childupdate , -child->m_x , -child->m_y ) ;
SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
SectRgn( childupdate , updatergn , childupdate ) ;
OffsetRgn( childupdate , -child->m_x , -child->m_y ) ;
{
// because dialogs may also be children
child->MacRedraw( childupdate , time , erase ) ;
{
// because dialogs may also be children
child->MacRedraw( childupdate , time , erase ) ;