DeviceShape.h
gehe zur Dokumentation dieser Datei
00001 // -*- C++ -*-
00061 #ifndef DEVICESHAPE_H
00062 #define DEVICESHAPE_H
00063 
00064 #ifdef HAVE_CONFIG_H
00065 #include "config.h"
00066 #endif
00067 
00068 #include <map>
00069 
00070 //#include "wx/defs.h"
00071 //#include "wx/ogl/ogl.h"
00072 //#include "wx/icon.h"
00073 //#include "wx/stattext.h"
00074 
00075 #include "DeviceShape.h"
00076 #include "IconShape.h"
00077 #include "Route.h"
00078 //#include "Device.h"
00079 
00080 class InputDevDlg;
00081 
00082 class MutDeviceShape:public MutIconShape
00083 {
00084         //      wxFileName filename;
00085         class strptrless {
00086         public:
00087                 bool operator () (wxString * a, wxString * b) {
00088                         if (a == b) return true;
00089                         if (a == NULL) return true;
00090                         if (b == NULL) return false;
00091                         return (*a <= *b);
00092                 }
00093         };
00094 
00095 public:
00096 
00097         typedef std::map<wxString *, MutDeviceShape *, strptrless> 
00098         stringmaptype;
00099         typedef stringmaptype::iterator stringmapiterator;
00100   
00101         MutDeviceShape():MutIconShape() 
00102                 {
00103                 }
00104         MutDeviceShape (wxWindow * parent, wxWindowID id, 
00105                         const wxString & name = wxEmptyString):
00106                 MutIconShape()
00107                 {
00108                         Create(parent, id, name);
00109                 }
00110 
00111         virtual ~MutDeviceShape() {}
00112  
00113         bool Create (wxWindow * parent, wxWindowID id, 
00114                      const wxString & name = wxEmptyString)
00115                 {
00116 
00117 
00118                         DEBUGLOG(other, _T(""));
00119                         DEBUGLOG(other, _T("Name %s"),name.c_str());
00120                         bool state = MutIconShape::Create (parent,id);
00121                         if (state) SetLabel(name);
00122                         return state;
00123                 }
00124         
00125         virtual bool Recompute();
00126         virtual Route * getRoutes() = 0;
00127         virtual void DoLeftDblClick() = 0;
00128         void LeftDblClickEvent (wxMouseEvent & event) {
00129                 DoLeftDblClick();
00130         }
00131 
00132 #if 0
00133 protected:
00134         void RemoveFromStringMap(stringmaptype & sm) {
00135                 std::pair<stringmapiterator,stringmapiterator> 
00136                         bounds = sm.equal_range(&m_label);
00137                 for (stringmapiterator it = bounds.first; 
00138                      it != bounds.second; ++it) {
00139                         if ((*it).second == this) {
00140                                 stringmapiterator it1 = it;
00141                                 it++;
00142                                 sm.erase(it1);
00143                         }
00144                 }
00145         }
00146 
00147         void InsertSelfToStringMap(stringmaptype & sm) {
00148                 sm.insert(std::make_pair(&m_label,this)); 
00149         }
00150 #endif
00151 private:
00152   DECLARE_DYNAMIC_CLASS(MutIconShape);
00153   DECLARE_EVENT_TABLE();
00154 };
00155 
00156 WX_DECLARE_LIST (MutDeviceShape, MutDeviceShapeList);
00157 
00158 #endif                          /* DEVICESHAPE_H */
00159 /*
00160  * \}
00161  */

Erzeugt am Sun Aug 21 2011 10:51:55 für Mutabor von doxygen 1.7.4