| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifndef ALIGNED_PAIR_SEQUENCE_VIEW_HH |
|---|
| 20 |
#define ALIGNED_PAIR_SEQUENCE_VIEW_HH |
|---|
| 21 |
|
|---|
| 22 |
#include "SequenceView.hh" |
|---|
| 23 |
#include <string> |
|---|
| 24 |
|
|---|
| 25 |
namespace gui { |
|---|
| 26 |
class AlignedPairSequenceView : public SequenceView { |
|---|
| 27 |
private: |
|---|
| 28 |
float ch_width; |
|---|
| 29 |
protected: |
|---|
| 30 |
std::string _top_aln; |
|---|
| 31 |
std::string _bot_aln; |
|---|
| 32 |
|
|---|
| 33 |
void draw(); |
|---|
| 34 |
void draw_labels(); |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
int handle(int e); |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
const static unsigned int font_size = 14; |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
const static unsigned int border = 35; |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
const static unsigned int half_label_height = 5; |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
const static unsigned int label_width = border - 2; |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
const static unsigned int half_selection_height = 10; |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
void _resize_view(unsigned int& s, unsigned int& e); |
|---|
| 56 |
public: |
|---|
| 57 |
AlignedPairSequenceView(int _x, int _y, unsigned int _w, |
|---|
| 58 |
std::string top_aln, std::string bot_aln); |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
const static unsigned int height = 80; |
|---|
| 63 |
|
|---|
| 64 |
unsigned int base_to_pos(int base); |
|---|
| 65 |
unsigned int pos_to_base(int pos); |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
unsigned int get_left(), get_width(), get_mid(); |
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
void set_visible_bases(unsigned int start, unsigned int end) { |
|---|
| 72 |
_resize_view(start, end); |
|---|
| 73 |
SequenceView::set_visible_bases(start, end); |
|---|
| 74 |
} |
|---|
| 75 |
|
|---|
| 76 |
void resize(int a, int b, int c, int d) { |
|---|
| 77 |
SequenceView::resize(a, b, c, d); |
|---|
| 78 |
_resize_view(_start, _end); |
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
void scroll_right(unsigned int n), scroll_left(unsigned int n); |
|---|
| 82 |
}; |
|---|
| 83 |
} |
|---|
| 84 |
|
|---|
| 85 |
#endif |
|---|
| 86 |
|
|---|