File: FindSequenceDialog.h

package info (click to toggle)
gentle 1.9%2Bcvs20100605%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,224 kB
  • sloc: cpp: 41,569; ansic: 3,978; sh: 1,420; makefile: 240
file content (59 lines) | stat: -rw-r--r-- 2,757 bytes parent folder | download | duplicates (7)
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
/** \file
	\brief Contains the FindSequenceDialog class
*/
#ifndef _FindSequenceDialog_h_
#define	_FindSequenceDialog_h_

#include "main.h"
#include <wx/regex.h>

WX_DECLARE_STRING_HASH_MAP ( wxChar , wxHashChar ) ;

/**	\brief The class implementing the "Find" dialog in various ChildBase modules
*/
class FindSequenceDialog : public wxDialog
    {
    public :
    FindSequenceDialog ( wxWindow *parent, const wxString& title ) ; ///< Constructor
    ~FindSequenceDialog () ; ///< Destructor
    virtual void OnCharHook(wxKeyEvent& event) ; ///< Key event handler
    virtual void OnSearch ( wxCommandEvent &ev ) ; ///< Search button event handler
    virtual void OnCancel ( wxCommandEvent &ev ) ; ///< Cancel button event handler
    virtual void OnTextChange ( wxCommandEvent &ev ) ; ///< Search text change event handler
    virtual void OnLB ( wxCommandEvent &ev ) ; ///< List box choice change event handler
    virtual void OnLBdclick ( wxCommandEvent &ev ) ; ///< List box double click event handler
	virtual void OnAddHighlights ( wxCommandEvent &ev ) ; ///< Adds highlights
	virtual void OnSetHighlightColor ( wxCommandEvent &ev ) ; ///< Changes highlght color
	virtual void OnResetHighlights ( wxCommandEvent &ev ) ; ///< Resets highlights

    wxString allowed_chars ; ///< Chars one can search for

    private :
	virtual wxString getQuery () ;
    virtual int subsearch ( const wxString &s , const wxRegEx &regex , int start, int& len ) ; ///< Compares a string and a substring
    virtual void sequenceSearch ( bool invers = false ) ; ///< Search in sequence
    virtual void aaSearch () ; ///< Search in amino acid sequence
    virtual void itemSearch () ; ///< Search in items
    virtual void restrictionSearch () ; ///< Search for restriction enzymes
    virtual void doAction ( bool doubleclick ) ; ///< Perform action, now that a list item has been double-clicked
    virtual void aaSubSearch ( const wxString &s , int start , int dir , wxString rf ) ; ///< Search in resulting amino acid sequence
	virtual void getFromTo ( wxString s , long &from , long &to , int idx = -1 ) ;
	virtual SequenceCanvas *getMarkSequence ( wxString &mark ) ;

    ChildBase *c ; ///< Pointer to calling ChildBase class
    wxTextCtrl *t ; ///< The text control
    wxListBox *lb ; ///< The results list box control
    wxButton *find_button ; ///< The "Find" button
    wxButton *do_highlight ; ///< The "Highlight" button
    wxTextCtrl *status ; ///< The status text
    wxCheckBox *cb_sequence , *cb_items , *cb_enzymes , *cb_translation ;
	wxColour highlight ;
    wxArrayInt vi ;
    wxHashChar codonhash ;
    wxStaticText *highlight_display ;

    DECLARE_EVENT_TABLE()
    } ;


#endif