source: eviacam/trunk/fuentes/src/wconfiguration.h @ 29

Last change on this file since 29 was 29, checked in by mabarracus, 4 years ago

added eviacam content

File size: 16.4 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2// Name:        wconfiguration.h
3// Purpose:     
4// Author:      Cesar Mauri Loba
5// Modified by:
6// Created:     29/12/2008 16:35:20
7// RCS-ID:     
8// Copyright:   (C) 2008 Cesar Mauri from CREA Sistemes Informatics
9// License:     
10//
11//  This program is free software: you can redistribute it and/or modify
12//  it under the terms of the GNU General Public License as published by
13//  the Free Software Foundation, either version 3 of the License, or
14//  (at your option) any later version.
15//
16//  This program is distributed in the hope that it will be useful,
17//  but WITHOUT ANY WARRANTY; without even the implied warranty of
18//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19//  GNU General Public License for more details.
20//
21//  You should have received a copy of the GNU General Public License
22//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
23/////////////////////////////////////////////////////////////////////////////
24
25#ifndef _WCONFIGURATION_H_
26#define _WCONFIGURATION_H_
27
28
29/*!
30 * Includes
31 */
32
33#include "hotkeymanager.h"
34
35////@begin includes
36#include "wx/listbook.h"
37#include "wx/notebook.h"
38#include "wx/spinctrl.h"
39////@end includes
40
41#include <wx/dialog.h>
42#include <wx/checkbox.h>
43#include <wx/combobox.h>
44#include <wx/choice.h>
45#include <wx/button.h>
46#include <wx/stattext.h>
47#include <wx/statbox.h>
48
49/*!
50 * Forward declarations
51 */
52
53////@begin forward declarations
54class wxSpinCtrl;
55class wxFlexGridSizer;
56////@end forward declarations
57class wxPanel;
58
59/*!
60 * Control identifiers
61 */
62
63////@begin control identifiers
64#define ID_WCONFIGURATION 10014
65#define ID_LISTBOOK 10051
66#define ID_NOTEBOOK 10019
67#define ID_PANEL_MOTION 10021
68#define ID_SPINCTRL_XSPEED 10026
69#define ID_SPINCTRL_YSPEED 10000
70#define ID_SPINCTRL_ACCELERATION 10001
71#define ID_SPINCTRL_SMOOTHNESS 10002
72#define ID_SPINCTRL_EASYSTOP 10003
73#define ID_BUTTON 10074
74#define ID_PANEL_WORKSPACE 10061
75#define ID_CHECKBOX_WORKSPACE_LIMIT 10062
76#define ID_SPINCTRL_TOP_WORKSPACE 10063
77#define ID_SPINCTRL_LEFT_WORKSPACE 10064
78#define ID_SPINCTRL_RIGHT_WORKSPACE 10065
79#define ID_SPINCTRL_BOTTOM_WORKSPACE 10066
80#define ID_CHECKBOX2 10067
81#define ID_PANEL_CLICK 10024
82#define ID_CHECKBOX_ENABLE_DWELL 10031
83#define ID_STATIC_DWELL_TIME 10072
84#define ID_SPINCTRL_DWELL_TIME 10005
85#define ID_STATIC_DWELL_AREA 10073
86#define ID_SPINCTRL_DWELL_AREA 10004
87#define ID_CHECKBOX_ALLOW_CONSECUTIVE 10032
88#define ID_CHECKBOX_BEEP_ON_CLICK 10033
89#define ID_CHECKBOX_ALLOW_VISUAL_ALERTS 10089
90#define ID_STATICBOX_CLICK_WIN 10007
91#define ID_CHECKBOX_SHOW_CLICKWIN 10037
92#define ID_STATIC_DESIGN 10081
93#define ID_CHOICE_DESIGN 10087
94#define ID_STATIC_BEHAVIOUR 10082
95#define ID_CHOICE_BEHAVIOUR 10006
96#define ID_CHOICE5 10068
97#define ID_CHECKBOX_AUTOHIDE 10113
98#define ID_STATICBOX_GESTURE_CLICK 10008
99#define ID_CHECKBOX 10034
100#define ID_STATIC_MOVE_LEFT 10083
101#define ID_CHOICE 10035
102#define ID_STATIC_MOVE_RIGHT 10084
103#define ID_CHOICE1 10088
104#define ID_STATIC_MOVE_UP 10085
105#define ID_CHOICE2 10102
106#define ID_STATIC_MOVE_DOWN 10086
107#define ID_CHOICE3 10105
108#define ID_PANEL_KEYS 10110
109#define ID_PANEL_ADVANCED 10025
110#define ID_CHECKBOX_STARTUP 10071
111#define ID_CHECKBOX_ENABLE_AT_STARTUP 10023
112#define ID_TEXTCTRL_ONSCREENKEYBOARDCOMMAND 10036
113#define ID_BUTTON_ONSCREENKEYBOARDCOMMAND 10049
114#define ID_CHECKBO_LEGACY_TRACKER 10009
115#define ID_CHECKBOX_AUTO_LOCATE_FACE 10038
116#define ID_CHOICE4 10109
117#define ID_CHECKBOX_ENABLE_WHEN_FACE_DETECTED 10039
118#define ID_SPINCTRL2 10107
119#define ID_SPIN_SEND_ACTION_WAIT 10131
120#define ID_PANEL 10050
121#define ID_CHOICE_PROFILE 10015
122#define ID_BUTTON_ADD_PROFILE 10017
123#define ID_BUTTON_DEL_PROFILE 10018
124#define ID_TEXTCTRL_SELECTED_CAMERA 10052
125#define ID_BUTTON_CAMERA_SETTINGS 10053
126#define ID_BUTTON_CHANGE_CAMERA 10054
127#define ID_CHOICE_LANGUAGE 10012
128#define ID_CHECKBOX_CHECK_UPDATES 10010
129#define SYMBOL_WCONFIGURATION_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
130#define SYMBOL_WCONFIGURATION_TITLE _("Configuration")
131#define SYMBOL_WCONFIGURATION_IDNAME ID_WCONFIGURATION
132#define SYMBOL_WCONFIGURATION_SIZE wxDefaultSize
133#define SYMBOL_WCONFIGURATION_POSITION wxDefaultPosition
134////@end control identifiers
135#define ID_COMBOBOX_LEFT 10007
136#define ID_COMBOBOX_RIGHT 10008
137#define ID_COMBOBOX_TOP 10009
138#define ID_COMBOBOX_BOTTOM 10010
139
140
141
142/*!
143 * WConfiguration class declaration
144 */
145
146class WConfiguration: public wxDialog
147{   
148    DECLARE_DYNAMIC_CLASS( WConfiguration )
149    DECLARE_EVENT_TABLE()
150
151public:
152    /// Constructors
153    WConfiguration();
154    WConfiguration( wxWindow* parent, wxWindowID id = SYMBOL_WCONFIGURATION_IDNAME, const wxString& caption = SYMBOL_WCONFIGURATION_TITLE, const wxPoint& pos = SYMBOL_WCONFIGURATION_POSITION, const wxSize& size = SYMBOL_WCONFIGURATION_SIZE, long style = SYMBOL_WCONFIGURATION_STYLE );
155       
156    /// Creation
157    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WCONFIGURATION_IDNAME, const wxString& caption = SYMBOL_WCONFIGURATION_TITLE, const wxPoint& pos = SYMBOL_WCONFIGURATION_POSITION, const wxSize& size = SYMBOL_WCONFIGURATION_SIZE, long style = SYMBOL_WCONFIGURATION_STYLE );
158
159    /// Destructor
160    ~WConfiguration();
161
162private:
163    /// Initialises member variables
164    void Init();
165
166    /// Creates the controls and sizers
167    void CreateControls();
168
169////@begin WConfiguration event handler declarations
170
171    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_XSPEED
172    void OnSpinctrlXspeedUpdated( wxSpinEvent& event );
173
174    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_YSPEED
175    void OnSpinctrlYspeedUpdated( wxSpinEvent& event );
176
177    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_ACCELERATION
178    void OnSpinctrlAccelerationUpdated( wxSpinEvent& event );
179
180    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_SMOOTHNESS
181    void OnSpinctrlSmoothnessUpdated( wxSpinEvent& event );
182
183    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_EASYSTOP
184    void OnSpinctrlEasystopUpdated( wxSpinEvent& event );
185
186    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
187    void OnButtonClick( wxCommandEvent& event );
188
189    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_WORKSPACE_LIMIT
190    void OnCheckboxWorkspaceLimitClick( wxCommandEvent& event );
191
192    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_TOP_WORKSPACE
193    void OnSpinctrlTopWorkspaceUpdated( wxSpinEvent& event );
194
195    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_LEFT_WORKSPACE
196    void OnSpinctrlLeftWorkspaceUpdated( wxSpinEvent& event );
197
198    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_RIGHT_WORKSPACE
199    void OnSpinctrlRightWorkspaceUpdated( wxSpinEvent& event );
200
201    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_BOTTOM_WORKSPACE
202    void OnSpinctrlBottomWorkspaceUpdated( wxSpinEvent& event );
203
204    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX2
205    void OnCheckboxWrapPointer( wxCommandEvent& event );
206
207    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ENABLE_DWELL
208    void OnCheckboxEnableDwellClick( wxCommandEvent& event );
209
210    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_DWELL_TIME
211    void OnSpinctrlDwellTimeUpdated( wxSpinEvent& event );
212
213    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL_DWELL_AREA
214    void OnSpinctrlDwellAreaUpdated( wxSpinEvent& event );
215
216    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ALLOW_CONSECUTIVE
217    void OnCheckboxAllowConsecutiveClick( wxCommandEvent& event );
218
219    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_BEEP_ON_CLICK
220    void OnCheckboxBeepOnClickClick( wxCommandEvent& event );
221
222#if defined(__WXGTK__)
223    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ALLOW_VISUAL_ALERTS
224    void OnCheckboxAllowVisualAlertsClick( wxCommandEvent& event );
225
226#endif
227    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_SHOW_CLICKWIN
228    void OnCheckboxShowClickwinClick( wxCommandEvent& event );
229
230    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE_DESIGN
231    void OnChoiceDesignSelected( wxCommandEvent& event );
232
233    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE_BEHAVIOUR
234    void OnChoiceBehaviourSelected( wxCommandEvent& event );
235
236#if defined(__WXGTK__)
237    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE5
238    void OnChoiceClickWindowModeSelected( wxCommandEvent& event );
239
240#endif
241#if defined(__WXGTK__)
242    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_AUTOHIDE
243    void OnCheckboxAutohideClick( wxCommandEvent& event );
244
245#endif
246#if defined(__WXGTK__)
247    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
248    void OnCheckboxEnableGestureClick( wxCommandEvent& event );
249
250#endif
251#if defined(__WXGTK__)
252    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE
253    void OnLeftGestureChoiceSelected( wxCommandEvent& event );
254
255#endif
256#if defined(__WXGTK__)
257    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE1
258    void OnRightGestureChoiceSelected( wxCommandEvent& event );
259
260#endif
261#if defined(__WXGTK__)
262    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE2
263    void OnUpGestureChoiceSelected( wxCommandEvent& event );
264
265#endif
266#if defined(__WXGTK__)
267    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE3
268    void OnDownGestureChoiceSelected( wxCommandEvent& event );
269
270#endif
271#if defined(__WXGTK__)
272    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_STARTUP
273    void OnCheckboxStartupClick( wxCommandEvent& event );
274
275#endif
276    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ENABLE_AT_STARTUP
277    void OnCheckboxEnableAtStartupClick( wxCommandEvent& event );
278
279    /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_ONSCREENKEYBOARDCOMMAND
280    void OnTextctrlOnscreenkeyboardcommandTextUpdated( wxCommandEvent& event );
281
282    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ONSCREENKEYBOARDCOMMAND
283    void OnButtonOnscreenkeyboardcommandClick( wxCommandEvent& event );
284
285    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBO_LEGACY_TRACKER
286    void OnCheckboLegacyTrackerClick( wxCommandEvent& event );
287
288    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_AUTO_LOCATE_FACE
289    void OnCheckboxAutoLocateFaceClick( wxCommandEvent& event );
290
291    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE4
292    void OnChoCpuUsageSelected( wxCommandEvent& event );
293
294    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ENABLE_WHEN_FACE_DETECTED
295    void OnCheckboxEnableWhenFaceDetectedClick( wxCommandEvent& event );
296
297    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL2
298    void OnSpinLocateFaceTimeoutUpdated( wxSpinEvent& event );
299
300    /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPIN_SEND_ACTION_WAIT
301    void OnSpinSendActionWaitUpdated( wxSpinEvent& event );
302
303    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE_PROFILE
304    void OnChoiceProfileSelected( wxCommandEvent& event );
305
306    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ADD_PROFILE
307    void OnButtonAddProfileClick( wxCommandEvent& event );
308
309    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_DEL_PROFILE
310    void OnButtonDelProfileClick( wxCommandEvent& event );
311
312    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_CAMERA_SETTINGS
313    void OnButtonCameraSettingsClick( wxCommandEvent& event );
314
315    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_CHANGE_CAMERA
316    void OnButtonChangeCameraClick( wxCommandEvent& event );
317
318    /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE_LANGUAGE
319    void OnChoiceLanguageSelected( wxCommandEvent& event );
320
321    /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CHECK_UPDATES
322    void OnCheckboxCheckUpdatesClick( wxCommandEvent& event );
323
324    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
325    void OnOkClick( wxCommandEvent& event );
326
327    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
328    void OnCancelClick( wxCommandEvent& event );
329
330////@end WConfiguration event handler declarations
331
332    /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX_LEFT
333    void OnComboboxLeftSelected( wxCommandEvent& event );
334
335    /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX_RIGHT
336    void OnComboboxRightSelected( wxCommandEvent& event );
337
338    /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX_TOP
339    void OnComboboxTopSelected( wxCommandEvent& event );
340
341    /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX_BOTTOM
342    void OnComboboxBottomSelected( wxCommandEvent& event );
343
344        void OnHotkeyCheckboxClick( wxCommandEvent& event );
345        void OnHotkeyButtonClick( wxCommandEvent& event );
346
347////@begin WConfiguration member function declarations
348
349    /// Retrieves bitmap resources
350    wxBitmap GetBitmapResource( const wxString& name );
351
352    /// Retrieves icon resources
353    wxIcon GetIconResource( const wxString& name );
354////@end WConfiguration member function declarations
355
356        void CreateHotkey (const CKeyCommand* kc, wxWindow* parent, wxSizer* sizer);
357
358    /// Should we show tooltips?
359    static bool ShowToolTips();
360
361        // Enable/disable GUI areas
362        void UpdateGUIClickOptions();
363        void EnableGUIGeneralClickOptions(bool enable);
364        void EnableGUIGestureOptions(bool enable);
365        void EnableGUIClickWindowOptions(bool enable);
366
367        // Read info from model classes
368        void InitializeData ();
369        void Changed ();
370        void UnChanged ();
371
372////@begin WConfiguration member variables
373    wxSpinCtrl* m_spinXSpeed;
374    wxSpinCtrl* m_spinYSpeed;
375    wxSpinCtrl* m_spinAcceleration;
376    wxSpinCtrl* m_spinSmoothness;
377    wxSpinCtrl* m_spinEasyStop;
378    wxButton* m_buttonCalibrateMotion;
379    wxCheckBox* m_chkEnabledWorkspace;
380    wxSpinCtrl* m_spin_top_workspace;
381    wxSpinCtrl* m_spin_left_workspace;
382    wxSpinCtrl* m_spin_right_workspace;
383    wxSpinCtrl* m_spin_bottom_workspace;
384    wxCheckBox* m_chkWrapPointer;
385    wxPanel* m_panelClick;
386    wxCheckBox* m_chkDwellClickEnabled;
387    wxStaticText* m_stDwellTime;
388    wxSpinCtrl* m_spinDwellTime;
389    wxStaticText* m_stDwellArea;
390    wxSpinCtrl* m_spinDwellArea;
391    wxCheckBox* m_chkAllowConsecutiveClick;
392    wxCheckBox* m_chkBeepOnClick;
393#if defined(__WXGTK__)
394    wxCheckBox* m_chkAllowVisualAlerts;
395#endif
396    wxStaticBox* m_sboxClickWin;
397    wxCheckBox* m_chkShowClickWin;
398    wxStaticText* m_stDesign;
399    wxChoice* m_choClickWindowDesign;
400    wxStaticText* m_stBehaviour;
401    wxChoice* m_choClickWindowBehaviour;
402#if defined(__WXGTK__)
403    wxStaticText* m_stDocking;
404#endif
405#if defined(__WXGTK__)
406    wxChoice* m_choDockingMode;
407#endif
408#if defined(__WXGTK__)
409    wxCheckBox* m_chkAutohide;
410#endif
411#if defined(__WXGTK__)
412    wxStaticBox* m_sboxGestureClick;
413#endif
414#if defined(__WXGTK__)
415    wxCheckBox* m_chkEnableGestureClick;
416#endif
417#if defined(__WXGTK__)
418    wxStaticText* m_stMoveLeft;
419#endif
420#if defined(__WXGTK__)
421    wxChoice* m_choLeft;
422#endif
423#if defined(__WXGTK__)
424    wxStaticText* m_stMoveRight;
425#endif
426#if defined(__WXGTK__)
427    wxChoice* m_choRight;
428#endif
429#if defined(__WXGTK__)
430    wxStaticText* m_stMoveUp;
431#endif
432#if defined(__WXGTK__)
433    wxChoice* m_choUp;
434#endif
435#if defined(__WXGTK__)
436    wxStaticText* m_stMoveDown;
437#endif
438#if defined(__WXGTK__)
439    wxChoice* m_choDown;
440#endif
441#if defined(__WXGTK__)
442    wxPanel* m_panelKeys;
443#endif
444#if defined(__WXGTK__)
445    wxFlexGridSizer* m_hotkeysSizer;
446#endif
447#if defined(__WXGTK__)
448    wxCheckBox* m_chkStartup;
449#endif
450    wxCheckBox* m_chkEnabledAtStartup;
451    wxTextCtrl* m_txtOnScreenKeyboardCommand;
452    wxButton* m_btntOnScreenKeyboardCommand;
453    wxStaticBox* m_sizerFaceLocalization;
454    wxCheckBox* m_chkLegacyTracker;
455    wxCheckBox* m_chkAutoLocateFace;
456    wxStaticText* m_staticCpuUsage;
457    wxChoice* m_choCpuUsage;
458    wxCheckBox* m_chkEnableWhenFaceDetected;
459    wxStaticText* m_staticLocateFaceTimeout2;
460    wxSpinCtrl* m_spinLocateFaceTimeout;
461    wxStaticText* m_staticLocateFaceTimeout;
462    wxSpinCtrl* m_spinSendActionWait;
463    wxChoice* m_choProfile;
464    wxButton* m_btnAddProfile;
465    wxButton* m_btnDeleteProfile;
466    wxTextCtrl* m_txtSelectedCamera;
467    wxButton* m_btnCameraSettings;
468    wxChoice* m_choLanguage;
469    wxCheckBox* m_chkCheckUpdatesAtStartup;
470    wxButton* m_btnCancel;
471////@end WConfiguration member variables
472    wxComboBox* m_cmbLeft;
473    wxComboBox* m_cmbRight;
474    wxComboBox* m_cmbTop;
475    wxComboBox* m_cmbBottom;
476        vector<wxControl*> m_controlList;
477        int m_lastId;
478        bool m_dirty;
479};
480
481
482#endif
483    // _WCONFIGURATION_H_
Note: See TracBrowser for help on using the repository browser.