]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp
reSWIGged
[wxWidgets.git] / wxPython / contrib / gizmos / wxCode / src / treelistctrl.cpp
index ab5984ab66a4825c325b2e65679ef51f23869b4d..2fbdd144000105e15ba2f3d7708dee109ede9ee5 100644 (file)
@@ -1744,6 +1744,7 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point,
                 column = i;
                 return res;
             }
+            x += w;
         }
     }
 
@@ -1867,17 +1868,20 @@ bool wxTreeListMainWindow::Create(wxTreeListCtrl *parent,
                                   const wxString& name )
 {
 #ifdef __WXMAC__
-    int major,minor;
-    wxGetOsVersion( &major, &minor );
-
-    if (style & wxTR_HAS_BUTTONS) style |= wxTR_MAC_BUTTONS;
-    if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS;
-    style &= ~wxTR_LINES_AT_ROOT;
-    style |= wxTR_NO_LINES;
-    if (major < 10)
-        style |= wxTR_ROW_LINES;
+    if ( !(style & wxTR_DONT_ADJUST_MAC))
+    {
+        int major,minor;
+        wxGetOsVersion( &major, &minor );
+
+        if (style & wxTR_HAS_BUTTONS) style |= wxTR_TWIST_BUTTONS;
+        if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS;
+        style &= ~wxTR_LINES_AT_ROOT;
+        style |= wxTR_NO_LINES;
+        if (major < 10)
+            style |= wxTR_ROW_LINES;
+    }
 #endif
-
+    
     wxScrolledWindow::Create( parent, id, pos, size,
                               style|wxHSCROLL|wxVSCROLL, name );
 
@@ -3554,48 +3558,6 @@ void wxTreeListMainWindow::PaintLevel (wxTreeListItem *item, wxDC &dc,
             if (HasButtons()) y_mid += 5;
             dc.DrawLine(x, y_mid, x, oldY);
         }
-
-        
-//         // clip to the column width
-//         size_t clip_width = m_owner->GetHeaderWindow()->
-//                             GetColumn(m_main_column).GetWidth();
-//         wxDCClipper clipper(dc, x_colstart, y_top, clip_width, 10000);
-
-//         // process lower levels
-//         int oldY;
-//         if (m_imgWidth > 0) {
-//             oldY = y_mid + m_imgHeight2;
-//         }else{
-//             oldY = y_mid + h/2;
-//         }
-//         int y2;
-//         int n;
-//         for (n = 0; n < (int)children.Count(); ++n) {
-
-//             if (!HasFlag(wxTR_NO_LINES))
-//             {
-//                 // draw line down to last child
-//                 if (children[n]->HasPlus() && HasButtons()) {
-//                     y2 = y + h/2 - m_btnHeight2;
-//                     if (HasButtons()) {
-//                         dc.DrawLine(x+m_indent, oldY, x+m_indent, y2);
-//                     }else{
-//                         dc.DrawLine(x, oldY, x, y2);
-//                     }
-//                     oldY = y2 + m_btnHeight;
-//                 }else{
-//                     y2 = y + h/2;
-//                     if (HasButtons()) {
-//                         dc.DrawLine(x+m_indent, oldY, x+m_indent, y2);
-//                     }else{
-//                         dc.DrawLine(x, oldY, x, y2);
-//                     }
-//                     oldY = y2;
-//                 }
-//             }
-
-//             PaintLevel (children[n], dc, level+1, y, x_colstart);
-//         }
     }
 }
 
@@ -4947,10 +4909,16 @@ wxTreeItemId wxTreeListCtrl::FindItem (const wxTreeItemId& item, const wxString&
 { return m_main_win->FindItem (item, str, flags); }
 
 bool wxTreeListCtrl::SetBackgroundColour(const wxColour& colour)
-{ return m_main_win->SetBackgroundColour(colour); }
+{ 
+    if (!m_main_win) return false;
+    return m_main_win->SetBackgroundColour(colour); 
+}
 
 bool wxTreeListCtrl::SetForegroundColour(const wxColour& colour)
-{ return m_main_win->SetForegroundColour(colour); }
+{ 
+    if (!m_main_win) return false;
+    return m_main_win->SetForegroundColour(colour); 
+}
 
 size_t wxTreeListCtrl::GetColumnCount() const
 { return m_main_win->GetColumnCount(); }
@@ -5037,3 +5005,9 @@ void wxTreeListCtrl::Refresh(bool erase, const wxRect* rect)
 void wxTreeListCtrl::SetFocus()
 { m_main_win->SetFocus(); }
 
+
+wxSize wxTreeListCtrl::DoGetBestSize() const
+{
+    // something is better than nothing...
+    return wxSize(100,80);
+}