1. '\n's in tooltip messages are handled (replaced by spaces anyhow, tooltip
made multiline if comctl32 supports it) 2. added wxTAB_TRAVERSAL to default wxScrolledWindow style 3. improved arrows handling in radiobox (still problems for multirow ones) 4. [Alt]-<mnemonic> works in nested panels as well now because we use WS_EX_CONTROLPARENT for all windows with wxTAB_TRAVERSAL style 5. tooltips for radioboxes work again, even if I'm not really satisfied with solution :-( but I spent 2 hours trying to make TTM_WINDOWFROMPOINT handler work and I don't have more time to waste on this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -100,16 +100,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// standard macros missing from some compilers headers
|
||||
#ifndef GET_X_LPARAM
|
||||
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
||||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
#endif // GET_X_LPARAM
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -2293,6 +2283,13 @@ bool wxWindow::MSWCreate(int id,
|
||||
if ( width > -1 ) width1 = width;
|
||||
if ( height > -1 ) height1 = height;
|
||||
|
||||
// if we have wxTAB_TRAVERSAL style, we want WS_EX_CONTROLPARENT or
|
||||
// IsDialogMessage() won't work for us
|
||||
if ( GetWindowStyleFlag() & wxTAB_TRAVERSAL )
|
||||
{
|
||||
extendedStyle |= WS_EX_CONTROLPARENT;
|
||||
}
|
||||
|
||||
HWND hParent = (HWND)NULL;
|
||||
if ( parent )
|
||||
hParent = (HWND) parent->GetHWND();
|
||||
@@ -3631,6 +3628,45 @@ wxWindow *wxGetActiveWindow()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
|
||||
{
|
||||
HWND hwnd = (HWND)hWnd;
|
||||
|
||||
// For a radiobutton, we get the radiobox from GWL_USERDATA (which is set
|
||||
// by code in msw/radiobox.cpp), for all the others we just search up the
|
||||
// window hierarchy
|
||||
wxWindow *win = (wxWindow *)NULL;
|
||||
if ( hwnd )
|
||||
{
|
||||
win = wxFindWinFromHandle((WXHWND)hwnd);
|
||||
if ( !win )
|
||||
{
|
||||
// native radiobuttons return DLGC_RADIOBUTTON here and for any
|
||||
// wxWindow class which overrides WM_GETDLGCODE processing to
|
||||
// do it as well, win would be already non NULL
|
||||
if ( ::SendMessage((HWND)hwnd, WM_GETDLGCODE,
|
||||
0, 0) & DLGC_RADIOBUTTON )
|
||||
{
|
||||
win = (wxWindow *)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
}
|
||||
else
|
||||
{
|
||||
// hwnd is not a wxWindow, try its parent next below
|
||||
hwnd = ::GetParent(hwnd);
|
||||
}
|
||||
}
|
||||
//else: it's a wxRadioButton, not a radiobutton from wxRadioBox
|
||||
}
|
||||
|
||||
while ( hwnd && !win )
|
||||
{
|
||||
win = wxFindWinFromHandle((WXHWND)hwnd);
|
||||
hwnd = ::GetParent(hwnd);
|
||||
}
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
// Windows keyboard hook. Allows interception of e.g. F1, ESCAPE
|
||||
// in active frames and dialogs, regardless of where the focus is.
|
||||
static HHOOK wxTheKeyboardHook = 0;
|
||||
@@ -3646,11 +3682,12 @@ void wxSetKeyboardHook(bool doIt)
|
||||
wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
|
||||
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
GetCurrentThreadId());
|
||||
GetCurrentThreadId()
|
||||
// (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
|
||||
#else
|
||||
GetCurrentTask());
|
||||
GetCurrentTask()
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user