]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: src/osx/popupwin.cpp | |
3 | // Purpose: implements wxPopupWindow for wxMac | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2006 Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // ============================================================================ | |
13 | // declarations | |
14 | // ============================================================================ | |
15 | ||
16 | // CAUTION : This is only experimental stuff right now | |
17 | ||
18 | // ---------------------------------------------------------------------------- | |
19 | // headers | |
20 | // ---------------------------------------------------------------------------- | |
21 | ||
22 | // For compilers that support precompilation, includes "wx.h". | |
23 | #include "wx/wxprec.h" | |
24 | ||
25 | #ifdef __BORLANDC__ | |
26 | #pragma hdrstop | |
27 | #endif | |
28 | ||
29 | #if wxUSE_POPUPWIN | |
30 | ||
31 | #ifndef WX_PRECOMP | |
32 | #endif //WX_PRECOMP | |
33 | ||
34 | #include "wx/popupwin.h" | |
35 | #include "wx/tooltip.h" | |
36 | ||
37 | #include "wx/osx/private.h" | |
38 | ||
39 | // ============================================================================ | |
40 | // implementation | |
41 | // ============================================================================ | |
42 | ||
43 | wxPopupWindow::~wxPopupWindow() | |
44 | { | |
45 | } | |
46 | ||
47 | bool wxPopupWindow::Create(wxWindow *parent, int flags) | |
48 | { | |
49 | // popup windows are created hidden by default | |
50 | Hide(); | |
51 | ||
52 | return wxPopupWindowBase::Create(parent) && | |
53 | wxNonOwnedWindow::Create(parent, wxID_ANY, | |
54 | wxDefaultPosition, wxDefaultSize, | |
55 | flags | wxPOPUP_WINDOW); | |
56 | ||
57 | } | |
58 | ||
59 | bool wxPopupWindow::Show(bool show) | |
60 | { | |
61 | if ( !wxWindow::Show(show) ) | |
62 | return false; | |
63 | ||
64 | if ( m_nowpeer && show) | |
65 | m_nowpeer->ShowWithoutActivating(); | |
66 | else if ( m_nowpeer ) | |
67 | m_nowpeer->Show(false); | |
68 | ||
69 | if ( show ) | |
70 | { | |
71 | // because apps expect a size event to occur at this moment | |
72 | wxSizeEvent event(GetSize() , m_windowId); | |
73 | event.SetEventObject(this); | |
74 | HandleWindowEvent(event); | |
75 | } | |
76 | ||
77 | return true; | |
78 | } | |
79 | ||
80 | #endif // #if wxUSE_POPUPWIN |