From 088a95f5ffcbcb035596f52cf035372d13d280fc Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 13 Aug 1998 10:16:03 +0000 Subject: [PATCH] Fixed compile bug in dropsrc.cpp (constr. arg); GnuWin32 fix in registry.cpp; combobox event fix; moved SetAcceleratorTable down to window.h/cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@524 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/combobox.cpp | 1 + src/msw/frame.cpp | 5 ----- src/msw/ole/dropsrc.cpp | 4 ++-- src/msw/registry.cpp | 7 +++++++ src/msw/tbar95.cpp | 5 +++++ src/msw/window.cpp | 14 ++++++++++++-- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 146d1bd5a7..1b795f43e6 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -50,6 +50,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); event.SetString(copystring(GetValue())); + event.SetEventObject(this); ProcessCommand(event); delete[] event.GetString(); return TRUE; diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 1a7f2bb7a6..7beb0561a4 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -352,11 +352,6 @@ void wxFrame::SetIcon(const wxIcon& icon) #endif } -void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel) -{ - m_acceleratorTable = accel; -} - wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) { diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index 83d00f3aeb..1f97088732 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -149,13 +149,13 @@ void wxDropSource::Init() m_pIDropSource->AddRef(); } -wxDropSource::wxDropSource() +wxDropSource::wxDropSource(wxWindow* WXUNUSED(win)) { Init(); m_pData = NULL; } -wxDropSource::wxDropSource(wxDataObject& data) +wxDropSource::wxDropSource(wxDataObject& data, wxWindow* WXUNUSED(win)) { Init(); SetData(data); diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 4717b97ebb..1fcc78c55f 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -297,10 +297,17 @@ wxString wxRegKey::GetName(bool bShortPrefix) const return str; } +#ifdef __GNUWIN32__ +bool wxRegKey::GetKeyInfo(uint* pnSubKeys, + uint* pnMaxKeyLen, + uint* pnValues, + uint* pnMaxValueLen) const +#else bool wxRegKey::GetKeyInfo(ulong *pnSubKeys, ulong *pnMaxKeyLen, ulong *pnValues, ulong *pnMaxValueLen) const +#endif { #ifdef __WIN32__ m_dwLastError = ::RegQueryInfoKey diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index f3a96868f7..12b4f41ba8 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -432,6 +432,11 @@ void wxToolBar95::ToggleTool(int toolIndex, bool toggle) } } +bool wxToolBar95::GetToolState(int toolIndex) const +{ + return (::SendMessage((HWND) GetHWND(), TB_ISBUTTONCHECKED, (WPARAM)toolIndex, (LPARAM)0) != 0); +} + void wxToolBar95::ClearTools(void) { // TODO: Don't know how to reset the toolbar bitmap, as yet. diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3c61e27b28..5abe05b464 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -504,6 +504,12 @@ void wxWindow::ReleaseMouse(void) } } +void wxWindow::SetAcceleratorTable(const wxAcceleratorTable& accel) +{ + m_acceleratorTable = accel; +} + + // Push/pop event handler (i.e. allow a chain of event handlers // be searched) void wxWindow::PushEventHandler(wxEvtHandler *handler) @@ -1961,9 +1967,13 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) return FALSE; } -bool wxWindow::MSWTranslateMessage(WXMSG* WXUNUSED(pMsg)) +bool wxWindow::MSWTranslateMessage(WXMSG* pMsg) { - return FALSE; + if (m_acceleratorTable.Ok() && + ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), (MSG *)pMsg)) + return TRUE; + else + return FALSE; } long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate)) -- 2.45.2