Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RXTOOLS_ROSOUT_LIST_CONTROL_H_
00031 #define RXTOOLS_ROSOUT_LIST_CONTROL_H_
00032
00033 #include <wx/wx.h>
00034 #include <wx/listctrl.h>
00035
00036 #include "rosgraph_msgs/Log.h"
00037
00038 #include <boost/function.hpp>
00039
00040 #include <set>
00041
00042 namespace rxtools
00043 {
00044
00045 class RosoutPanel;
00046
00047 namespace columns
00048 {
00049 enum Column
00050 {
00051 Message,
00052 Severity,
00053 Node,
00054 Time,
00055 Topics,
00056 Location,
00057 };
00058 }
00059 typedef columns::Column Column;
00060
00061 typedef std::set<int32_t> S_int32;
00062
00070 class RosoutListControl : public wxListCtrl
00071 {
00072 public:
00076 RosoutListControl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON,
00077 const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr);
00081 virtual ~RosoutListControl();
00082
00083 void setModel(RosoutPanel* model);
00084
00090 wxString getSeverityText(const rosgraph_msgs::LogConstPtr& message) const;
00095 const S_int32& getSelection()
00096 {
00097 updateSelection();
00098 return selection_;
00099 }
00100
00101 void setSelection(const S_int32& sel);
00102
00103 void preItemChanges();
00104 void postItemChanges();
00105
00106 void copySelectionToClipboard(bool message_only);
00107
00108 protected:
00109
00110 rosgraph_msgs::LogConstPtr getSelectedMessage();
00111 void updateSelection();
00112
00113
00114 void onItemActivated(wxListEvent& event);
00115 void onItemSelected(wxListEvent& event);
00116 void onItemRightClick(wxListEvent& event);
00117
00118 void onCopy(wxCommandEvent& event);
00119 void onCopyMessageOnly(wxCommandEvent& event);
00120 void onChar(wxKeyEvent& event);
00121 void onIncludeLocation(wxCommandEvent& event);
00122 void onIncludeNode(wxCommandEvent& event);
00123 void onIncludeMessage(wxCommandEvent& event);
00124 void onIncludeLocationNewWindow(wxCommandEvent& event);
00125 void onIncludeNodeNewWindow(wxCommandEvent& event);
00126 void onIncludeMessageNewWindow(wxCommandEvent& event);
00127 void onExcludeLocation(wxCommandEvent& event);
00128 void onExcludeNode(wxCommandEvent& event);
00129 void onExcludeMessage(wxCommandEvent& event);
00130 void onExcludeLocationNewWindow(wxCommandEvent& event);
00131 void onExcludeNodeNewWindow(wxCommandEvent& event);
00132 void onExcludeMessageNewWindow(wxCommandEvent& event);
00133
00134
00135 virtual wxListItemAttr * OnGetItemAttr(long item) const;
00136 virtual wxString OnGetItemText(long item, long column) const;
00137 virtual int OnGetItemImage(long item) const;
00138
00139 mutable wxListItemAttr attr_;
00140
00141 RosoutPanel* model_;
00142
00143 int32_t error_image_id_;
00144 int32_t warning_image_id_;
00145 int32_t fatal_image_id_;
00146 int32_t info_image_id_;
00147 int32_t debug_image_id_;
00148
00149 S_int32 selection_;
00150 int32_t last_selection_;
00151
00152 bool scrollbar_at_bottom_;
00153 bool disable_scroll_to_bottom_;
00154
00155
00156
00157 #if __WXMAC__
00158 bool manual_selection_;
00159 #endif
00160 };
00161
00162 }
00163
00164 #endif