File: MiscDialogs.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,224 kB
  • ctags: 6,214
  • sloc: cpp: 41,569; ansic: 3,978; sh: 1,420; makefile: 243
file content (215 lines) | stat: -rwxr-xr-x 7,317 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/** \file
	\brief Contains several (minor) dialogs and their helper classes
*/
#ifndef _MISCDIALOGS_H_
#define _MISCDIALOGS_H_

#include "main.h"
#include "TLigationDialog.h"
#include "TVectorEditor.h"
#include "ManageDatabase.h"
#include "TextImportDialog.h"
#include "TPrimerDialog.h"
#include "TSilmutDialog.h"
#include "ProgramOptionsDialog.h"
#include "FindSequenceDialog.h"
#include "TAlignmentDialog.h"
#include <wx/spinctrl.h>

class TStorage ;
class MyFrame ;
class MyChild ;
class TRestrictionEnzyme ;
class ChildBase ;
class TPrimer ;
class TPrimerDesign ;
class TAlignment ;
class TGraph ;
class TGraphScale ;
class TGraphData ;

class TGraphDialog : public wxDialog
	{
   public : 
   TGraphDialog ( wxWindow *_parent , const wxString& title ) ; ///< Constructor
   virtual ~TGraphDialog() ;
   
   virtual void ShowScale ( TGraphScale *s ) ;
   virtual void ShowData ( TGraphData *d ) ;

   virtual void OnScalesList ( wxCommandEvent &ev ) ;
   virtual void OnDataList ( wxCommandEvent &ev ) ;
   virtual void OnButtonData ( wxCommandEvent &ev ) ;
   virtual void OnButtonScales ( wxCommandEvent &ev ) ;
   virtual void OnOK ( wxCommandEvent &ev ) ;

	private :
	virtual void add_nb_graph () ;
	virtual void add_nb_data () ;
	virtual void add_nb_scales () ;
	
	virtual void save_settings () ;
	
	TGraph *parent ;
	wxNotebook *nb ;
	wxPanel *nb_graph , *nb_data , *nb_scales ;
	
	wxListBox *lb_scales , *lb_data ;
	wxTextCtrl *scales_name , *scales_min , *scales_max , *scales_unit , *scales_color ;
	wxChoice *ch_scales_type ;
	
	wxTextCtrl *data_name , *data_color ;
	wxChoice *ch_data_pointstyle , *ch_data_scalex , *ch_data_scaley ;
	
	int last_scale , last_data ;
	bool set_up ;
	
	vector <TGraphScale*> scales ;
	vector <TGraphData*> data ;
	
	DECLARE_EVENT_TABLE()
	} ;

class TSpeakDialog : public wxDialog
	{
    public : 
    TSpeakDialog(wxWindow *parent, const wxString& title , wxString _seq ) ; ///< Constructor
    ~TSpeakDialog () ; ///< Destructor
    
    virtual void OnCharHook(wxKeyEvent& event) ; ///< Cancel button event handler
    virtual void OnPlay ( wxCommandEvent &ev ) ;
    virtual void OnStop ( wxCommandEvent &ev ) ;
    
    private :
	virtual void speakLetter ( wxString c ) ;
	wxTextCtrl *seq ;
	wxCheckBox *doPause ;
	wxSpinCtrl *pause ;
	bool doPlay ;
	wxString sequence ;

    DECLARE_EVENT_TABLE()
	} ;

/**	\brief The dialog handling the TIPC settings
*/
class TIPCDialog : public wxDialog
	{
    public : 
    TIPCDialog(wxWindow *parent, const wxString& title , int _seqlen ) ; ///< Constructor
    virtual ~TIPCDialog () ; ///< Destructor
    
    void OnLimit ( wxCommandEvent &event ) ; ///< Limit update event handler
//    void OnOK ( wxCommandEvent &ev ) ;
//    void OnCancel ( wxCommandEvent &ev ) ;

    private :
    int seqlen ; ///< The sequence length
    wxTextCtrl *limit ; ///< Pointer to the text box containing the limit
    wxStaticText *est ; ///< Pointer to the time estimation display
    
    double estimate_time ( int f ) ; ///< Function estimating runtime
    
    DECLARE_EVENT_TABLE()
	} ;    

