virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
virtual wxToolBarToolBase *CreateTool(int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- bool toggle,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString);
+ const wxString& shortHelp,
+ const wxString& longHelp);
virtual wxToolBarToolBase *CreateTool(wxControl *control);
// should be called whenever the toolbar size changes
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
virtual wxToolBarToolBase *CreateTool(int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- bool toggle,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString);
+ const wxString& shortHelp,
+ const wxString& longHelp);
virtual wxToolBarToolBase *CreateTool(wxControl *control);
void DoRedrawTool(wxToolBarToolBase *tool);
#define TBSTYLE_TRANSPARENT 0x8000
#endif
+#ifndef TBSTYLE_TOOLTIPS
+ #define TBSTYLE_TOOLTIPS 0x0100
+#endif
+
// Messages
#ifndef TB_GETSTYLE
#define TB_SETSTYLE (WM_USER + 56)
public:
wxToolBarTool(wxToolBar *tbar,
int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- bool toggle,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString)
- : wxToolBarToolBase(tbar, id, bitmap1, bitmap2, toggle,
- clientData, shortHelpString, longHelpString)
+ const wxString& shortHelp,
+ const wxString& longHelp)
+ : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind,
+ clientData, shortHelp, longHelp)
{
m_nSepCount = 0;
}
// ----------------------------------------------------------------------------
wxToolBarToolBase *wxToolBar::CreateTool(int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- bool toggle,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString)
+ const wxString& shortHelp,
+ const wxString& longHelp)
{
- return new wxToolBarTool(this, id, bitmap1, bitmap2, toggle,
- clientData, shortHelpString, longHelpString);
+ return new wxToolBarTool(this, id, label, bmpNormal, bmpDisabled, kind,
+ clientData, shortHelp, longHelp);
}
wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
return FALSE;
// prepare flags
- DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included
+ DWORD msflags = TBSTYLE_TOOLTIPS; // WS_VISIBLE | WS_CHILD always included
if ( style & wxCLIP_SIBLINGS )
msflags |= WS_CLIPSIBLINGS;
-#ifdef TBSTYLE_TOOLTIPS
- msflags |= TBSTYLE_TOOLTIPS;
-#endif
-
- if (style & wxTB_FLAT)
+ if ( style & wxTB_FLAT )
{
// static as it doesn't change during the program lifetime
static int s_verComCtl = wxTheApp->GetComCtl32Version();
i++;
}
- if ( !::SendMessage(GetHwnd(), TB_ADDBUTTONS,
- (WPARAM)i, (LPARAM)buttons) )
+ if ( !::SendMessage(GetHwnd(), TB_ADDBUTTONS, (WPARAM)i, (LPARAM)buttons) )
{
wxLogLastError(wxT("TB_ADDBUTTONS"));
}
public:
wxToolBarTool(wxToolBar *tbar,
int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
bool toggle,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString)
- : wxToolBarToolBase(tbar, id, bitmap1, bitmap2, toggle,
- clientData, shortHelpString, longHelpString)
+ const wxString& shortHelp,
+ const wxString& longHelp)
+ : wxToolBarToolBase(tbar, id, bmpNormal, bmpDisabled, toggle,
+ clientData, shortHelp, longHelp)
{
}
// ----------------------------------------------------------------------------
wxToolBarToolBase *wxToolBar::CreateTool(int id,
- const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- bool toggle,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
wxObject *clientData,
- const wxString& shortHelpString,
- const wxString& longHelpString)
+ const wxString& shortHelp,
+ const wxString& longHelp)
{
- return new wxToolBarTool(this, id, bitmap1, bitmap2, toggle,
- clientData, shortHelpString, longHelpString);
+ return new wxToolBarTool(this, id, label, bmpNormal, bmpDisabled, kind,
+ clientData, shortHelp, longHelp);
}
wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
// TODO: use the mapping code from wxToolBar95 to get it right in this class
#if !defined(__WIN32__) && !defined(__WIN386__)
- wxBitmap bitmap2;
+ wxBitmap bmpDisabled;
if (tool->CanBeToggled())
{
HBITMAP hbmp = CreateMappedBitmap((WXHINSTANCE)wxGetInstance(),
dxFace -= 3;
dyFace -= 3;
- // Using bitmap2 can cause problems (don't know why!)
+ // Using bmpDisabled can cause problems (don't know why!)
#if !defined(__WIN32__) && !defined(__WIN386__)
HBITMAP bitmapOld;
if (tool->GetBitmap2().Ok())