1 /* 2 * This file is licensed under the GNU General Public License, version 3 3 * http://www.gnu.org/licenses/gpl-3.0.html 4 */ 5 6 #ifndef WORKSPACEBROWSERF_H 7 #define WORKSPACEBROWSERF_H 8 9 #include <sdk.h> 10 #ifndef CB_PRECOMP 11 #include <wx/panel.h> 12 #include <wx/bmpbuttn.h> 13 14 #include <settings.h> 15 #include <cbplugin.h> 16 #include <manager.h> 17 #endif 18 19 #include "workspacebrowserbuilder.h" 20 21 class NativeParserF; 22 class wxComboBox; 23 class wxTreeCtrl; 24 class wxTextCtrl; 25 class cbProject; 26 27 class WorkspaceBrowserF : public wxPanel 28 { 29 public: 30 // class constructor 31 WorkspaceBrowserF(wxWindow* parent, NativeParserF* np, ParserF* par); 32 void CreateControlsWBF(); 33 // class destructor 34 ~WorkspaceBrowserF(); GetBrowserDisplayFilter()35 BrowserDisplayFilter GetBrowserDisplayFilter() { return m_BrowserOptions.displayFilter; } 36 void UpdateSash(); 37 void UpdateView(); 38 int GetTokenKindImageIdx(TokenF* token); 39 void MarkSymbol(wxString filename, int line); 40 void SelectSymbol(wxString filename, int line); 41 void RereadOptions(); 42 void DeleteAllItems(); 43 void OnMenuEditPaste(wxCommandEvent& event); GetActiveFilename()44 wxString GetActiveFilename() { return m_ActiveFilename; }; 45 void SetActiveProject(cbProject* prj); 46 47 private: 48 friend class myTextCtrl; 49 void OnTreeItemDoubleClick(wxTreeEvent& event); 50 void OnTreeItemRightClick(wxTreeEvent& event); 51 void OnJumpTo(wxCommandEvent& event); 52 void OnRefreshTree(wxCommandEvent& event); 53 void OnForceReparse(wxCommandEvent& event); 54 void OnViewScope(wxCommandEvent& event); 55 void JumpToToken(TokenF* token); 56 void OnChangeSort(wxCommandEvent& event); 57 void OnChangeMode(wxCommandEvent& event); 58 59 void OnMakeVisible(wxCommandEvent& event); 60 void OnSearch(wxCommandEvent& event); 61 size_t FindMatchTokens(wxString search, TokensArrayF& result); 62 63 void ShowMenu(wxTreeCtrl* tree, wxTreeItemId id, const wxPoint& pt); 64 65 void BuildTree(); 66 67 void OnTreeItemSelected(wxTreeEvent& event); 68 void OnTreeItemExpanding(wxTreeEvent& event); 69 void OnTreeItemCollapsing(wxTreeEvent& event); 70 71 wxBitmapButton* m_BtnHome; 72 wxChoice* m_CmbViewWBF; 73 wxPanel* m_WBFMainPanel; 74 wxSplitterWindow* m_SplitterWin; 75 76 NativeParserF* m_NativeParser; 77 wxTreeCtrl* m_TreeTop; 78 wxTreeCtrl* m_TreeBottom; 79 wxComboBox* m_Search; 80 wxTreeCtrl* m_TreeForPopupMenu; 81 ParserF* m_pParser; 82 wxTreeItemId m_RootNode; 83 84 // filtering 85 wxString m_ActiveFilename; 86 cbProject* m_pActiveProject; 87 88 WorkspaceBrowserBuilder* m_pBrowserBuilder; 89 90 BrowserOptions m_BrowserOptions; 91 92 DECLARE_EVENT_TABLE() 93 }; 94 95 #endif // WORKSPACEBROWSERF_H 96 97