/** \brief A text control highlighting URLs
*/
class TURLtext : public wxTextCtrl
    {
    public :
    TURLtext ( wxWindow *parent , int id , wxString title ,
                    wxPoint pos , wxSize size , int style ) ; ///< Constructor
    virtual void OnURL(wxTextUrlEvent& event) ; ///< URL event handler
    DECLARE_EVENT_TABLE()
    } ;

/** \brief A dialog for multiple choices
*/
class TMyMultipleChoiceDialog : public wxDialog
    {
    public :
    TMyMultipleChoiceDialog () ; ///< Default constructor
    TMyMultipleChoiceDialog ( wxWindow *parent ,
                              const wxString &message ,
                              const wxString &caption ,
                              int n,
                              const wxString choices[] = NULL,
                              int options = wxOK | wxCANCEL | wxCENTRE ,
                              const wxPoint& pos = wxDefaultPosition ) ; ///< Constructor
    virtual ~TMyMultipleChoiceDialog () ; ///< Destructor
    virtual void Check ( int item, bool check = TRUE ) ; ///< Check an item
    virtual void CheckAll ( bool check = TRUE ) ; ///< Uncheck all items
    virtual bool IsChecked ( int item ) const ; ///< Is an item checked?
    virtual void OnOK ( wxCommandEvent &ev ) ; ///< OK button event handler
    private :
    wxCheckListBox *clb ; ///< The checklist-box
    vector <bool> check ;

    DECLARE_EVENT_TABLE()
    } ;

/** \brief A dialog to display/edit enzyme properties
*/
class TEnzymeDialog : public wxDialog
    {
    public :
    TEnzymeDialog(wxWindow *parent, const wxString& title, const wxPoint& pos , 
                        const wxSize& size , const long style ) ; ///< Constructor
    ~TEnzymeDialog () ; ///< Destructor
    void initme ( TRestrictionEnzyme *_e = NULL , bool ro = false ) ; ///< Initialization
    void OnOK ( wxCommandEvent &ev ) ; ///< OK button event handler
    void OnCharHook(wxKeyEvent& event) ; ///< Cancel button event handler
    
    // Variables
    bool readonly ; ///< Protect dialog from user changes
    TRestrictionEnzyme *e ; ///< The enzyme in question
    wxTextCtrl *eb_name , *eb_seq, *eb_loc , *eb_note , *eb_from , *eb_to ;

    DECLARE_EVENT_TABLE()
    } ;

/** \brief The dialog for settings when searching for sequencing primers
*/
class TSequencingPrimerDialog : public wxDialog
    {
    public :
    TSequencingPrimerDialog ( wxWindow *parent, const wxString& title ) ; ///< Constructor
    ~TSequencingPrimerDialog () ; ///< Destructor
    
    virtual void OnCharHook ( wxKeyEvent& event ) ; ///< Key event handler
    virtual void OnDB ( wxCommandEvent& event ) ; ///< Second database event handler

    virtual void getPrimerList ( wxArrayString &p_name , wxArrayString &p_seq ) ; ///< Retrieve a list of primers
    virtual bool matchToVector ( TVector *v , wxString name , wxString seq ) ; ///< Match the primers to the vector
    virtual bool getClear() { return cb_clear->GetValue() ; } ///< Clear existing sequencing primer items from vecotr?
    
    private :
    virtual int findBestMatch ( wxString &s , wxString seq , int &pos , int ml ) ; ///< Finds the best match for a primer in the vector
    virtual void addSequencingPrimer ( TVector *v , wxString name , wxString seq , 
    								int best_pos , int best_score , int dir ) ; ///< Add the primer as an item to the vector

    wxSpinCtrl *t_ma ; ///< Minimum number of aligning bases
    wxChoice *c_db , *c_pj ;
    wxCheckBox *cb_pj , *cb_clear , *cb_35 , *cb_53 ;
    wxArrayString db_names , db_files ;
    
    DECLARE_EVENT_TABLE()
    } ;

/** \brief Tiny dialog for transforming a DNA sequence
*/
class TransformSequenceDialog : public wxDialog
    {
    public :
    TransformSequenceDialog ( wxWindow *parent, const wxString& title ) ; ///< Constructor
    ~TransformSequenceDialog () ; ///< Destructor
    virtual void OnCharHook ( wxKeyEvent& event ) ; ///< Key event handler
    
    wxCheckBox *invert , *complement , *new_item ;

    DECLARE_EVENT_TABLE()
    } ;

#endif