]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/headerctrlg.cpp
fixed wxXmlResource::Load's detection of filenames to be done as early as possible
[wxWidgets.git] / src / generic / headerctrlg.cpp
index 37d848fc184d9a4ddfef2ed873e1be3978494c02..491354c6bc60259d047c9039e032bf75d30c15ba 100644 (file)
@@ -23,8 +23,7 @@
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-#endif // WX_PRECOMP
+#if wxUSE_HEADERCTRL
 
 #include "wx/headerctrl.h"
 
@@ -134,11 +133,14 @@ void wxHeaderCtrl::DoScrollHorz(int dx)
 
 wxSize wxHeaderCtrl::DoGetBestSize() const
 {
+    wxWindow *win = GetParent();
+    int height = wxRendererNative::Get().GetHeaderButtonHeight( win );
+
     // the vertical size is rather arbitrary but it looks better if we leave
     // some space around the text
     const wxSize size(IsEmpty() ? wxHeaderCtrlBase::DoGetBestSize().x
                                 : GetColEnd(GetColumnCount() - 1),
-                      (7*GetCharHeight())/4);
+                                height ); // (7*GetCharHeight())/4);
     CacheBestSize(size);
     return size;
 }
@@ -493,6 +495,11 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
     int w, h;
     GetClientSize(&w, &h);
+    
+#ifdef __WXGTK__
+//    int vw;
+//    GetVirtualSize(&vw, NULL);
+#endif
 
     wxAutoBufferedPaintDC dc(this);
 
@@ -511,7 +518,7 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         if ( col.IsHidden() )
             continue;
 
-        const int colWidth = col.GetWidth();
+        int colWidth = col.GetWidth();
 
         wxHeaderSortIconType sortArrow;
         if ( col.IsSortKey() )
@@ -534,11 +541,22 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         {
             state = wxCONTROL_DISABLED;
         }
+        
+        if (i == 0)
+           state |= wxCONTROL_SPECIAL;
 
         wxHeaderButtonParams params;
         params.m_labelText = col.GetTitle();
         params.m_labelBitmap = col.GetBitmap();
         params.m_labelAlignment = col.GetAlignment();
+        
+#ifdef __WXGTK__
+        if (i == count-1)
+        {
+//            colWidth = wxMax( colWidth, vw - xpos );
+            state |= wxCONTROL_DIRTY;
+        }
+#endif
 
         wxRendererNative::Get().DrawHeaderButton
                                 (
@@ -714,3 +732,5 @@ void wxHeaderCtrl::OnMouse(wxMouseEvent& mevent)
 }
 
 #endif // wxHAS_GENERIC_HEADERCTRL
+
+#endif // wxUSE_HEADERCTRL