Make HTCLIENT code off by default

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-02-25 08:08:22 +00:00
parent c1280d1ef6
commit 9dabade20b
2 changed files with 32 additions and 13 deletions

View File

@@ -38,6 +38,8 @@
#include "wx/statbmp.h" #include "wx/statbmp.h"
#endif #endif
#include "wx/sysopt.h"
#include <stdio.h> #include <stdio.h>
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -262,16 +264,24 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
::InvalidateRect(GetHwndOf(GetParent()), &rect, TRUE); ::InvalidateRect(GetHwndOf(GetParent()), &rect, TRUE);
} }
// We need this for e.g. dialog editors. Please do not remove.
WXLRESULT wxStaticBitmap::MSWWindowProc(WXUINT nMsg, WXLRESULT wxStaticBitmap::MSWWindowProc(WXUINT nMsg,
WXWPARAM wParam, WXWPARAM wParam,
WXLPARAM lParam) WXLPARAM lParam)
{ {
#ifndef __WXWINCE__ #ifndef __WXWINCE__
static int s_useHTClient = -1;
if (s_useHTClient == -1)
s_useHTClient = wxSystemOptions::GetOptionInt(wxT("msw.staticbitmap.htclient"));
if (s_useHTClient == 1)
{
// Ensure that static items get messages. Some controls don't like this // Ensure that static items get messages. Some controls don't like this
// message to be intercepted (e.g. RichEdit), hence the tests. // message to be intercepted (e.g. RichEdit), hence the tests.
// Also, this code breaks some other processing such as enter/leave tracking
// so it's off by default.
if ( nMsg == WM_NCHITTEST ) if ( nMsg == WM_NCHITTEST )
return (long)HTCLIENT; return (long)HTCLIENT;
}
#endif #endif
return wxWindow::MSWWindowProc(nMsg, wParam, lParam); return wxWindow::MSWWindowProc(nMsg, wParam, lParam);

View File

@@ -37,6 +37,7 @@
#include "wx/statbox.h" #include "wx/statbox.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/sysopt.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
@@ -151,13 +152,20 @@ wxSize wxStaticBox::DoGetBestSize() const
return wxSize(wBox, hBox); return wxSize(wBox, hBox);
} }
// Required for implementing dialog editors, please do not remove
WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{ {
switch ( nMsg ) switch ( nMsg )
{ {
#ifndef __WXWINCE__ #ifndef __WXWINCE__
case WM_NCHITTEST: case WM_NCHITTEST:
{
// This code breaks some other processing such as enter/leave tracking
// so it's off by default.
static int s_useHTClient = -1;
if (s_useHTClient == -1)
s_useHTClient = wxSystemOptions::GetOptionInt(wxT("msw.staticbox.htclient"));
if (s_useHTClient == 1)
{ {
int xPos = LOWORD(lParam); // horizontal position of cursor int xPos = LOWORD(lParam); // horizontal position of cursor
int yPos = HIWORD(lParam); // vertical position of cursor int yPos = HIWORD(lParam); // vertical position of cursor
@@ -169,6 +177,7 @@ WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPar
if ( yPos < 10 ) if ( yPos < 10 )
return (long)HTCLIENT; return (long)HTCLIENT;
} }
}
break; break;
#endif #endif
} }