bbtkWxGUIPackageBrowser2.h
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
00031
00048 #ifdef _USE_WXWIDGETS_
00049
00050
00051 #ifndef __bbtkWxGUIPackageBrowser2_h__
00052 #define __bbtkWxGUIPackageBrowser2_h__
00053
00054
00055 #include "bbtkWx.h"
00056
00057 #include "bbtkInterpreter.h"
00058 #include <wx/aui/aui.h>
00059
00060 #include "wx/listctrl.h"
00061
00062
00063 #if defined(__WXMOTIF__) || defined(__WXPM__) || defined(__WXX11__) || defined(__WXMGL__)
00064 #define USE_CONTEXT_MENU 0
00065 #else
00066 #define USE_CONTEXT_MENU 1
00067 #endif
00068
00069
00070 namespace bbtk
00071 {
00072
00073 class WxGUIPackageBrowser2;
00074
00075
00076
00077
00079 class BBTK_EXPORT WxGUIPackageBrowser2User
00080 {
00081 public:
00082 WxGUIPackageBrowser2User() {}
00083 virtual ~WxGUIPackageBrowser2User() {}
00085 virtual void WxGUIPackageBrowser2Run() {}
00086 };
00087
00088
00089
00090
00091 class WxGUIBlackBoxInfo : public wxPanel
00092 {
00093 public:
00094 WxGUIBlackBoxInfo(wxWindow* parent);
00095 ~WxGUIBlackBoxInfo();
00096
00097 void UpdateInfo(BlackBoxDescriptor* descr);
00098 void InsertInputOutput(wxListCtrl* l, BlackBoxInputOutputDescriptor* i);
00099 private:
00100 BlackBoxDescriptor* mDescriptor;
00101 wxStaticText* mName;
00102 wxStaticText* mDescription;
00103 wxStaticText* mAuthor;
00104 wxStaticText* mCategory;
00105
00106 wxListCtrl* mInputList;
00107 wxListCtrl* mOutputList;
00108 } ;
00109
00110
00111
00112 class WxGUIBlackBoxListUser
00113 {
00114 public:
00115 WxGUIBlackBoxListUser() {}
00116 virtual ~WxGUIBlackBoxListUser() {}
00117
00118
00119 virtual void WxGUIBlackBoxListUserOnSelected( BlackBoxDescriptor* ) {}
00120 };
00121
00122
00123
00124 class WxGUIBlackBoxList: public wxListCtrl
00125 {
00126 public:
00127 WxGUIBlackBoxList(wxWindow *parent,
00128 const wxWindowID id,
00129 const wxPoint& pos,
00130 const wxSize& size,
00131 long style);
00132
00133
00134 void SetUser(WxGUIBlackBoxListUser* u) { mUser = u; }
00135
00136
00137 void Insert(BlackBoxDescriptor::Pointer d);
00138
00139
00140 void OnColClick(wxListEvent& event);
00141 void OnColRightClick(wxListEvent& event);
00142 void OnColBeginDrag(wxListEvent& event);
00143 void OnColDragging(wxListEvent& event);
00144 void OnColEndDrag(wxListEvent& event);
00145 void OnBeginDrag(wxListEvent& event);
00146 void OnBeginRDrag(wxListEvent& event);
00147 void OnBeginLabelEdit(wxListEvent& event);
00148 void OnEndLabelEdit(wxListEvent& event);
00149 void OnDeleteItem(wxListEvent& event);
00150 void OnDeleteAllItems(wxListEvent& event);
00151 #if WXWIN_COMPATIBILITY_2_4
00152 void OnGetInfo(wxListEvent& event);
00153 void OnSetInfo(wxListEvent& event);
00154 #endif
00155 void OnSelected(wxListEvent& event);
00156 void OnDeselected(wxListEvent& event);
00157 void OnListKeyDown(wxListEvent& event);
00158 void OnActivated(wxListEvent& event);
00159 void OnFocused(wxListEvent& event);
00160 void OnCacheHint(wxListEvent& event);
00161
00162 void OnChar(wxKeyEvent& event);
00163
00164 #if USE_CONTEXT_MENU
00165 void OnContextMenu(wxContextMenuEvent& event);
00166 #endif
00167
00168 void OnRightClick(wxMouseEvent& event);
00169
00170 private:
00171 void ShowContextMenu(const wxPoint& pos);
00172
00173 void SetColumnImage(int col, int image);
00174
00175 void LogEvent(const wxListEvent& event, const wxChar *eventName);
00176 void LogColEvent(const wxListEvent& event, const wxChar *eventName);
00177
00178 virtual wxString OnGetItemText(long item, long column) const;
00179 virtual int OnGetItemColumnImage(long item, long column) const;
00180 virtual wxListItemAttr *OnGetItemAttr(long item) const;
00181
00182 WxGUIBlackBoxListUser* mUser;
00183
00184 wxListItemAttr m_attr;
00185
00186
00187 DECLARE_EVENT_TABLE()
00188 };
00189
00190
00191
00193 class BBTK_EXPORT WxGUIPackageBrowser2 : public wxPanel,
00194 public WxGUIBlackBoxListUser
00195 {
00196 public:
00197 WxGUIPackageBrowser2( wxWindow *parent,
00198 WxGUIPackageBrowser2User* user = 0 );
00199 ~WxGUIPackageBrowser2();
00200
00201 void IncludeAll();
00202 void BuildFromFactory(Factory::Pointer f);
00203 void RebuildList();
00204 bool IsVisible(BlackBoxDescriptor::Pointer d);
00205
00206 void OnFilter(wxCommandEvent&);
00207
00208
00209 void WxGUIBlackBoxListUserOnSelected( BlackBoxDescriptor* );
00210
00211 private:
00212 wxAuiManager m_mgr;
00213 WxGUIPackageBrowser2User* mUser;
00214 Interpreter::Pointer mInterpreter;
00215 Factory::Pointer mFactory;
00216 WxGUIBlackBoxList* mBoxList;
00217 WxGUIBlackBoxInfo* mBoxInfo;
00218
00219 wxTextCtrl* mPackageFilter;
00220 wxTextCtrl* mNameFilter;
00221 wxTextCtrl* mDescriptionFilter;
00222 wxTextCtrl* mCategoryFilter;
00223 wxTextCtrl* mInputTypeFilter;
00224 wxTextCtrl* mOutputTypeFilter;
00225 wxTextCtrl* mInputNatureFilter;
00226 wxTextCtrl* mOutputNatureFilter;
00227
00228 wxCheckBox* mShowWidgetsFilter;
00229 wxCheckBox* mShowAdaptorsFilter;
00230 wxCheckBox* mShowGUIsFilter;
00231
00232 DECLARE_EVENT_TABLE()
00233 };
00234
00235
00236
00237
00239 class BBTK_EXPORT WxGUIPackageBrowser2Window : public wxFrame
00240
00241 {
00242 public:
00243 WxGUIPackageBrowser2Window( wxWindow *parent, wxString title, wxSize size);
00244 ~WxGUIPackageBrowser2Window();
00245
00246
00247
00248
00249 private :
00250
00251 WxGUIPackageBrowser2* mBrowser;
00252 };
00253
00254
00255
00256 }
00257
00258
00259 #endif // __bbtkWxGUIPackageBrowser_h__
00260
00261 #endif //_USE_WXWIDGETS_