]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/renderg.cpp
Try to better revert to the original string value in wxBitmapComboBox::RecreateControl()
[wxWidgets.git] / src / generic / renderg.cpp
index d2a6c2e5164dc3fdb7cf187ed51e36722474b028..0024bcec60cd8ced94886f18953fe0825de68065 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     20.07.2003
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
-// License:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -32,6 +32,7 @@
     #include "wx/settings.h"
     #include "wx/gdicmn.h"
     #include "wx/module.h"
+    #include "wx/control.h"
 #endif //WX_PRECOMP
 
 #include "wx/splitter.h"
@@ -66,6 +67,8 @@ public:
 
     virtual int GetHeaderButtonHeight(wxWindow *win);
 
+    virtual int GetHeaderButtonMargin(wxWindow *win);
+
     virtual void DrawTreeItemButton(wxWindow *win,
                                     wxDC& dc,
                                     const wxRect& rect,
@@ -182,10 +185,7 @@ wxRendererNative& wxRendererNative::GetGeneric()
 
 void wxRendererGeneric::Cleanup()
 {
-    if (sm_rendererGeneric)
-        delete sm_rendererGeneric;
-
-    sm_rendererGeneric = NULL;
+    wxDELETE(sm_rendererGeneric);
 }
 
 wxRendererGeneric* wxRendererGeneric::sm_rendererGeneric = NULL;
@@ -398,6 +398,7 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win,
 
         // truncate and add an ellipsis (...) if the text is too wide.
         const int availWidth = rect.width - labelWidth;
+#if wxUSE_CONTROLS
         if ( tw > availWidth )
         {
             label = wxControl::Ellipsize(label,
@@ -408,6 +409,7 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win,
             tw = dc.GetTextExtent(label).x;
         }
         else // enough space, we can respect alignment
+#endif // wxUSE_CONTROLS
         {
             switch (params->m_labelAlignment)
             {
@@ -447,6 +449,11 @@ int wxRendererGeneric::GetHeaderButtonHeight(wxWindow *win)
     return h + d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
 }
 
+int wxRendererGeneric::GetHeaderButtonMargin(wxWindow *WXUNUSED(win))
+{
+    return 5;
+}
+
 
 // draw the plus or minus sign
 void