Thicker bars, better letters
[mussa.git] / gui / SetupWindow.hh
1 #ifndef _MUSSA_GUI_LOAD_WINDOW_H_
2 #define _MUSSA_GUI_LOAD_WINDOW_H_
3
4 //  This file is part of the Mussa source distribution.
5 //  http://mussa.caltech.edu/
6 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
7
8 // This program and all associated source code files are Copyright (C) 2005
9 // the California Institute of Technology, Pasadena, CA, 91125 USA.  It is
10 // under the GNU Public License; please see the included LICENSE.txt
11 // file for more information, or contact Tristan directly.
12
13 #include <string>
14 #include <vector>
15
16 #include <FL/Fl_Button.H>
17 #include <FL/Fl_Input.H>
18 #include <FL/Fl_Scroll.H>
19 #include <FL/Fl_Window.H>
20
21 class Mussa;
22 #include "SetupWindow.hh"
23
24 class SetupWindow : public Fl_Window
25
26   public:
27     SetupWindow(int w, int h, const char* title, Mussa *an_analysis);
28     ~SetupWindow();
29
30     bool done();
31
32   //did I put these in public for a reason?
33     Fl_Button* test;
34     Fl_Input *name_input;
35     Fl_Input *win_input;
36     Fl_Input *thres_input;
37     Fl_Input *seq_num_input;
38     Fl_Scroll *seq_scroll;
39     // need to keep track of these so a browsed file search can set the input
40     // fields to teh selected file
41     std::vector<Fl_Input*> seq_inputs, annot_inputs;
42
43
44     // callback receiver functions
45
46     void real_do_analysis();
47
48     void real_set_ana_name_cb(Fl_Input* o);
49     void real_set_win_size_cb(Fl_Input* o);
50     void real_set_threshold_cb(Fl_Input* o);
51     void real_set_seq_num_cb(Fl_Input* o);
52
53     void real_seq_file_in_cb(Fl_Input* o, int i);
54     void real_choose_seq_file_cb(int i);
55     void real_annot_file_in_cb(Fl_Input* o, int i);
56     void real_choose_annot_file_cb(int i);
57
58     void real_fa_index_in_cb(Fl_Input* o, int i);
59     void real_sub_start_in_cb(Fl_Input* o, int i);
60     void real_sub_end_in_cb(Fl_Input* o, int i);
61
62   private:
63     Mussa *an_analysis;
64     std::string analysis_name;
65     int window, threshold, seq_num;
66     std::vector<std::string> seq_files, annot_files;
67     std::vector<int> fasta_indices, sub_seq_starts, sub_seq_ends;
68     bool win_append, thres_append;
69
70     bool all_done;
71     static void print_cb(Fl_Button*, void*);
72     inline void print_cb_real(Fl_Button*, void*);
73
74     void add_seq_input(int index);
75 };
76
77 // crazy whacked shite Titus taught me to do to get an index value associated
78 // with each instance of an input associated with the callback... 
79
80 struct seq_data_instance
81 {
82   SetupWindow * sw_ptr;
83   int index;
84 };
85
86 #endif