From: John L. <jr...@us...> - 2007-06-16 06:21:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19284/wxLua/modules/wxluadebug/include Modified Files: wxldebug.h wxlstack.h Log Message: Add back the wxTreeCtrl into the stack dialog, on left of listctrl so you get both for easier navigation. Added functions to the wxlua.XXX table to get info about the status of wxLua Use qsort and bsearch to find the class methods ~ %25 faster Make wxLuaDebugData not always create it's ref data so it can !Ok() Index: wxldebug.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxldebug.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wxldebug.h 6 Jun 2007 03:53:40 -0000 1.35 --- wxldebug.h 16 Jun 2007 06:21:47 -0000 1.36 *************** *** 41,48 **** WXLUA_DEBUGITEM_TCFUNCTION = 11, // LUA_TFUNCTION & lua_iscfunction, not a LUA_TXXX ! WXLUA_DEBUGITEM_T_COUNT = 12, // # of T items ! WXLUA_DEBUGITEM_T_MASK = 0x00ff, ! WXLUA_DEBUGITEM_EXPANDED = 0x0200 }; --- 41,52 ---- WXLUA_DEBUGITEM_TCFUNCTION = 11, // LUA_TFUNCTION & lua_iscfunction, not a LUA_TXXX ! WXLUA_DEBUGITEM__TCOUNT = 12, // # of T items ! WXLUA_DEBUGITEM__TMASK = 0x00ff, ! WXLUA_DEBUGITEM_EXPANDABLE = 0x0200, // for wxLuaStackDialog ! WXLUA_DEBUGITEM_EXPANDED = 0x0400, // for wxLuaStackDialog ! WXLUA_DEBUGITEM_LUAREFED = 0x0800 // This item was created with a ! // new tinsert() reference ! // rather than using an existing one. }; *************** *** 67,74 **** int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } ! int GetTypeN() const { return m_flag & WXLUA_DEBUGITEM_T_MASK; } void SetFlag(int flag) { m_flag = flag; } void SetFlagBit(int bit, bool set) { m_flag = WXLUA_SETBIT(m_flag, bit, set); } // Get a human readable string for debugging --- 71,79 ---- int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } ! int GetTypeN() const { return m_flag & WXLUA_DEBUGITEM__TMASK; } void SetFlag(int flag) { m_flag = flag; } void SetFlagBit(int bit, bool set) { m_flag = WXLUA_SETBIT(m_flag, bit, set); } + void SetReference(int lua_ref) { m_lua_ref = lua_ref; } // only if you're tremoved it // Get a human readable string for debugging *************** *** 100,111 **** // ---------------------------------------------------------------------------- class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugData : public wxObject { public: ! wxLuaDebugData(); wxLuaDebugData(const wxLuaDebugData &debugData) { Ref(debugData); } virtual ~wxLuaDebugData() {} // make gcc happy even though it's not used // Get the data array, please use safe array access functions if possible wxLuaDebugItemArray* GetArray(); --- 105,122 ---- // ---------------------------------------------------------------------------- + // an invalid wxLuaState for comparison (like wxNullBitmap) + extern WXDLLIMPEXP_DATA_WXLUA(wxLuaDebugData) wxNullLuaDebugData; + class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugData : public wxObject { public: ! wxLuaDebugData(bool create); wxLuaDebugData(const wxLuaDebugData &debugData) { Ref(debugData); } virtual ~wxLuaDebugData() {} // make gcc happy even though it's not used + // Has this been created with it's ref data? + bool Ok() const { return (m_refData != NULL); } + // Get the data array, please use safe array access functions if possible wxLuaDebugItemArray* GetArray(); Index: wxlstack.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxlstack.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlstack.h 31 May 2007 17:18:54 -0000 1.2 --- wxlstack.h 16 Jun 2007 06:21:47 -0000 1.3 *************** *** 12,16 **** #include "wx/dialog.h" ! #include "wx/listctrl.h" #include "wxluadebug/include/wxluadebugdefs.h" --- 12,20 ---- #include "wx/dialog.h" ! #include "wx/treectrl.h" ! ! class WXDLLEXPORT wxListCtrl; ! class WXDLLEXPORT wxListEvent; ! class WXDLLEXPORT wxSplitterWindow; #include "wxluadebug/include/wxluadebugdefs.h" *************** *** 31,35 **** ID_WXLUA_STACK_FINDPREV_BUTTON, ID_WXLUA_STACK_FINDCASE_CHECKBOX, ! ID_WXLUA_STACK_LISTCTRL }; --- 35,75 ---- ID_WXLUA_STACK_FINDPREV_BUTTON, ID_WXLUA_STACK_FINDCASE_CHECKBOX, ! ID_WXLUA_STACK_SPLITTERWIN, ! ID_WXLUA_STACK_LISTCTRL, ! ID_WXLUA_STACK_TREECTRL ! }; ! ! // ---------------------------------------------------------------------------- ! // wxLuaStackListData - the data we store in the wxListCtrl item's data ! // ---------------------------------------------------------------------------- ! ! class WXDLLIMPEXP_WXLUADEBUG wxLuaStackListData ! { ! public: ! wxLuaStackListData(int item_idx, ! const wxLuaDebugData& parentDebugData, ! const wxLuaDebugData& childrenDebugData = wxNullLuaDebugData) : ! m_item_idx(item_idx), ! m_parentDebugData(parentDebugData), ! m_childrenDebugData(childrenDebugData) {} ! ! wxLuaDebugItem* GetDebugItem() { return m_parentDebugData.Item(m_item_idx); } ! ! int m_item_idx; ! wxLuaDebugData m_parentDebugData; ! wxLuaDebugData m_childrenDebugData; ! wxTreeItemId m_treeId; ! }; ! ! // ---------------------------------------------------------------------------- ! // wxLuaStackListData - the data we store in the wxTreeCtrl item's data ! // ---------------------------------------------------------------------------- ! ! class WXDLLIMPEXP_WXLUADEBUG wxLuaStackTreeData : public wxTreeItemData ! { ! public: ! wxLuaStackTreeData(wxLuaStackListData* stkData) : m_stkListData(stkData) {} ! ! wxLuaStackListData* m_stkListData; // we don't delete this }; *************** *** 108,111 **** --- 148,154 ---- // implementation + wxTreeItemId FindTreeItemId(const wxTreeItemId& id, wxLuaStackListData* stkListData) const; + long FindListItem(wxLuaStackListData* stkListData, bool get_parent = false) const; + void OnExpandButton(wxCommandEvent& event); void OnFind(wxCommandEvent& event); *************** *** 114,127 **** void OnSelectStack(wxCommandEvent &event); void SelectStack(int stack_sel); ! // Handle and expand a listctrl item ! void OnItemDeleted(wxListEvent &event); ! void OnAllItemsDeleted(wxListEvent &event); ! void OnItemActivated(wxListEvent &event); bool ExpandItem(long lc_item, bool show_err_msg = true); protected: void DeleteAllListItemData(); ! wxListCtrl* m_listCtrl; wxChoice* m_stackChoice; // display stack entries --- 157,177 ---- void OnSelectStack(wxCommandEvent &event); void SelectStack(int stack_sel); ! // Handle all wxTreeCtrl events ! void OnTreeItem(wxTreeEvent &event); ! // Handle and expand/collapse a listctrl item ! void OnListItemActivated(wxListEvent &event); bool ExpandItem(long lc_item, bool show_err_msg = true); + bool CollapseItem(long lc_item); + + void OnListItemDeleted(wxListEvent &event); + void OnListAllItemsDeleted(wxListEvent &event); protected: void DeleteAllListItemData(); + void RemoveAllLuaReferences(); ! wxSplitterWindow* m_splitterWin; ! wxListCtrl* m_listCtrl; ! wxTreeCtrl* m_treeCtrl; wxChoice* m_stackChoice; // display stack entries |