#define _GENERIC_TREECTRL_H_
#ifdef __GNUG__
- #pragma interface "treectrg.h"
+ #pragma interface "treectlg.h"
#endif
#include "wx/defs.h"
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
};
+#if !defined(__WXMSW__) || defined(__WIN16__)
+/*
+ * wxTreeCtrl has to be a real class or we have problems with
+ * the run-time information.
+ */
+
+class WXDLLEXPORT wxTreeCtrl: public wxGenericTreeCtrl
+{
+public:
+ DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
+
+ wxTreeCtrl() {}
+
+ wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+ const wxValidator &validator = wxDefaultValidator,
+ const wxString& name = wxTreeCtrlNameStr)
+ {
+ Create(parent, id, pos, size, style, validator, name);
+ }
+
+};
+
+#endif
+
#endif // _GENERIC_TREECTRL_H_
EVT_IDLE (wxGenericTreeCtrl::OnIdle)
END_EVENT_TABLE()
+#if !defined(__WXMSW__) || defined(__WIN16__)
+/*
+ * wxTreeCtrl has to be a real class or we have problems with
+ * the run-time information.
+ */
+
+IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxGenericTreeCtrl)
+#endif
+
// -----------------------------------------------------------------------------
// construction/destruction
// -----------------------------------------------------------------------------
int exposed_x = dc.LogicalToDeviceX( 0 );
int exposed_y = dc.LogicalToDeviceY( item->GetY() );
+ bool drawLines = ((GetWindowStyle() & wxTR_NO_LINES) == 0);
+
if (IsExposed( exposed_x, exposed_y, 10000, GetLineHeight(item) )) // 10000 = very much
{
int startX = horizX;
// if (!item->HasChildren()) endX += (m_indent+5);
if (!item->HasChildren()) endX += 20;
- dc.DrawLine( startX, y, endX, y );
+ if (drawLines)
+ dc.DrawLine( startX, y, endX, y );
if (item->HasPlus())
{
- dc.DrawLine( horizX+(m_indent+5), y, horizX+(m_indent+15), y );
+ if (drawLines)
+ dc.DrawLine( horizX+(m_indent+5), y, horizX+(m_indent+15), y );
dc.SetPen( *wxGREY_PEN );
dc.SetBrush( *wxWHITE_BRUSH );
dc.DrawRectangle( horizX+(m_indent-5), y-4, 11, 9 );
if (count > 0)
{
semiOldY+=GetLineHeight(children[--n])/2;
- dc.DrawLine( horizX+m_indent, oldY+5, horizX+m_indent, semiOldY );
+ if (drawLines)
+ dc.DrawLine( horizX+m_indent, oldY+5, horizX+m_indent, semiOldY );
}
}
}