BoxChannelShape.h
gehe zur Dokumentation dieser Datei
00001 // -*- C++ -*-
00115 #ifndef BOXCHANNELSHAPE_H
00116 #define BOXCHANNELSHAPE_H
00117 
00118 //#include <map>
00119 
00120 //#include "wx/defs.h"
00121 //#include "wx/icon.h"
00122 //#include "wx/stattext.h"
00123 
00124 #include "IconShape.h"
00125 #include "Device.h"
00126 #include "InputDeviceShape.h"
00127 class InputFilterPanel;
00128 class RoutePanel;
00129 class OutputFilterPanel;
00130 class MutRouteWnd;
00131 
00132 // OutputDeviceShape.h loads BoxChannelShape.h, so we must define the class here.
00133 class MutOutputDeviceShape;
00134 
00135 class MutBoxChannelShape:public MutIconShape
00136 {
00137         Route *route;
00138         MutInputDeviceShape * input;
00139         MutOutputDeviceShape * output;
00140         virtual MutIcon & GetMutIcon ();
00141 
00142 public:
00143 
00144         MutBoxChannelShape (wxWindow * p = NULL, wxWindowID id = wxID_ANY, 
00145                             Route * r=NULL):MutIconShape(),route(r),input(NULL),output(NULL)
00146         {
00147                 Create (p, id, r);
00148         }
00149 
00150         bool Create (wxWindow * p = NULL, wxWindowID id = wxID_ANY, 
00151                      Route * r=NULL)
00152         { 
00153                 route = r;
00154                 if (!r) return false;
00155                 r->setUserData (this);
00156                 return MutIconShape::Create(p,id);
00157         }
00158         
00159         virtual ~MutBoxChannelShape()
00160         {
00161                 if (route) {
00162                         wxASSERT (route->getUserData() == this);
00163                         route->setUserData (NULL);
00164                 }
00165                 DEBUGLOG(routing,_T("Parent is %p"),m_parent);
00166                 if (m_parent) {
00167                         m_parent->InvalidateBestSize();
00168                         m_parent->SetInitialSize(wxDefaultSize);
00169                         m_parent->Layout();             
00170                 }
00171         }
00172         
00173         void SetInput(MutInputDeviceShape * device);
00174         MutInputDeviceShape * GetInput() { return input; }
00175         Route * GetRoute() const { return route; }
00176         void SetOutput(MutOutputDeviceShape * device, 
00177                                    bool changeRoute = false);
00178         MutOutputDeviceShape * GetOutput() { return output; }
00179 
00180         void AddPossibleOutput(MutOutputDeviceShape * device);
00181 
00182         static void CreateRoutePanel(MutBoxChannelShape * channel, MutRouteWnd * parentwin, wxWindow * routeWindow, int selectBox);
00183         static void InitializeInputFilter(InputFilterPanel * panel, 
00184                                           MutRouteWnd * par,
00185                                           MutBoxChannelShape * shape = NULL);
00186         static void InitializeRoute(RoutePanel * panel, 
00187                                     MutRouteWnd * par,
00188                                     MutBoxChannelShape * shape = NULL,
00189                                     int selectBox = NoBox);
00190                 
00191         static void InitializeOutputFilter(OutputFilterPanel * panel, 
00192                                           MutRouteWnd * par,
00193                                           MutBoxChannelShape * shape = NULL);
00194         virtual void ReadPanel(RoutePanel * panel);
00195 
00196         virtual void DrawLines(wxDC & dc, const wxPoint & parentPosition) const;
00197         virtual wxPoint GetPerimeterPoint(const wxPoint &i,
00198                                           const wxPoint &o,
00199                                           const wxPoint & parentPosition) const;
00200         virtual void Refresh(bool eraseBackground = true, const wxRect* rect = NULL);
00202 
00205         void DetachChannel();
00206 };
00207 
00208 WX_DECLARE_LIST (MutBoxChannelShape, MutBoxChannelShapeList);
00209 
00210 #endif                          /* BOXCHANNELSHAPE_H */
00211 /*
00212  * \}
00213  */

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