]>
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
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
13 Styles that can be used with any wxNonOwnedWindow:
15 #define wxFRAME_SHAPED 0x0010 // Create a window that is able to be shaped
19 Common base class for all non-child windows.
21 This is the common base class of wxTopLevelWindow and wxPopupWindow and is
24 Currently the only additional functionality it provides, compared to base
25 wxWindow class, is the ability to set the window shape.
29 class wxNonOwnedWindow
: public wxWindow
33 If the platform supports it, sets the shape of the window to that
34 depicted by @a region. The system will not display or respond to any
35 mouse event for the pixels that lie outside of the region. To reset the
36 window to the normal rectangular shape simply call SetShape() again with
37 an empty wxRegion. Returns @true if the operation is successful.
39 This method is available in this class only since wxWidgets 2.9.3,
40 previous versions only provided it in wxTopLevelWindow.
42 bool SetShape(const wxRegion
& region
);
45 Set the window shape to the given path.
47 Set the window shape to the interior of the given path and also draw
48 the window border along the specified path.
50 For example, to make a clock-like circular window you could use
52 wxSize size = GetSize();
54 path = wxGraphicsRenderer::GetDefaultRenderer()->CreatePath();
55 path.AddCircle(size.x/2, size.y/2, 30);
59 As the overload above, this method is not guaranteed to work on all
60 platforms but currently does work in wxMSW, wxOSX/Cocoa and wxGTK (with
61 the appropriate but almost always present X11 extensions) ports.
65 bool SetShape(const wxGraphicsPath
& path
);