Added wxTLW::SetShape and implementations for wxGTK, wxMSW and an
empty stub for wxMac. Added some generic helpers and a new ctor to wxRegion. Added samples/shaped. (Backport to 2.4 from 2.5) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -517,10 +517,10 @@ def EVT_SASH_DRAGGED_RANGE(win, id1, id2, func):
|
||||
win.Connect(id1, id2, wxEVT_SASH_DRAGGED, func)
|
||||
|
||||
def EVT_QUERY_LAYOUT_INFO(win, func):
|
||||
win.Connect(-1, -1, wxEVT_EVT_QUERY_LAYOUT_INFO, func)
|
||||
win.Connect(-1, -1, wxEVT_QUERY_LAYOUT_INFO, func)
|
||||
|
||||
def EVT_CALCULATE_LAYOUT(win, func):
|
||||
win.Connect(-1, -1, wxEVT_EVT_CALCULATE_LAYOUT, func)
|
||||
win.Connect(-1, -1, wxEVT_CALCULATE_LAYOUT, func)
|
||||
|
||||
|
||||
#wxSplitterWindow
|
||||
@@ -730,7 +730,7 @@ def wxCallAfter(callable, *args, **kw):
|
||||
|
||||
global _wxCallAfterId
|
||||
if _wxCallAfterId is None:
|
||||
_wxCallAfterId = wxNewId()
|
||||
_wxCallAfterId = wxNewEventType()
|
||||
app.Connect(-1, -1, _wxCallAfterId,
|
||||
lambda event: apply(event.callable, event.args, event.kw) )
|
||||
evt = wxPyEvent()
|
||||
|
@@ -116,6 +116,12 @@ public:
|
||||
|
||||
virtual void SetTitle(const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
// Set the shape of the window to the given region.
|
||||
// Returns TRUE if the platform supports this feature (and the operation
|
||||
// is successful.)
|
||||
virtual bool SetShape(const wxRegion& region);
|
||||
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@@ -1043,8 +1043,12 @@ public:
|
||||
#ifndef __WXMAC__
|
||||
%name(wxRegionFromPoints)wxRegion(int PCOUNT, wxPoint* points, int fillStyle = wxWINDING_RULE);
|
||||
#endif
|
||||
%name(wxRegionFromBitmap)wxRegion(const wxBitmap& bmp,
|
||||
const wxColour& transColour = wxNullColour,
|
||||
int tolerance = 0);
|
||||
~wxRegion();
|
||||
|
||||
|
||||
void Clear();
|
||||
#ifndef __WXMAC__
|
||||
bool Offset(wxCoord x, wxCoord y);
|
||||
@@ -1074,6 +1078,18 @@ public:
|
||||
bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
%name(XorRect)bool Xor(const wxRect& rect);
|
||||
%name(XorRegion)bool Xor(const wxRegion& region);
|
||||
|
||||
// Convert the region to a B&W bitmap with the black pixels being inside
|
||||
// the region.
|
||||
wxBitmap ConvertToBitmap();
|
||||
|
||||
// Use the non-transparent pixels of a wxBitmap for the region to combine
|
||||
// with this region. If the bitmap has a mask then it will be used,
|
||||
// otherwise the colour to be treated as transparent may be specified,
|
||||
// along with an optional tolerance value.
|
||||
%name(UnionBitmap)bool Union(const wxBitmap& bmp,
|
||||
const wxColour& transColour = wxNullColour,
|
||||
int tolerance = 0);
|
||||
};
|
||||
|
||||
|
||||
@@ -1103,6 +1119,7 @@ public:
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
%readonly
|
||||
%{
|
||||
#if 0
|
||||
|
Reference in New Issue
Block a user