/////////////////////////////////////////////////////////////////////////////
-// Name: msw/wince/tbarwce.cpp
+// Name: src/msw/wince/tbarwce.cpp
// Purpose: wxToolBar for Windows CE
// Author: Julian Smart
// Modified by:
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "tbarwce.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// 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;
}
case wxTOOL_STYLE_CONTROL:
button.idCommand = tool->GetId();
// fall through: create just a separator too
+ // TODO: controls are not yet supported on wxToolMenuBar.
case wxTOOL_STYLE_SEPARATOR:
button.fsState = TBSTATE_ENABLED;
break;
case wxTOOL_STYLE_BUTTON:
-
+
if ( HasFlag(wxTB_TEXT) )
{
const wxString& label = tool->GetLabel();
wxMemoryDC memDC;
wxBitmap b(16,16);
memDC.SelectObject(b);
- memDC.SetBackground(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
+ wxColour col = wxColour(192,192,192);
+ memDC.SetBackground(wxBrush(col));
memDC.Clear();
int x = (16 - bmp.GetWidth())/2;
int y = (16 - bmp.GetHeight())/2;
break;
}
- BOOL bRc = ::CommandBar_AddButtons( (HWND) GetHWND(), 1, buttons );
-
- wxASSERT_MSG( bRc, wxT("Could not add toolbar button."));
+ if ( !::CommandBar_AddButtons( (HWND) GetHWND(), 1, buttons ) )
+ {
+ wxFAIL_MSG( wxT("Could not add toolbar button."));
+ }
lastWasRadio = isRadio;
}
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);
return true;
}
+WXLRESULT wxToolMenuBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ switch ( nMsg )
+ {
+ case WM_SIZE:
+ break;
+
+ case WM_MOUSEMOVE:
+ // we don't handle mouse moves, so always pass the message to
+ // wxControl::MSWWindowProc
+ HandleMouseMove(wParam, lParam);
+ break;
+
+ case WM_PAINT:
+ break;
+ }
+
+ return wxControl::MSWWindowProc(nMsg, wParam, lParam);
+}
+
+
#else
////////////// For Smartphone
// satisfy other parts of wxWidgets.
parent->AddChild(this);
-
+
SetWindowStyle(style);
SetName(name);
-
+
return true;
}
#endif
// !__SMARTPHONE__
-
-
-#endif // wxUSE_TOOLBAR && Win95
-
+#endif // wxUSE_TOOLBAR