projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
made GetColourFromGTKWidget() more general, it is now used for all colours
[wxWidgets.git]
/
src
/
common
/
tbarbase.cpp
diff --git
a/src/common/tbarbase.cpp
b/src/common/tbarbase.cpp
index 526c883fcc35f7f82f86475a2215ebad841e62f0..dbce9ffff6e8eb860a41dd36ec3e1488533e97bf 100644
(file)
--- a/
src/common/tbarbase.cpp
+++ b/
src/common/tbarbase.cpp
@@
-28,8
+28,9
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#if wxUSE_TOOLBAR
+
#ifndef WX_PRECOMP
#ifndef WX_PRECOMP
- #include "wx/wx.h"
#endif
#include "wx/frame.h"
#endif
#include "wx/frame.h"
@@
-39,19
+40,17
@@
#include <windows.h>
#endif
#include <windows.h>
#endif
-#if wxUSE_TOOLBAR
-
#include "wx/tbarbase.h"
// ----------------------------------------------------------------------------
// wxWindows macros
// ----------------------------------------------------------------------------
#include "wx/tbarbase.h"
// ----------------------------------------------------------------------------
// wxWindows macros
// ----------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
- BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
-
EVT_IDLE(wxToolBarBase::OnIdle
)
- E
ND_EVENT_TABLE(
)
-#endif
+IMPLEMENT_CLASS(wxToolBarBase, wxControl)
+
+
BEGIN_EVENT_TABLE(wxToolBarBase, wxControl
)
+ E
VT_IDLE(wxToolBarBase::OnIdle
)
+END_EVENT_TABLE()
#include "wx/listimpl.cpp"
#include "wx/listimpl.cpp"
@@
-468,7
+467,12
@@
bool wxToolBarBase::OnLeftClick(int id, bool toggleDown)
{
wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id);
event.SetEventObject(this);
{
wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id);
event.SetEventObject(this);
- event.SetExtraLong((long) toggleDown);
+
+ // we use SetInt() to make wxCommandEvent::IsChecked() return toggleDown
+ event.SetInt((int)toggleDown);
+
+ // and SetExtraLong() for backwards compatibility
+ event.SetExtraLong((long)toggleDown);
// Send events to this toolbar instead (and thence up the window hierarchy)
GetEventHandler()->ProcessEvent(event);
// Send events to this toolbar instead (and thence up the window hierarchy)
GetEventHandler()->ProcessEvent(event);
@@
-530,7
+534,11
@@
void wxToolBarBase::DoToolbarUpdates()
while (parent->GetParent())
parent = parent->GetParent();
while (parent->GetParent())
parent = parent->GetParent();
+#ifdef __WXMSW__
wxWindow* focusWin = wxFindFocusDescendant(parent);
wxWindow* focusWin = wxFindFocusDescendant(parent);
+#else
+ wxWindow* focusWin = (wxWindow*) NULL;
+#endif
wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;
wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;