]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/nonownedwnd.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: interface/wx/nonownedwnd.h
3 // Purpose: wxNonOwnedWindow class documentation
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
12 Styles that can be used with any wxNonOwnedWindow:
14 #define wxFRAME_SHAPED 0x0010 // Create a window that is able to be shaped
18 Common base class for all non-child windows.
20 This is the common base class of wxTopLevelWindow and wxPopupWindow and is
23 Currently the only additional functionality it provides, compared to base
24 wxWindow class, is the ability to set the window shape.
28 class wxNonOwnedWindow
: public wxWindow
32 If the platform supports it, sets the shape of the window to that
33 depicted by @a region. The system will not display or respond to any
34 mouse event for the pixels that lie outside of the region. To reset the
35 window to the normal rectangular shape simply call SetShape() again with
36 an empty wxRegion. Returns @true if the operation is successful.
38 This method is available in this class only since wxWidgets 2.9.3,
39 previous versions only provided it in wxTopLevelWindow.
41 bool SetShape(const wxRegion
& region
);
44 Set the window shape to the given path.
46 Set the window shape to the interior of the given path and also draw
47 the window border along the specified path.
49 For example, to make a clock-like circular window you could use
51 wxSize size = GetSize();
53 path = wxGraphicsRenderer::GetDefaultRenderer()->CreatePath();
54 path.AddCircle(size.x/2, size.y/2, 30);
58 As the overload above, this method is not guaranteed to work on all
59 platforms but currently does work in wxMSW, wxOSX/Cocoa and wxGTK (with
60 the appropriate but almost always present X11 extensions) ports.
64 bool SetShape(const wxGraphicsPath
& path
);