From: John L. <jr...@us...> - 2007-05-22 03:27:59
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8900/wxLua/modules/wxluadebug/include Modified Files: splttree.h staktree.h Log Message: Changed wxLuaStackDialog to use a wxListCtrl instead of a hacked wxTreeCtrl that tries to be a wxListCtrl. Works better. Removed all code in splttree.h/cpp before removing it completely. Index: staktree.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/staktree.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** staktree.h 26 Feb 2007 05:17:29 -0000 1.17 --- staktree.h 22 May 2007 03:27:54 -0000 1.18 *************** *** 12,20 **** #include "wxluadebug/include/wxluadebugdefs.h" - #include "wxluadebug/include/splttree.h" #include "wxluadebug/include/wxldebug.h" - class WXDLLIMPEXP_WXLUADEBUG wxLuaStackDataWindow; - class WXDLLIMPEXP_WXLUADEBUG wxLuaStackDialog; class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugData; --- 12,17 ---- *************** *** 26,35 **** { ID_WXLUA_STACKDIALOG_COMBO = 2000, ! ID_WXLUA_STACKDIALOG_SCRWIN, ! ID_WXLUA_STACKDIALOG_SPLITWIN, ! ID_WXLUA_STACKDIALOG_STACKTREE, ! ID_WXLUA_STACKDIALOG_VALUE_SPLITWIN, ! ID_WXLUA_STACKDIALOG_VALUE_WIN1, ! ID_WXLUA_STACKDIALOG_VALUE_WIN2 }; --- 23,27 ---- { ID_WXLUA_STACKDIALOG_COMBO = 2000, ! ID_WXLUA_STACKDIALOG_LISTCTRL }; *************** *** 65,70 **** virtual void EnumerateStack(); virtual void EnumerateStackEntry(int nEntry); ! virtual void EnumerateTable(int nRef, int nEntry, const wxTreeItemId& treeId); ! virtual void EnumerateGlobalData(const wxTreeItemId& treeId); // Fill the combobox with the stack entries in the debug data and select --- 57,62 ---- virtual void EnumerateStack(); virtual void EnumerateStackEntry(int nEntry); ! virtual void EnumerateTable(int nRef, int nEntry, long lc_item); ! virtual void EnumerateGlobalData(long lc_item); // Fill the combobox with the stack entries in the debug data and select *************** *** 75,81 **** void FillStackEntry(int nEntry, const wxLuaDebugData& debugData); // Fill a treectrl item with children from the debug data ! void FillTableEntry(wxTreeItemId treeId, const wxLuaDebugData& debugData); ! void GetDerivedAndTrackedItems(wxRemotelyScrolledTreeCtrl *treeControl, const wxTreeItemId& rootItem); // Handle and set the stack from the stack combobox selection --- 67,76 ---- void FillStackEntry(int nEntry, const wxLuaDebugData& debugData); // Fill a treectrl item with children from the debug data ! void FillTableEntry(long lc_item, const wxLuaDebugData& debugData); ! // Add info from the wxLuaState (must be valid) about items the wxLuaState tracks. ! void GetDerivedAndTrackedItems(); ! ! // implementation // Handle and set the stack from the stack combobox selection *************** *** 83,97 **** void SelectStack(int stack_sel); // Handle and expand a treectrl item ! void OnItemExpanding(wxTreeEvent &event); ! void ItemExpanding(const wxTreeItemId &itemId); protected: ! wxRemotelyScrolledTreeCtrl *m_treeControl; ! wxThinSplitterWindow *m_treeSplitter; ! wxThinSplitterWindow *m_valueSplitter; ! wxSplitterScrolledWindow *m_scrolledWindow; ! wxLuaStackDataWindow *m_firstValueWindow; ! wxLuaStackDataWindow *m_secondValueWindow; wxComboBox *m_stackComboBox; // display stack entries int m_stack_sel; // current stack selection (see m_stackComboBox) --- 78,90 ---- void SelectStack(int stack_sel); // Handle and expand a treectrl item ! void OnItemDeleted(wxListEvent &event); ! void OnAllItemsDeleted(wxListEvent &event); ! void OnItemActivated(wxListEvent &event); ! void ItemExpanding(long lc_item); protected: ! void DeleteAllListItemData(); + wxListCtrl *m_listCtrl; wxComboBox *m_stackComboBox; // display stack entries int m_stack_sel; // current stack selection (see m_stackComboBox) *************** *** 110,133 **** }; - // ---------------------------------------------------------------------------- - // wxLuaStackDataWindow - // ---------------------------------------------------------------------------- - - class WXDLLIMPEXP_WXLUADEBUG wxLuaStackDataWindow : public wxTreeCompanionWindow - { - public: - wxLuaStackDataWindow( wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &sz = wxDefaultSize, - long style = 0, bool first_window = true); - - // Overrides - virtual void DrawItem(wxDC &dc, wxTreeItemId id, const wxRect &rect); - - private: - bool m_first_window; - int m_text_height; - DECLARE_ABSTRACT_CLASS(wxLuaStackDataWindow) - }; - #endif //_WX_LUA_STACKTREE_H_ --- 103,105 ---- Index: splttree.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/splttree.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** splttree.h 12 Dec 2006 01:23:40 -0000 1.10 --- splttree.h 22 May 2007 03:27:54 -0000 1.11 *************** *** 12,243 **** // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// - - #ifndef _WX_SPLITTREE_H_ - #define _WX_SPLITTREE_H_ - - #include "wxluadebug/include/wxluadebugdefs.h" - #include "wx/treectrl.h" - #include "wx/splitter.h" - #include "wx/scrolwin.h" - - class WXDLLIMPEXP_WXLUADEBUG wxRemotelyScrolledTreeCtrl; - class WXDLLIMPEXP_WXLUADEBUG wxThinSplitterWindow; - class WXDLLIMPEXP_WXLUADEBUG wxSplitterScrolledWindow; - - - /* If set to 1, then wxGenericTreeCtrl will be used instead of wxTreeCtrl */ - #define USE_GENERIC_TREECTRL 0 - - - - /* - * wxRemotelyScrolledTreeCtrl - * - * This tree control disables its vertical scrollbar and catches scroll - * events passed by a scrolled window higher in the hierarchy. - * It also updates the scrolled window vertical scrollbar as appropriate. - */ - - class WXDLLIMPEXP_WXLUADEBUG wxRemotelyScrolledTreeCtrl : public wxTreeCtrl - { - public: - wxRemotelyScrolledTreeCtrl(wxWindow* parent, - wxWindowID id, - const wxPoint &pt = wxDefaultPosition, - const wxSize &sz = wxDefaultSize, - long style = wxTR_HAS_BUTTONS); - virtual ~wxRemotelyScrolledTreeCtrl(); - - //// Events - void OnSize(wxSizeEvent& event); - void OnExpand(wxTreeEvent& event); - void OnScroll(wxScrollWinEvent& event); - void OnPaint(wxPaintEvent& event); - void OnSelChanged(wxTreeEvent& event); - - //// Overrides - // Override this in case we're using the generic tree control. - // Calls to this should disable the vertical scrollbar. - - // Number of pixels per user unit (0 or -1 for no scrollbar) - // Length of virtual canvas in user units - // Length of page in user units - virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, - int noUnitsX, int noUnitsY, - int xPos = 0, int yPos = 0, - bool noRefresh = false ); - - virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const; - virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; - - // In case we're using the generic tree control. - // Get the view start - virtual void GetViewStart(int *x, int *y) const; - - // 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(); - - // 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(); - - // 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); - - void DeleteAllItems(); - - //// Accessors - - // The companion window is one which will get notified when certain - // events happen such as node expansion - void SetCompanionWindows(wxWindow* firstCompanion, - wxWindow* secondCompanion = NULL) - { - m_firstCompanionWindow = firstCompanion; - m_secondCompanionWindow = secondCompanion; - } - - wxWindow* GetFirstCompanionWindow() const - { - return m_firstCompanionWindow; - } - - wxWindow* GetSecondCompanionWindow() const - { - return m_secondCompanionWindow; - } - - protected: - wxWindow *m_firstCompanionWindow; - wxWindow *m_secondCompanionWindow; - bool m_drawRowLines; - wxTreeItemId &m_lastTreeItemId; - - private: - DECLARE_ABSTRACT_CLASS(wxRemotelyScrolledTreeCtrl) - DECLARE_EVENT_TABLE() - }; - - /* - * wxTreeCompanionWindow - * - * A window displaying values associated with tree control items. - */ - - class WXDLLIMPEXP_WXLUADEBUG wxTreeCompanionWindow: public wxWindow - { - public: - wxTreeCompanionWindow(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - long style = 0); - - virtual ~wxTreeCompanionWindow(); - - //// Overrides - virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect); - - //// Events - void OnPaint(wxPaintEvent& event); - void OnScroll(wxScrollWinEvent& event); - void OnExpand(wxTreeEvent& event); - void OnSelChanged(wxTreeEvent& event); - - //// Accessors - wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const - { - return m_treeControl; - } - - void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeControl) - { - m_treeControl = treeControl; - } - - //// Data members - protected: - wxRemotelyScrolledTreeCtrl *m_treeControl; - - private: - DECLARE_ABSTRACT_CLASS(wxTreeCompanionWindow) - DECLARE_EVENT_TABLE() - }; - - - /* - * wxThinSplitterWindow - * - * Implements a splitter with a less obvious sash - * than the usual one. - */ - - class WXDLLIMPEXP_WXLUADEBUG wxThinSplitterWindow : public wxSplitterWindow - { - public: - wxThinSplitterWindow(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - long style = wxSP_3D | wxCLIP_CHILDREN); - - //// Overrides - - void SizeWindows(); - // 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); - - //// Events - - void OnSize(wxSizeEvent& event); - - protected: - DECLARE_ABSTRACT_CLASS(wxThinSplitterWindow) - DECLARE_EVENT_TABLE() - }; - - /* - * wxSplitterScrolledWindow - * - * This scrolled window is aware of the fact that one of its - * children is a splitter window. It passes on its scroll events - * (after some processing) to both splitter children for them - * scroll appropriately. - */ - - class WXDLLIMPEXP_WXLUADEBUG wxSplitterScrolledWindow: public wxScrolledWindow - { - public: - wxSplitterScrolledWindow(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &sz = wxDefaultSize, - long style = 0); - - //// Events - - void OnScroll(wxScrollWinEvent& event); - void OnSize(wxSizeEvent& event); - - private: - DECLARE_ABSTRACT_CLASS(wxSplitterScrolledWindow) - DECLARE_EVENT_TABLE() - }; - - #endif // _SPLITTREE_H_ --- 12,13 ---- |