/////////////////////////////////////////////////////////////////////////////
-// Name: msw/wince/tbarwce.cpp
+// Name: src/msw/wince/tbarwce.cpp
// Purpose: wxToolBar for Windows CE
// Author: Julian Smart
// Modified by:
// a control in the toolbar
void SetSeparatorsCount(size_t count) { m_nSepCount = count; }
size_t GetSeparatorsCount() const { return m_nSepCount; }
-
+
void SetBitmapIndex(int idx) { m_bitmapIndex = idx; }
int GetBitmapIndex() const { return m_bitmapIndex; }
void wxToolMenuBar::Init()
{
wxToolBar::Init();
-
- m_nButtons = 0;
+
+ m_nButtons = 0;
m_menuBar = NULL;
}
break;
case wxTOOL_STYLE_BUTTON:
-
+
if ( HasFlag(wxTB_TEXT) )
{
const wxString& label = tool->GetLabel();
wxToolBarToolBase *tool = FindById((int)id);
if ( !tool )
{
+ if (m_menuBar)
+ {
+ wxMenuItem *item = m_menuBar->FindItem(id);
+ if (item && item->IsCheckable())
+ {
+ item->Toggle();
+ }
+ }
+
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
event.SetEventObject(this);
event.SetId(id);
// satisfy other parts of wxWidgets.
parent->AddChild(this);
-
+
SetWindowStyle(style);
SetName(name);
-
+
return true;
}
#endif
// !__SMARTPHONE__
-
-
-#endif // wxUSE_TOOLBAR && Win95
-
+#endif // wxUSE_TOOLBAR