File: TCalculator.h

package info (click to toggle)
gentle 1.9%2Bcvs20100605%2Bdfsg1-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 (124 lines) | stat: -rwxr-xr-x 4,309 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
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
/** \file
	\brief Contains the TImageDisplay class, as well as the TMyImagePanel helper class
*/
#ifndef _T_CALCULATOR_H_
#define _T_CALCULATOR_H_

#include "main.h"
#include "ChildBase.h"
#include <wx/notebook.h>
#include <wx/grid.h>

#define HTML_PRINT_PREVIEW 1
#define HTML_PRINT 2

/**	\class TGridBasic
	\brief The base class for each calculator submodule (grid/sheet)
*/
class TGridBasic : public wxGrid
    {
    public :
    TGridBasic ( wxWindow *parent , int id = -1 ) ; ///< Constructor

    virtual void recalc () ; ///< Recalculates the submodule
	virtual void OnCellChanged(wxGridEvent& event) ; ///< Cell-has-changed event
    virtual void cleanup () ; ///< Reset the submodule
    virtual void gridSetEditable ( int y , int x ) ; ///< Makes a cell editable
    virtual void gridSetEntry ( int y , int x , wxString title , wxString value = _T("0") , wxString unit = _T("") ) ; ///< Sets a cell group
    virtual void gridSetValue ( int y , int x , wxString value , wxString unit = _T("") ) ; ///< Sets a cell group
    virtual void print ( int mode ) ; ///< Prints the submodule
    virtual wxString getText() ;
    virtual double getDouble ( int y , int x ) ; ///< Returns the value of a cell as a floating-point number
    
    protected :
    bool calculating ; ///< Are we currently (re)calculating?
    } ;
    
/**	\class TGridLigation
	\brief The ligation calculator submodule
*/
class TGridLigation : public TGridBasic
    {
    public :
    TGridLigation ( wxWindow *parent , int id = -1 ) ; ///< Constructor

    virtual void init () ; ///< Initialization
    virtual void recalc () ; ///< Recalculates the submodule
    virtual void OnSelectCell(wxGridEvent& event) ; ///< Selection changed event handler
    
    DECLARE_EVENT_TABLE()
    } ;

/**	\class TGridDNA
	\brief The DNA concentration/purity calculator submodule
*/
class TGridDNA : public TGridBasic
    {
    public :
    TGridDNA ( wxWindow *parent , int id = -1 ) ; ///< Constructor

    virtual void init () ; ///< Initialization
    virtual void recalc () ; ///< Recalculates the submodule
    virtual void OnSelectCell(wxGridEvent& event) ; ///< Selection changed event handler
    
    DECLARE_EVENT_TABLE()
    } ;

/**	\class TGridProtein
	\brief The protein concentration calculator submodule
*/
class TGridProtein : public TGridBasic
    {
    public :
    TGridProtein ( wxWindow *parent , int id = -1 ) ; ///< Constructor

    virtual void init () ; ///< Initialization
    virtual void recalc () ; ///< Recalculates the submodule
    virtual void OnSelectCell(wxGridEvent& event) ; ///< Selection changed event handler
    
    DECLARE_EVENT_TABLE()
    } ;

/**	\class TGridData
	\brief The codon table calculator submodule
*/
class TGridData : public TGridBasic
    {
    public :
    TGridData ( wxWindow *parent , int id = -1 ) ; ///< Constructor

    virtual void init () ; ///< Initialization
    virtual void recalc () ; ///< Recalculates the submodule
    virtual void OnSelectCell(wxGridEvent& event) ; ///< Selection changed event handler
    
    DECLARE_EVENT_TABLE()
    } ;

/**	\class TCalculator
	\brief The calculator module
*/
class TCalculator : public ChildBase
    {
    public :
    TCalculator(wxWindow *parent, const wxString& title) ; ///< Constructor
    ~TCalculator () ; ///< Destructor
    
    void initme () ; ///< Initialization
    virtual wxString getName () ; ///< Returns the module name

//    virtual void OnClose(wxCloseEvent& event) ;
    virtual void OnSeqPrint(wxCommandEvent& event) ; ///< Print event handler
    virtual void OnPrintPreview(wxCommandEvent& event) ; ///< Print preview event handler
    virtual void OnCopy(wxCommandEvent& event) ; ///< Copy event handler
    virtual void OnDummy(wxCommandEvent& WXUNUSED(event)){}; ///< Dummy event handler
    
    wxNotebook *nb ; ///< Pointer to the wxNotebook structure that holds the submodules
    TGridLigation *ligGrid ; ///< Pointer to the ligation submodule
    TGridDNA *ligDNA ; ///< Pointer to the DNA submodule
    TGridProtein *prot ; ///< Pointer to the protein submodule
    TGridData *data ; ///< Pointer to the data submodule

    DECLARE_EVENT_TABLE()
    } ;

#endif