+BEGIN_EVENT_TABLE(wxTreeCompanionWindow, wxWindow)
+ EVT_PAINT(wxTreeCompanionWindow::OnPaint)
+ EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
+ EVT_TREE_ITEM_EXPANDED(-1, wxTreeCompanionWindow::OnExpand)
+ EVT_TREE_ITEM_COLLAPSED(-1, wxTreeCompanionWindow::OnExpand)
+END_EVENT_TABLE()
+
+wxTreeCompanionWindow::wxTreeCompanionWindow(wxWindow* parent, wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& sz,
+ long style):
+ wxWindow(parent, id, pos, sz, style)
+{
+ m_treeCtrl = NULL;
+}
+
+void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
+{
+ // TEST CODE
+#if 1
+ if (m_treeCtrl)
+ {
+ wxString text = m_treeCtrl->GetItemText(id);
+ dc.SetTextForeground(* wxBLACK);
+ dc.SetBackgroundMode(wxTRANSPARENT);
+
+ int textW, textH;
+ dc.GetTextExtent(text, & textW, & textH);
+
+ int x = 5;
+ int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
+
+ dc.DrawText(text, x, y);
+ }
+#endif
+}
+
+void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
+{
+ wxPaintDC dc(this);
+
+ if (!m_treeCtrl)
+ return;