1. fixed wxBitmapButtons in wxStatBar95 bug
2. fixed handling of accels in wxDocMDIParentFrame 3. fixed wxComboBox tooltips git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,6 +81,8 @@ public:
|
|||||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
|
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
|
WXHWND GetEditHWND() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
@@ -38,6 +38,13 @@
|
|||||||
#include "wx/clipbrd.h"
|
#include "wx/clipbrd.h"
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
#ifndef __GNUWIN32_OLD__
|
||||||
|
#include <commctrl.h>
|
||||||
|
#endif
|
||||||
|
#include "wx/tooltip.h"
|
||||||
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxWin macros
|
// wxWin macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -73,15 +80,45 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
|||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
if ( message == WM_CHAR )
|
if (
|
||||||
|
message == WM_CHAR
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
|| message == WM_NOTIFY
|
||||||
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
)
|
||||||
{
|
{
|
||||||
HWND hwndCombo = ::GetParent(hWnd);
|
HWND hwndCombo = ::GetParent(hWnd);
|
||||||
wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
|
wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
|
||||||
wxComboBox *combo = wxDynamicCast(win, wxComboBox);
|
wxComboBox *combo = wxDynamicCast(win, wxComboBox);
|
||||||
wxCHECK_MSG( combo, 0, _T("should have combo as parent") );
|
wxCHECK_MSG( combo, 0, _T("should have combo as parent") );
|
||||||
|
|
||||||
if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
|
switch ( message )
|
||||||
return 0;
|
{
|
||||||
|
case WM_CHAR:
|
||||||
|
if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
case WM_NOTIFY:
|
||||||
|
{
|
||||||
|
NMHDR* hdr = (NMHDR *)lParam;
|
||||||
|
if ( (int)hdr->code == TTN_NEEDTEXT )
|
||||||
|
{
|
||||||
|
wxToolTip *tooltip = combo->GetToolTip();
|
||||||
|
if ( tooltip )
|
||||||
|
{
|
||||||
|
TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
|
||||||
|
ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// processed
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
||||||
@@ -131,6 +168,22 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WXHWND wxComboBox::GetEditHWND() const
|
||||||
|
{
|
||||||
|
if ( GetWindowStyle() & wxCB_READONLY )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
POINT pt;
|
||||||
|
pt.x = pt.y = 4;
|
||||||
|
HWND hwndEdit = ::ChildWindowFromPoint(GetHwnd(), pt);
|
||||||
|
if ( !hwndEdit || hwndEdit == GetHwnd() )
|
||||||
|
{
|
||||||
|
wxFAIL_MSG(_T("not read only combobox without edit control?"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return (WXHWND)hwndEdit;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxString& value,
|
const wxString& value,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
@@ -182,23 +235,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// edit control, we must subclass it as well
|
// edit control, we must subclass it as well
|
||||||
if ( !(style & wxCB_READONLY) )
|
if ( !(style & wxCB_READONLY) )
|
||||||
{
|
{
|
||||||
// first find the child edit
|
gs_wndprocEdit = (WXFARPROC)::SetWindowLong
|
||||||
POINT pt;
|
(
|
||||||
pt.x = pt.y = 4;
|
(HWND)GetEditHWND(),
|
||||||
HWND hwndEdit = ::ChildWindowFromPoint(GetHwnd(), pt);
|
GWL_WNDPROC,
|
||||||
if ( !hwndEdit || hwndEdit == GetHwnd() )
|
(LPARAM)wxComboEditWndProc
|
||||||
{
|
);
|
||||||
wxFAIL_MSG(_T("not read only combobox without edit control?"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gs_wndprocEdit = (WXFARPROC)::SetWindowLong
|
|
||||||
(
|
|
||||||
hwndEdit,
|
|
||||||
GWL_WNDPROC,
|
|
||||||
(LPARAM)wxComboEditWndProc
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -582,17 +582,20 @@ bool wxMDIParentFrame::MSWTranslateMessage(WXMSG* msg)
|
|||||||
{
|
{
|
||||||
MSG *pMsg = (MSG *)msg;
|
MSG *pMsg = (MSG *)msg;
|
||||||
|
|
||||||
|
// first let the current child get it
|
||||||
if ( m_currentChild && m_currentChild->GetHWND() &&
|
if ( m_currentChild && m_currentChild->GetHWND() &&
|
||||||
m_currentChild->MSWTranslateMessage(msg) )
|
m_currentChild->MSWTranslateMessage(msg) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_acceleratorTable.Translate(this, msg) )
|
// then try out accel table (will also check the menu accels)
|
||||||
|
if ( wxFrame::MSWTranslateMessage(msg) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// finally, check for MDI specific built in accel keys
|
||||||
if ( pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN )
|
if ( pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN )
|
||||||
{
|
{
|
||||||
if ( ::TranslateMDISysAccel(GetWinHwnd(GetClientWindow()), pMsg))
|
if ( ::TranslateMDISysAccel(GetWinHwnd(GetClientWindow()), pMsg))
|
||||||
|
@@ -71,6 +71,8 @@ LRESULT APIENTRY wxStatusBarProc(HWND hwnd,
|
|||||||
{
|
{
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
case WM_DRAWITEM:
|
||||||
|
case WM_MEASUREITEM:
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
|
@@ -374,6 +374,21 @@ void wxToolTip::SetWindow(wxWindow *win)
|
|||||||
Add((WXHWND)hwnd);
|
Add((WXHWND)hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VZ: it's ugly to do it here, but I don't want any major changes right
|
||||||
|
// now, later we will probably want to have wxWindow::OnGotToolTip() or
|
||||||
|
// something like this where the derived class can do such things
|
||||||
|
// itself instead of wxToolTip "knowing" about them all
|
||||||
|
wxComboBox *combo = wxDynamicCast(control, wxComboBox);
|
||||||
|
if ( combo )
|
||||||
|
{
|
||||||
|
WXHWND hwndComboEdit = combo->GetEditHWND();
|
||||||
|
if ( hwndComboEdit )
|
||||||
|
{
|
||||||
|
Add(hwndComboEdit);
|
||||||
|
}
|
||||||
|
//else: it's ok for a combo to be read only, of course
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxToolTip::SetTip(const wxString& tip)
|
void wxToolTip::SetTip(const wxString& tip)
|
||||||
|
Reference in New Issue
Block a user