From f9efbe3a980578e8c83a129d773fb45f9bf02984 Mon Sep 17 00:00:00 2001
From: David Webster <Dave.Webster@bhmi.com>
Date: Fri, 28 Dec 2001 07:00:16 +0000
Subject: [PATCH] Scrolling updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 include/wx/os2/window.h |  9 +++++++
 src/os2/app.cpp         |  2 +-
 src/os2/window.cpp      | 60 +++++++++++++++++++++++++++++++++++++++++
 src/os2/wx23.def        | 16 ++++++-----
 4 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/include/wx/os2/window.h b/include/wx/os2/window.h
index 90027e55c6..75d804f8e0 100644
--- a/include/wx/os2/window.h
+++ b/include/wx/os2/window.h
@@ -398,6 +398,15 @@ public:
                          ,WXHWND hWnd
                         );
 
+    bool IsMouseInWindow(void) const;
+    bool OS2GetCreateWindowCoords( const wxPoint& rPos
+                                  ,const wxSize&  rSize
+                                  ,int&           rnX
+                                  ,int&           rnY
+                                  ,int&           rnWidth
+                                  ,int&           rnHeight
+                                 ) const;
+
     // Window procedure
     virtual MRESULT OS2WindowProc( WXUINT   uMsg
                                   ,WXWPARAM wParam
diff --git a/src/os2/app.cpp b/src/os2/app.cpp
index 96d1531b5f..cdc874ea90 100644
--- a/src/os2/app.cpp
+++ b/src/os2/app.cpp
@@ -332,7 +332,7 @@ bool wxApp::RegisterWindowClasses(
     if (!::WinRegisterClass( vHab
                             ,wxFrameClassName
                             ,wxFrameWndProc
-                            ,CS_SIZEREDRAW | CS_SYNCPAINT  | CS_CLIPCHILDREN
+                            ,CS_SIZEREDRAW | CS_SYNCPAINT
                             ,sizeof(ULONG)
                            ))
     {
diff --git a/src/os2/window.cpp b/src/os2/window.cpp
index 6cf27110d2..b9633091a4 100644
--- a/src/os2/window.cpp
+++ b/src/os2/window.cpp
@@ -1802,6 +1802,26 @@ void wxWindowOS2::GetTextExtent(
     ::WinReleasePS(hPS);
 } // end of wxWindow::GetTextExtent
 
+bool wxWindowOS2::IsMouseInWindow() const
+{
+    //
+    // Get the mouse position
+    POINTL                          vPt;
+
+    ::WinQueryPointerPos(HWND_DESKTOP, &vPt);
+
+    //
+    // Find the window which currently has the cursor and go up the window
+    // chain until we find this window - or exhaust it
+    //
+    HWND                            hWnd = ::WinWindowFromPoint(HWND_DESKTOP, &vPt, TRUE);
+
+    while (hWnd && (hWnd != GetHwnd()))
+        hWnd = ::WinQueryWindow(hWnd, QW_PARENT);
+
+    return hWnd != NULL;
+} // end of wxWindowOS2::IsMouseInWindow
+
 #if wxUSE_CARET && WXWIN_COMPATIBILITY
 // ---------------------------------------------------------------------------
 // Caret manipulation
@@ -2775,6 +2795,46 @@ void wxWindowOS2::OS2DetachWindowMenu()
 #endif // __WXUNIVERSAL__
 } // end of wxWindowOS2::OS2DetachWindowMenu
 
+bool wxWindowOS2::OS2GetCreateWindowCoords(
+  const wxPoint&                    rPos
+, const wxSize&                     rSize
+, int&                              rnX
+, int&                              rnY
+, int&                              rnWidth
+, int&                              rnHeight
+) const
+{
+    bool                            bNonDefault = FALSE;
+
+    if (rPos.x == -1)
+    {
+        //
+        // If set x to CW_USEDEFAULT, y parameter is ignored anyhow so we can
+        // just as well set it to CW_USEDEFAULT as well
+        rnX = rnY = CW_USEDEFAULT;
+    }
+    else
+    {
+        rnX = rPos.x;
+        rnY = rPos.y == -1 ? CW_USEDEFAULT : rPos.y;
+        bNonDefault = TRUE;
+    }
+    if (rSize.x == -1)
+    {
+        //
+        // As abobe, h is not used at all in this case anyhow
+        //
+        rnWidth = rnHeight = CW_USEDEFAULT;
+    }
+    else
+    {
+        rnWidth  = rSize.x;
+        rnHeight = rSize.y == -1 ? CW_USEDEFAULT : rSize.y;
+        bNonDefault = TRUE;
+    }
+    return bNonDefault;
+} // end of wxWindowOS2::OS2GetCreateWindowCoords
+
 bool wxWindowOS2::OS2Create(
   WXHWND                            hParent
 , PSZ                               zClass
diff --git a/src/os2/wx23.def b/src/os2/wx23.def
index c0dd77587d..453575a012 100644
--- a/src/os2/wx23.def
+++ b/src/os2/wx23.def
@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
 CODE LOADONCALL
 
 EXPORTS
-;From library:  H:\Dev\Wx2\WxWindows\lib\wx.lib
+;From library:  F:\DEV\WX2\WXWINDOWS\LIB\WX.lib
   ;From object file:  dummy.cpp
     ;PUBDEFs (Symbols available from object file):
       wxDummyChar
@@ -1733,7 +1733,7 @@ EXPORTS
       wxEVT_NC_LEFT_DCLICK
       wxEVT_INIT_DIALOG
       wxEVT_COMMAND_SET_FOCUS
-  ;From object file:  H:\DEV\WX2\WXWINDOWS\src\common\extended.c
+  ;From object file:  F:\DEV\WX2\WXWINDOWS\src\common\extended.c
     ;PUBDEFs (Symbols available from object file):
       ConvertToIeeeExtended
       ConvertFromIeeeExtended
@@ -2172,8 +2172,6 @@ EXPORTS
       New__10wxFontBaseFRC16wxNativeFontInfo
       ;wxFontBase::New(const wxString&)
       New__10wxFontBaseFRC8wxString
-      ;wxNativeFontInfo::FromString(const wxString&)
-      FromString__16wxNativeFontInfoFRC8wxString
       ;wxFont::operator=(const wxFont&)
       __as__6wxFontFRC6wxFont
       ;wxFontBase::GetNativeFontInfoDesc() const
@@ -2182,17 +2180,21 @@ EXPORTS
       GetWeightString__10wxFontBaseCFv
       ;wxFontBase::GetStyleString() const
       GetStyleString__10wxFontBaseCFv
+      ;wxFontBase::GetNativeFontInfoUserDesc() const
+      GetNativeFontInfoUserDesc__10wxFontBaseCFv
       ;wxFontBase::SetNativeFontInfo(const wxNativeFontInfo&)
       SetNativeFontInfo__10wxFontBaseFRC16wxNativeFontInfo
+      ;wxFontBase::SetNativeFontInfoUserDesc(const wxString&)
+      SetNativeFontInfoUserDesc__10wxFontBaseFRC8wxString
       ;wxFontBase::ms_encodingDefault
       ms_encodingDefault__10wxFontBase
+      ;wxFontBase::SetNativeFontInfo(const wxString&)
+      SetNativeFontInfo__10wxFontBaseFRC8wxString
       ;wxFontBase::operator==(const wxFont&) const
       __eq__10wxFontBaseCFRC6wxFont
       __vft10wxFontBase8wxObject
       ;wxFontBase::operator!=(const wxFont&) const
       __ne__10wxFontBaseCFRC6wxFont
-      ;wxNativeFontInfo::ToString() const
-      ToString__16wxNativeFontInfoCFv
       ;wxFontBase::GetFamilyString() const
       GetFamilyString__10wxFontBaseCFv
       ;wxFontBase::New(int,int,int,int,unsigned long,const wxString&,wxFontEncoding)
@@ -5577,7 +5579,7 @@ EXPORTS
       Read32__17wxTextInputStreamFv
       ;wxTextInputStream::SkipIfEndOfLine(char)
       SkipIfEndOfLine__17wxTextInputStreamFc
-  ;From object file:  H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
+  ;From object file:  F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
     ;PUBDEFs (Symbols available from object file):
       unzReadCurrentFile
       unzGetCurrentFileInfo
-- 
2.50.0

