]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/include/wx/gizmos/splittree.h
changed wxImage::ComputeHistogram to use wxHashMap
[wxWidgets.git] / contrib / include / wx / gizmos / splittree.h
index 118f0b450eb5352cad67a53140045a8a8e72a100..e9aa94101b0025171f3d74d1b5e8c33aeb0e0f72 100644 (file)
 #define _WX_SPLITTREE_H_
 
 #ifdef __GNUG__
-       #pragma interface "splittree.h"
+    #pragma interface "splittree.h"
+#endif
+
+#ifdef GIZMOISDLL
+#define GIZMODLLEXPORT WXDLLEXPORT
+#else
+#define GIZMODLLEXPORT
 #endif
 
 // Set this to 1 to use generic tree control (doesn't yet work properly)
@@ -46,19 +52,19 @@ class wxSplitterScrolledWindow;
  * It also updates the scrolled window vertical scrollbar as appropriate.
  */
 
-class wxRemotelyScrolledTreeCtrl: public wxTreeCtrl
+class GIZMODLLEXPORT wxRemotelyScrolledTreeCtrl: public wxTreeCtrl
 {
-       DECLARE_CLASS(wxRemotelyScrolledTreeCtrl)
+    DECLARE_CLASS(wxRemotelyScrolledTreeCtrl)
 public:
     wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
         const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS);
-       ~wxRemotelyScrolledTreeCtrl();
+    ~wxRemotelyScrolledTreeCtrl();
 
 //// Events
-       void OnSize(wxSizeEvent& event);
-       void OnPaint(wxPaintEvent& event);
-       void OnExpand(wxTreeEvent& event);
+    void OnSize(wxSizeEvent& event);
+    void OnExpand(wxTreeEvent& event);
     void OnScroll(wxScrollWinEvent& event);
+    void OnPaint(wxPaintEvent& event);
 
 //// Overrides
     // Override this in case we're using the generic tree control.
@@ -79,28 +85,79 @@ public:
     // In case we're using the generic tree control.
     virtual void PrepareDC(wxDC& dc);
 
+    // In case we're using the generic tree control.
+    virtual int GetScrollPos(int orient) const;
+
 //// Helpers
-       void HideVScrollbar();
+    void HideVScrollbar();
 
-       // Calculate the tree overall size so we can set the scrollbar
-       // correctly
-       void CalcTreeSize(wxRect& rect);
-       void CalcTreeSize(wxTreeItemId& id, wxRect& rect);
+    // Calculate the tree overall size so we can set the scrollbar
+    // correctly
+    void CalcTreeSize(wxRect& rect);
+    void CalcTreeSize(const wxTreeItemId& id, wxRect& rect);
 
-       // Adjust the containing wxScrolledWindow's scrollbars appropriately
-       void AdjustRemoteScrollbars();
+    // Adjust the containing wxScrolledWindow's scrollbars appropriately
+    void AdjustRemoteScrollbars();
 
-       // Find the scrolled window that contains this control
-       wxScrolledWindow* GetScrolledWindow() const;
+    // Find the scrolled window that contains this control
+    wxScrolledWindow* GetScrolledWindow() const;
 
     // Scroll to the given line (in scroll units where each unit is
     // the height of an item)
     void ScrollToLine(int posHoriz, int posVert);
 
+//// Accessors
+
+    // The companion window is one which will get notified when certain
+    // events happen such as node expansion
+    void SetCompanionWindow(wxWindow* companion) { m_companionWindow = companion; }
+    wxWindow* GetCompanionWindow() const { return m_companionWindow; }
+
+
     DECLARE_EVENT_TABLE()
 protected:
+    wxWindow*   m_companionWindow;
+    bool        m_drawRowLines;
+};
+
+/*
+ * wxTreeCompanionWindow
+ *
+ * A window displaying values associated with tree control items.
+ */
+
+class GIZMODLLEXPORT wxTreeCompanionWindow: public wxWindow
+{
+public:
+    DECLARE_CLASS(wxTreeCompanionWindow)
+
+    wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
+      const wxPoint& pos = wxDefaultPosition,
+      const wxSize& sz = wxDefaultSize,
+      long style = 0);
+
+//// Overrides
+    virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect);
+
+//// Events
+    void OnPaint(wxPaintEvent& event);
+    void OnScroll(wxScrollWinEvent& event);
+    void OnExpand(wxTreeEvent& event);
+
+//// Operations
+
+//// Accessors
+    wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; };
+    void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl) { m_treeCtrl = treeCtrl; }
+
+//// Data members
+protected:
+    wxRemotelyScrolledTreeCtrl* m_treeCtrl;
+
+    DECLARE_EVENT_TABLE()
 };
 
+
 /*
  * wxThinSplitterWindow
  *
@@ -108,7 +165,7 @@ protected:
  * than the usual one.
  */
 
-class wxThinSplitterWindow: public wxSplitterWindow
+class GIZMODLLEXPORT wxThinSplitterWindow: public wxSplitterWindow
 {
 public:
     DECLARE_DYNAMIC_CLASS(wxThinSplitterWindow)
@@ -124,10 +181,10 @@ public:
     // Tests for x, y over sash. Overriding this allows us to increase
     // the tolerance.
     bool SashHitTest(int x, int y, int tolerance = 2);
-       void DrawSash(wxDC& dc);
+    void DrawSash(wxDC& dc);
 
 //// Events
-    
+
     void OnSize(wxSizeEvent& event);
 
 //// Operations
@@ -148,7 +205,7 @@ protected:
  * scroll appropriately.
  */
 
-class wxSplitterScrolledWindow: public wxScrolledWindow
+class GIZMODLLEXPORT wxSplitterScrolledWindow: public wxScrolledWindow
 {
 public:
     DECLARE_DYNAMIC_CLASS(wxSplitterScrolledWindow)
@@ -161,7 +218,7 @@ public:
 //// Overrides
 
 //// Events
-    
+
     void OnScroll(wxScrollWinEvent& event);
     void OnSize(wxSizeEvent& event);