]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed compilation for wxMSW after the recent changes
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Mar 2002 23:14:33 +0000 (23:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Mar 2002 23:14:33 +0000 (23:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/tbar95.h
include/wx/msw/tbarmsw.h
src/msw/tbar95.cpp
src/msw/tbarmsw.cpp

index f032a86039ca6d3572db7ce6d513a78dd28da914..45c82b48d2c922a288c1a37370895202a9fcfb1a 100644 (file)
@@ -81,12 +81,13 @@ protected:
     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
index 278353b88c35724ba3796a881255b3f373ea7ae1..d51e0ebad9f97ec91d91064b3bab9b4006267b00 100644 (file)
@@ -90,12 +90,13 @@ protected:
     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);
index fe3e60ea8e730803bdc00a39e252f650eaf3c943..0efea2ffc0a2c95a50c1eed216fe81bbf2f78004 100644 (file)
     #define TBSTYLE_TRANSPARENT     0x8000
 #endif
 
+#ifndef TBSTYLE_TOOLTIPS
+    #define TBSTYLE_TOOLTIPS        0x0100
+#endif
+
 // Messages
 #ifndef TB_GETSTYLE
     #define TB_SETSTYLE             (WM_USER + 56)
@@ -138,14 +142,15 @@ class wxToolBarTool : public wxToolBarToolBase
 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;
     }
@@ -175,15 +180,16 @@ private:
 // ----------------------------------------------------------------------------
 
 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)
@@ -224,16 +230,12 @@ bool wxToolBar::Create(wxWindow *parent,
         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();
@@ -607,8 +609,7 @@ bool wxToolBar::Realize()
         i++;
     }
 
-    if ( !::SendMessage(GetHwnd(), TB_ADDBUTTONS,
-                        (WPARAM)i, (LPARAM)buttons) )
+    if ( !::SendMessage(GetHwnd(), TB_ADDBUTTONS, (WPARAM)i, (LPARAM)buttons) )
     {
         wxLogLastError(wxT("TB_ADDBUTTONS"));
     }
index e51c302c1c0e86e44f4ec6dcb24114749c48435a..92b60a0fa10efd1e52ac42aab0a81cc0b6845dbc 100644 (file)
@@ -83,14 +83,14 @@ class WXDLLEXPORT wxToolBarTool : public wxToolBarToolBase
 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)
     {
     }
 
@@ -136,15 +136,16 @@ END_EVENT_TABLE()
 // ----------------------------------------------------------------------------
 
 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)
@@ -490,7 +491,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
 
     // 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(),
@@ -784,7 +785,7 @@ void wxToolBar::DrawButton(WXHDC hdc, int x, int y, int dx, int dy,
     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())