Code::Blocks  SVN r11506
watchesdlg.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  */
5 
6 #ifndef WATCHESDLG_H
7 #define WATCHESDLG_H
8 
9 #include <vector>
10 #include <wx/panel.h>
11 #include <wx/popupwin.h>
12 #include <wx/timer.h>
13 
14 #include <cbdebugger_interfaces.h>
15 
16 class wxBoxSizer;
17 class wxPropertyGrid;
19 class wxPGProperty;
20 class WatchesProperty;
21 
22 class WatchesDlg : public wxPanel, public cbWatchesDlg
23 {
24  public:
25  WatchesDlg();
26 
27  wxWindow* GetWindow() { return this; }
28 
29  void UpdateWatches();
30  void AddWatch(cb::shared_ptr<cbWatch> watch);
31  void AddSpecialWatch(cb::shared_ptr<cbWatch> watch, bool readonly);
32  void RemoveWatch(cb::shared_ptr<cbWatch> watch);
33  void RenameWatch(wxObject *prop, const wxString &newSymbol);
34  void RefreshUI();
35  private:
36  void OnExpand(wxPropertyGridEvent &event);
37  void OnCollapse(wxPropertyGridEvent &event);
44  void OnIdle(wxIdleEvent &event);
45  void OnKeyDown(wxKeyEvent &event);
46 
47  void OnMenuRename(wxCommandEvent &event);
48  void OnMenuProperties(wxCommandEvent &event);
49  void OnMenuDelete(wxCommandEvent &event);
50  void OnMenuDeleteAll(wxCommandEvent &event);
52  void OnMenuExamineMemory(cb_unused wxCommandEvent &event);
53  void OnMenuAutoUpdate(wxCommandEvent &event);
54  void OnMenuUpdate(wxCommandEvent &event);
55 
56  DECLARE_EVENT_TABLE()
57 
58  void DeleteProperty(WatchesProperty &prop);
59 
60  struct WatchItem
61  {
62  WatchItem() : readonly(false), special(false) {}
63 
64  cb::shared_ptr<cbWatch> watch;
66  bool readonly;
67  bool special;
68  };
70 
71  typedef std::vector<WatchItem> WatchItems;
72 
74  WatchItems m_watches;
76 };
77 
78 
79 class ValueTooltip :
80 #ifndef __WXMAC__
81  public wxPopupWindow
82 #else
83  public wxWindow
84 #endif
85 {
86  public:
87  ValueTooltip(const cb::shared_ptr<cbWatch> &watch, wxWindow *parent);
88  ~ValueTooltip();
89 
90  void Dismiss();
91  void UpdateWatch();
92  protected:
93  virtual void OnDismiss();
94  private:
95  void Fit();
96  void ClearWatch();
97  private:
98 
99  void OnCollapse(wxPropertyGridEvent &event);
100  void OnExpand(wxPropertyGridEvent &event);
101  void OnTimer(wxTimerEvent &event);
102  private:
106 
109 
110  cb::shared_ptr<cbWatch> m_watch;
111  private:
112  DECLARE_CLASS(ValueTooltip)
113  DECLARE_EVENT_TABLE()
114 };
115 
116 #endif // WATCHESDLG_H
wxWindow * GetWindow()
Definition: watchesdlg.h:27
void OnMenuAddDataBreak(wxCommandEvent &event)
Definition: watchesdlg.cpp:919
cb::shared_ptr< cbWatch > m_watch
Definition: watchesdlg.h:110
void AddSpecialWatch(cb::shared_ptr< cbWatch > watch, bool readonly)
Definition: watchesdlg.cpp:570
WatchesProperty * property
Definition: watchesdlg.h:65
void OnPropertyRightClick(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:764
void OnMenuExamineMemory(cb_unused wxCommandEvent &event)
Definition: watchesdlg.cpp:937
void OnExpand(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:600
void OnMenuDelete(wxCommandEvent &event)
Definition: watchesdlg.cpp:890
int m_outsideCount
Definition: watchesdlg.h:108
void DeleteProperty(WatchesProperty &prop)
Definition: watchesdlg.cpp:681
void OnIdle(wxIdleEvent &event)
Definition: watchesdlg.cpp:652
void OnMenuDeleteAll(wxCommandEvent &event)
Definition: watchesdlg.cpp:900
void OnMenuUpdate(wxCommandEvent &event)
Definition: watchesdlg.cpp:976
void OnMenuAutoUpdate(wxCommandEvent &event)
Definition: watchesdlg.cpp:964
wxPropertyGrid * m_grid
Definition: watchesdlg.h:103
void UpdateWatch(wxPropertyGrid *grid, wxPGProperty *property, cb::shared_ptr< cbWatch > watch, bool readonly)
Definition: watchesdlg.cpp:466
void OnMenuProperties(wxCommandEvent &event)
Definition: watchesdlg.cpp:874
void OnPropertyChanged(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:622
void RenameWatch(wxObject *prop, const wxString &newSymbol)
Definition: watchesdlg.cpp:990
void OnCollapse(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:611
wxPropertyGrid * m_grid
Definition: watchesdlg.h:73
bool m_append_empty_watch
Definition: watchesdlg.h:75
std::vector< WatchItem > WatchItems
Definition: watchesdlg.h:69
void RefreshUI()
wxPanel * m_panel
Definition: watchesdlg.h:105
cb::shared_ptr< cbWatch > watch
Definition: watchesdlg.h:64
void OnKeyDown(wxKeyEvent &event)
Definition: watchesdlg.cpp:709
void AddWatch(cb::shared_ptr< cbWatch > watch)
Definition: watchesdlg.cpp:536
void OnMenuRename(wxCommandEvent &event)
Definition: watchesdlg.cpp:865
void OnPropertySelected(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:665
WatchItems m_watches
Definition: watchesdlg.h:74
void OnPropertyLableEditEnd(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:646
wxBoxSizer * m_sizer
Definition: watchesdlg.h:104
void UpdateWatches()
Definition: watchesdlg.cpp:529
void RemoveWatch(cb::shared_ptr< cbWatch > watch)
Definition: watchesdlg.cpp:591
void OnPropertyChanging(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:628
void OnPropertyLableEditBegin(wxPropertyGridEvent &event)
Definition: watchesdlg.cpp:634
wxTimer m_timer
Definition: watchesdlg.h:107