]> git.saurik.com Git - wxWidgets.git/commitdiff
Popup Window now supported in OS/2 (for tipwindows and such associated with toolbars).
authorDavid Webster <Dave.Webster@bhmi.com>
Mon, 13 May 2002 18:11:52 +0000 (18:11 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Mon, 13 May 2002 18:11:52 +0000 (18:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/popupwin.cpp [new file with mode: 0644]

diff --git a/src/os2/popupwin.cpp b/src/os2/popupwin.cpp
new file mode 100644 (file)
index 0000000..adc25e8
--- /dev/null
@@ -0,0 +1,76 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        os2/popupwin.cpp
+// Purpose:     implements wxPopupWindow for OS2
+// Author:      Dave Webster
+// Modified by:
+// Created:     13.05.02
+// RCS-ID:      $Id$
+// Copyright:   (c) 2002 Dave Webster <dwebster@bhmi.com>
+// License:     wxWindows license
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+    #pragma implementation "popup.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+
+#ifndef WX_PRECOMP
+#endif //WX_PRECOMP
+
+#include "wx/popupwin.h"
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+bool wxPopupWindow::Create(
+  wxWindow*                         pParent
+, int                               nFlags
+)
+{
+    return wxPopupWindowBase::Create(pParent) &&
+                    wxWindow::Create( pParent
+                                     ,-1
+                                     ,wxDefaultPosition
+                                     ,wxDefaultSize
+                                     ,nFlags | wxPOPUP_WINDOW
+                                    );
+} // end of wxPopupWindow::Create
+
+void wxPopupWindow::DoGetPosition(
+  int*                              pnX
+, int*                              pnY
+) const
+{
+    //
+    // The position of a "top level" window such as this should be in
+    // screen coordinates, not in the client ones which MSW gives us
+    // (because we are a child window)
+    //
+    wxPopupWindowBase::DoGetPosition(pnX, pnY);
+    GetParent()->ClientToScreen(pnX, pnY);
+} // end of wxPopupWindow::DoGetPosition
+
+WXDWORD wxPopupWindow::OS2GetStyle(
+  long                              lFlags
+, WXDWORD*                          dwExstyle
+) const
+{
+    WXDWORD                         dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
+                                                                    ,dwExstyle
+                                                                   );
+
+    return dwStyle;
+} // end of wxPopupWindow::OS2GetStyle
+