00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013
00014 #ifndef _CURSOR_CH_CONTROL_H_
00015 #define _CURSOR_CH_CONTROL_H_
00016
00017 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
00018 #pragma interface "cursor_ch_control.h"
00019 #endif
00020
00025
00026 #include "wx/tglbtn.h"
00027 #include "wx/spinbutt.h"
00029
00030 #include "generic_board.h"
00035
00036 class wxToggleButton;
00037 class wxSpinButton;
00039
00044
00045 #define ID_CURSORCHCONTROL 10044
00046 #define SYMBOL_CURSORCHCONTROL_STYLE 0
00047 #define SYMBOL_CURSORCHCONTROL_TITLE _("CursorChControl")
00048 #define SYMBOL_CURSORCHCONTROL_IDNAME ID_CURSORCHCONTROL
00049 #define SYMBOL_CURSORCHCONTROL_SIZE wxSize(400, 300)
00050 #define SYMBOL_CURSORCHCONTROL_POSITION wxDefaultPosition
00051 #define ID_CURSOR_TOGGLEBUTTON 10001
00052 #define ID_CURSOR_RESET_BUTTON 10004
00053 #define ID_CURSOR_POSITION_SPINBUTTON 10005
00054 #define ID_CURSOR_POS_MULTIPLIER_CHOICE 10045
00055
00056
00061 #ifndef wxCLOSE_BOX
00062 #define wxCLOSE_BOX 0x1000
00063 #endif
00064
00069 class CursorChControl: public wxPanel
00070 {
00071 DECLARE_DYNAMIC_CLASS( CursorChControl )
00072 DECLARE_EVENT_TABLE()
00073
00074 public:
00076 CursorChControl( );
00077 CursorChControl( wxWindow* parent, wxWindowID id = SYMBOL_CURSORCHCONTROL_IDNAME, const wxPoint& pos = SYMBOL_CURSORCHCONTROL_POSITION, const wxSize& size = SYMBOL_CURSORCHCONTROL_SIZE, long style = SYMBOL_CURSORCHCONTROL_STYLE );
00078
00080 bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CURSORCHCONTROL_IDNAME, const wxPoint& pos = SYMBOL_CURSORCHCONTROL_POSITION, const wxSize& size = SYMBOL_CURSORCHCONTROL_SIZE, long style = SYMBOL_CURSORCHCONTROL_STYLE );
00081
00083 void CreateControls();
00084
00086
00088 void OnCursorTogglebuttonClick( wxCommandEvent& event );
00089
00091 void OnCursorResetButtonClick( wxCommandEvent& event );
00092
00094 void OnCursorPositionSpinbuttonUpdated( wxSpinEvent& event );
00095
00097 void OnCursorPosMultiplierChoiceSelected( wxCommandEvent& event );
00098
00100
00102
00104 wxBitmap GetBitmapResource( const wxString& name );
00105
00107 wxIcon GetIconResource( const wxString& name );
00109
00111 static bool ShowToolTips();
00112
00114 wxStaticBox* m_main_sizer_text;
00115 wxToggleButton* m_ch_enable_control;
00116 wxButton* m_ch_cursor_reset_control;
00117 wxSpinButton* m_set_cursor_position_control;
00118 wxChoice* m_cursor_pos_multiplier_control;
00119 wxStaticText* m_cursor_position_control;
00120 wxStaticText* m_cursor_value_control;
00121 wxStaticText* m_mV_label;
00123 bool SetupBoard( GenericBoard* p_board, int ch_index, int ch_count, int m_scope_index, bool is_virtual);
00124 bool UpdateControls( void);
00125 bool UpdateCursorPosition( int cursor_position);
00126 private:
00127 int GetCursorMultipler( void);
00128
00129 GenericBoard* m_p_board;
00130 GenericBoardChannel* m_p_board_channel;
00131 int m_ch_index;
00132 int m_ch_count;
00133 int m_scope_index;
00134 int m_last_cursor_pos;
00135 bool m_is_virtual;
00136 };
00137
00138 #endif
00139