BoxDlg.h
gehe zur Dokumentation dieser Datei
00001 
00056 // ---------------------------------------------------------------------------
00057 // headers
00058 // ---------------------------------------------------------------------------
00059 
00060 // For compilers that support precompilation, includes "wx/wx.h".
00061 #include "Defs.h"
00062 #include <wx/wxprec.h>
00063 
00064 #ifdef __BORLANDC__
00065 #pragma hdrstop
00066 #endif
00067 
00068 
00069 
00070 
00071 #ifndef _BOXDLG_H_
00072 #define _BOXDLG_H_
00073 
00074 typedef NoBoxSettingsBase NoBoxSettings;
00075 typedef GuidoFileBoxSettingsBase GuidoFileBoxSettings;
00076 
00077 class MutaborBoxSettings: public MutaborBoxSettingsBase {
00078 public:
00079         MutaborBoxSettings(wxWindow * parent):MutaborBoxSettingsBase(parent) {}
00080         virtual ~MutaborBoxSettings() {}
00081         void SetBoxNumber(int nr);
00082         int GetBoxNumber() const 
00083         { 
00084                 wxASSERT(boxNumber);
00085                 if (!boxNumber) return -99;
00086                 return boxNumber -> GetValue(); 
00087         }
00088 };
00089 
00090 class InputFilterPanel : public InputFilterPanelBase {
00091         class InputShapeData: public wxClientData {
00092                 MutInputDeviceShape * device;
00093         public:
00094                 InputShapeData(MutInputDeviceShape * b):wxClientData() { device = b; }
00095                 MutInputDeviceShape * GetDevice() { return device; }
00096         };
00097         
00098 public:
00099         InputFilterPanel(wxWindow * parent):InputFilterPanelBase(parent) {}
00100         wxChoicebook * GetInputDeviceBook() { return inputDevice; }
00101         void AddPage(wxPanel * panel, const wxString &label, bool selected, MutInputDeviceShape * shape);
00102         wxWindow * GetCurrentDevicePage() ;
00103         MutInputDeviceShape * GetCurrentSelection();
00104 };
00105 
00106 class OutputFilterPanel : public OutputFilterPanelBase {
00107         class OutputShapeData: public wxClientData {
00108                 MutOutputDeviceShape * device;
00109         public:
00110                 OutputShapeData(MutOutputDeviceShape * b):wxClientData() { device = b; }
00111                 MutOutputDeviceShape * GetDevice() { return device; }
00112         };
00113 public:
00114         OutputFilterPanel(wxWindow * parent):OutputFilterPanelBase(parent) {}
00115         wxChoicebook * GetOutputDeviceBook() { return outputDevice; }
00116         void AddPage(wxPanel * panel, const wxString &label, bool selected, MutOutputDeviceShape * shape);
00117         wxWindow * GetCurrentDevicePage() ;
00118         MutOutputDeviceShape * GetCurrentSelection();
00119 };
00120 
00121 class MutBoxShape;
00122 class MutBoxChannelShape;
00123 
00124 class RoutePanel:public RoutePanelBase {
00125         DECLARE_DYNAMIC_CLASS( RoutePanel )
00126                 
00127 protected:
00128         class BoxShapeData: public wxClientData {
00129                 MutBoxShape * box;
00130         public:
00131                 BoxShapeData(MutBoxShape * b):wxClientData() { box = b; }
00132                 MutBoxShape * GetBox() { return box; }
00133         };
00134         InputFilterPanel * inPanel;
00135         OutputFilterPanel * outPanel;
00136         MutBoxChannelShape * channel;
00137 public:
00138         RoutePanel():RoutePanelBase()
00139         {
00140                 inPanel = NULL;
00141                 outPanel = NULL;
00142                 channel = NULL;
00143         }
00144         
00145         RoutePanel(wxWindow * parent):RoutePanelBase(parent) 
00146         {
00147                 inPanel = NULL;
00148                 outPanel = NULL;
00149                 channel = NULL;
00150         }
00151         
00152         bool GetActive() {
00153                 return active->GetValue();
00154         }
00155         void SetActive(bool val) {
00156                 active->SetValue(val);
00157                 passive->SetValue(!val);
00158         }
00159         bool GetPassive() {
00160                 return passive->GetValue();
00161         }
00162         void SetPassive(bool val) {
00163                 passive->SetValue(val);
00164                 active->SetValue(!val);
00165         }
00166         
00167         void SetBox(MutBoxShape * box) { STUBC; }
00168         MutBoxShape * GetBox();
00169         void SetInput(InputFilterPanel * in) { inPanel = in; }
00170         InputFilterPanel * GetInput() const { return inPanel; }
00171         void SetOutput(OutputFilterPanel * out) { outPanel = out; }
00172         OutputFilterPanel * GetOutput() const { return outPanel; }
00173         void SetChannel(MutBoxChannelShape * ch) { channel = ch; }
00174         MutBoxChannelShape * GetChannel() const { return channel; }
00175         wxChoice * GetBoxChoice() { return box; }
00176         int AddBox(MutBoxShape * boxShape, bool selected = false);
00177         
00178         void EnableRoute(bool enable = true);
00179         
00180 };
00181 
00182 class RouteRemoveButton: public wxButton {
00183 public:
00184         RouteRemoveButton():wxButton() { panel = NULL; }
00185         RouteRemoveButton(RoutePanel * route, wxWindow* parent, wxWindowID id = wxID_REMOVE, const wxString&  label = wxEmptyString, 
00186                  const wxPoint&  pos = wxDefaultPosition, const wxSize&  size = wxDefaultSize, 
00187                           long style = 0, const wxValidator&  validator = wxDefaultValidator, const wxString&  name = wxButtonNameStr):wxButton() {
00188                 Create(route, parent, id, label, pos, size, style, validator, name);
00189         }
00190 
00191         bool Create(RoutePanel * route, wxWindow* parent, wxWindowID id = wxID_REMOVE, const wxString&  label = wxEmptyString, 
00192                           const wxPoint&  pos = wxDefaultPosition, const wxSize&  size = wxDefaultSize, 
00193                     long style = 0, const wxValidator&  validator = wxDefaultValidator, const wxString&  name = wxButtonNameStr);
00194         
00195         void EnableRoute(bool enable = true);
00196                 
00197 protected:
00198         RoutePanel * panel;
00199         void RemoveButtonPressed( wxCommandEvent& event );
00200         DECLARE_DYNAMIC_CLASS( RouteRemoveButton )
00201         DECLARE_EVENT_TABLE()
00202 };
00203 
00204 class BoxDlg:public BoxDlgBase {
00205         wxChoice * boxTypeChoice;
00206 public:
00207         BoxDlg():BoxDlgBase(),noBoxPanel(NULL),mutaborBoxPanel(NULL),guidoFileBoxPanel(NULL) { }
00208         BoxDlg(wxWindow * parent);
00209 
00210         void InitializeBoxTypes();
00211         
00212         wxWindow * GetRouteWindow() 
00213         {
00214                 return routeWindow;
00215         }
00216 
00217         virtual wxSize DoGetBestSize() const;
00218         
00219         int GetBoxType() const;
00220         bool SetBoxType(int type);
00221         
00222         void SetBoxNumber(int nr) 
00223         { 
00224                 wxASSERT(mutaborBoxPanel);
00225                 if (!mutaborBoxPanel) return;
00226                 mutaborBoxPanel->SetBoxNumber(nr); 
00227         }
00228 
00229         int GetBoxNumber() const 
00230         { 
00231                 wxASSERT(mutaborBoxPanel);
00232                 if (!mutaborBoxPanel) return -99;
00233                 return mutaborBoxPanel->GetBoxNumber(); 
00234         }
00235         
00236         void DisableRemove (bool disable=true) 
00237         {
00238                 if (!wxID_REMOVE) UNREACHABLEC;
00239                 wxID_REMOVE->Show(!disable);
00240                 wxID_REMOVE->Enable(!disable);
00241         }
00242         
00244         
00245 protected:
00246         void OnRemoveClick( wxCommandEvent& event );    
00247         void AddButtonPressed(wxCommandEvent &event);
00248         
00249         NoBoxSettings * noBoxPanel;
00250         MutaborBoxSettings * mutaborBoxPanel;
00251         GuidoFileBoxSettings * guidoFileBoxPanel;
00252         DECLARE_DYNAMIC_CLASS( BoxDlg )
00253         DECLARE_EVENT_TABLE()
00254 };
00255 
00256 
00257 
00258 #endif
00259 // _BOXDLG_H_
00260 

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