gehe zur Dokumentation dieser Datei00001
00064 #ifndef _INPUTDEVDLG_H_
00065 #define _INPUTDEVDLG_H_
00066
00067
00072
00073 #include "Defs.h"
00074 #include "wx/xrc/xmlres.h"
00075 #include "wx/html/htmlwin.h"
00076 #include "wx/statline.h"
00077 #include "wx/filepicker.h"
00078 #include "resourceload.h"
00079 #include "Device.h"
00080 #include "wx/valgen.h"
00081 #include "wx/valtext.h"
00083
00084
00085 #if 0
00086
00090
00091
00092 class wxBoxSizer;
00094
00099
00100 #define ID_INPDIALOG 10010
00101 #define SYMBOL_INPUTDEVDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00102 #define SYMBOL_INPUTDEVDLG_TITLE _("Input Device")
00103 #define SYMBOL_INPUTDEVDLG_IDNAME ID_INPDIALOG
00104 #define SYMBOL_INPUTDEVDLG_SIZE wxSize(400, 300)
00105 #define SYMBOL_INPUTDEVDLG_POSITION wxDefaultPosition
00106 #define ID_CHOICE 10011
00107 #define ID_CHOICE1 10012
00108 #define ID_TEXTCTRL 10013
00109 #define ID_BUTTON 10014
00110 #define ID_TEXTCTRL1 10015
00111 #define ID_BUTTON1 10016
00112
00113
00118 #ifndef wxCLOSE_BOX
00119 #define wxCLOSE_BOX 0x1000
00120 #endif
00121 #ifndef wxFIXED_MINSIZE
00122 #define wxFIXED_MINSIZE 0
00123 #endif
00124
00129 #endif
00130
00131 class InputDevDlg: public InputDevDlgBase
00132 {
00133 DECLARE_DYNAMIC_CLASS( InputDevDlg )
00134 DECLARE_EVENT_TABLE()
00135
00136 protected:
00137 wxSizer *Container,* TypeBox, *PortBox, *MidiFileBox, *GuidoFileBox;
00138
00139 struct TypeData:wxClientData
00140 {
00141 DevType nr;
00142 TypeData(DevType i):wxClientData()
00143 {
00144 nr=i;
00145 }
00146
00147 bool operator == (DevType i)
00148 {
00149 if (this)
00150 return i == nr;
00151 else return false;
00152 }
00153
00154 operator DevType()
00155 {
00156 if (this) return nr;
00157 else return DTNotSet;
00158 }
00159 };
00160
00161 int FindType (DevType t);
00162
00163 public:
00165 InputDevDlg( wxWindow* parent = NULL);
00166
00168 void OnChoiceSelected( wxCommandEvent& event );
00169
00171 void OnRemoveClick( wxCommandEvent& event );
00172
00173 void OnFileChanged ( wxFileDirPickerEvent & event );
00174
00175 void UpdateLayout(DevType type);
00176
00177 int GetMidiDevice() const
00178 {
00179 return PortChoice->GetSelection() ;
00180 }
00181
00182 void SetMidiDevice(int value)
00183
00184 {
00185 DEBUGLOG(other, _T("%d"),value);
00186 PortChoice->SetSelection (value) ;
00187 Update();
00188 }
00189
00190 wxString GetMidiFile() const
00191 {
00192 return MidiFilePicker->GetPath() ;
00193 }
00194
00195 void SetMidiFile(wxString value)
00196
00197 {
00198 DEBUGLOG(other, value);
00199 MidiFilePicker->SetPath(value);
00200 Update();
00201 DEBUGLOG(other, _T("done"));
00202 }
00203
00204 wxString GetGUIDOFile() const
00205 {
00206 return GuidoFilePicker->GetPath() ;
00207 }
00208
00209 void SetGUIDOFile(wxString value)
00210
00211 {
00212 DEBUGLOG(other, value);
00213 GuidoFilePicker->SetPath(value);
00214 Update();
00215 }
00216
00217 DevType GetType() const
00218 {
00219 int Type = DeviceChoice->GetSelection();
00220 if (Type == wxNOT_FOUND) return DTNotSet;
00221
00222 wxASSERT (dynamic_cast<TypeData *>(DeviceChoice->GetClientObject(Type)));
00223 TypeData * obj = (TypeData *)DeviceChoice->GetClientObject(Type);
00224
00225 if (obj) return *obj;
00226 else return DTNotSet;
00227 }
00228
00229 void SetType(DevType value)
00230
00231 {
00232 DEBUGLOG(other, _T("%d"),value);
00233 UpdateLayout(value);
00234 Update();
00235 }
00236
00237 wxString GetPortString(int i)
00238 {
00239 return PortChoice->GetString (i);
00240 }
00241
00242 void AppendPortChoice (const wxString &s)
00243 {
00244 PortChoice->Append (s);
00245 }
00246
00247 void DisableRemove (bool disable=true)
00248 {
00249 wxID_REMOVE->Show(!disable);
00250 wxID_REMOVE->Enable(!disable);
00251 }
00252
00254 wxBitmap GetBitmapResource (const wxString& name );
00255
00257 wxIcon GetIconResource (const wxString& name );
00258
00260 static bool ShowToolTips ();
00261
00262 };
00263
00264 #endif
00265
00266
00267