correcting alpha and removing window shadow for overlay
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -75,6 +75,7 @@ public:
|
|||||||
// --------------------------
|
// --------------------------
|
||||||
|
|
||||||
virtual bool DoSetShape(const wxRegion& region);
|
virtual bool DoSetShape(const wxRegion& region);
|
||||||
|
const wxRegion& GetShape() const { return m_shape; }
|
||||||
|
|
||||||
// activation hooks only necessary for MDI Implementation
|
// activation hooks only necessary for MDI Implementation
|
||||||
static void MacDelayedDeactivation(long timestamp);
|
static void MacDelayedDeactivation(long timestamp);
|
||||||
@@ -126,7 +127,9 @@ protected:
|
|||||||
// wxWindowMac* m_macFocus ;
|
// wxWindowMac* m_macFocus ;
|
||||||
|
|
||||||
static wxNonOwnedWindow *s_macDeactivateWindow;
|
static wxNonOwnedWindow *s_macDeactivateWindow;
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
wxRegion m_shape;
|
||||||
};
|
};
|
||||||
|
|
||||||
// list of all frames and modeless dialogs
|
// list of all frames and modeless dialogs
|
||||||
|
@@ -485,6 +485,12 @@ long style, long extraStyle, const wxString& WXUNUSED(name) )
|
|||||||
[m_macWindow setDelegate:controller];
|
[m_macWindow setDelegate:controller];
|
||||||
|
|
||||||
[m_macWindow setAcceptsMouseMovedEvents: YES];
|
[m_macWindow setAcceptsMouseMovedEvents: YES];
|
||||||
|
|
||||||
|
if ( ( style & wxFRAME_SHAPED) )
|
||||||
|
{
|
||||||
|
[m_macWindow setOpaque:NO];
|
||||||
|
[m_macWindow setAlphaValue:1.0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1092,15 +1092,23 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
|
|||||||
[slf getRectsBeingDrawn:&rects count:&count];
|
[slf getRectsBeingDrawn:&rects count:&count];
|
||||||
for ( int i = 0 ; i < count ; ++i )
|
for ( int i = 0 ; i < count ; ++i )
|
||||||
{
|
{
|
||||||
updateRgn.Union(wxFromNSRect(slf, rects[i]) );
|
updateRgn.Union(wxFromNSRect(slf, rects[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow* wxpeer = GetWXPeer();
|
wxWindow* wxpeer = GetWXPeer();
|
||||||
|
if ( wxpeer->MacGetTopLevelWindow()->GetWindowStyle() & wxFRAME_SHAPED )
|
||||||
|
{
|
||||||
|
int xoffset = 0, yoffset = 0;
|
||||||
|
wxRegion rgn = wxpeer->MacGetTopLevelWindow()->GetShape();
|
||||||
|
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
|
||||||
|
rgn.Offset( xoffset, yoffset );
|
||||||
|
updateRgn.Intersect(rgn);
|
||||||
|
}
|
||||||
|
|
||||||
wxpeer->GetUpdateRegion() = updateRgn;
|
wxpeer->GetUpdateRegion() = updateRgn;
|
||||||
wxpeer->MacSetCGContextRef( context );
|
wxpeer->MacSetCGContextRef( context );
|
||||||
|
|
||||||
bool handled = wxpeer->MacDoRedraw( 0 );
|
bool handled = wxpeer->MacDoRedraw( 0 );
|
||||||
|
|
||||||
CGContextRestoreGState( context );
|
CGContextRestoreGState( context );
|
||||||
|
|
||||||
CGContextSaveGState( context );
|
CGContextSaveGState( context );
|
||||||
@@ -2077,6 +2085,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
|
|||||||
{
|
{
|
||||||
NSWindow* tlw = now->GetWXWindow();
|
NSWindow* tlw = now->GetWXWindow();
|
||||||
wxNSView* v = [[wxNSView alloc] initWithFrame:[[tlw contentView] frame]];
|
wxNSView* v = [[wxNSView alloc] initWithFrame:[[tlw contentView] frame]];
|
||||||
|
|
||||||
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( now, v, true );
|
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( now, v, true );
|
||||||
c->InstallEventHandler();
|
c->InstallEventHandler();
|
||||||
[tlw setContentView:v];
|
[tlw setContentView:v];
|
||||||
|
@@ -453,6 +453,8 @@ bool wxNonOwnedWindow::DoSetShape(const wxRegion& region)
|
|||||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
|
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
|
||||||
wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
||||||
|
|
||||||
|
m_shape = region;
|
||||||
|
|
||||||
// The empty region signifies that the shape
|
// The empty region signifies that the shape
|
||||||
// should be removed from the window.
|
// should be removed from the window.
|
||||||
if ( region.IsEmpty() )
|
if ( region.IsEmpty() )
|
||||||
|
Reference in New Issue
Block a user