| 1 | // =============================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : di_view_matrix.hxx // |
|---|
| 4 | // // |
|---|
| 5 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 6 | // http://www.arb-home.de/ // |
|---|
| 7 | // // |
|---|
| 8 | // =============================================================== // |
|---|
| 9 | |
|---|
| 10 | #ifndef DI_VIEW_MATRIX_HXX |
|---|
| 11 | #define DI_VIEW_MATRIX_HXX |
|---|
| 12 | |
|---|
| 13 | #ifndef AW_BASE_HXX |
|---|
| 14 | #include <aw_base.hxx> |
|---|
| 15 | #endif |
|---|
| 16 | |
|---|
| 17 | enum DI_gc { |
|---|
| 18 | DI_G_STANDARD, |
|---|
| 19 | DI_G_NAMES, |
|---|
| 20 | DI_G_RULER, |
|---|
| 21 | DI_G_RULER_DISPLAY, |
|---|
| 22 | DI_G_BELOW_DIST, |
|---|
| 23 | DI_G_ABOVE_DIST, |
|---|
| 24 | DI_G_LAST // must be last |
|---|
| 25 | }; |
|---|
| 26 | |
|---|
| 27 | class AW_device; |
|---|
| 28 | class AW_event; |
|---|
| 29 | class DI_MATRIX; |
|---|
| 30 | |
|---|
| 31 | class DI_dmatrix { |
|---|
| 32 | int screen_width; // dimensions of main screen |
|---|
| 33 | int screen_height; |
|---|
| 34 | |
|---|
| 35 | int cell_width; // width and height of one cell |
|---|
| 36 | int cell_height; |
|---|
| 37 | int cell_padd; // space between cells |
|---|
| 38 | |
|---|
| 39 | bool leadZero; // show leading zero |
|---|
| 40 | int digits; // digits after '.' |
|---|
| 41 | char format_string[50]; // for digits |
|---|
| 42 | |
|---|
| 43 | int horiz_page_start; // number of first element in this page |
|---|
| 44 | int vert_page_start; |
|---|
| 45 | |
|---|
| 46 | int vert_last_view_start; // last value of scrollbars |
|---|
| 47 | int horiz_last_view_start; |
|---|
| 48 | |
|---|
| 49 | int total_cells_horiz; |
|---|
| 50 | int total_cells_vert; |
|---|
| 51 | |
|---|
| 52 | int horiz_page_size; // page size in cells (how many cells per page, |
|---|
| 53 | int vert_page_size; // vertical and horizontal) |
|---|
| 54 | |
|---|
| 55 | int off_dx; // offset values for scrollable area |
|---|
| 56 | int off_dy; |
|---|
| 57 | |
|---|
| 58 | double min_view_dist; // m[i][j]<min_view_dist -> ascii ; else small slider |
|---|
| 59 | double max_view_dist; // m[i][j]>max_view_dist -> ascii ; else small slider |
|---|
| 60 | |
|---|
| 61 | void set_scrollbar_steps(long width, long hight, long xinc, long yinc); |
|---|
| 62 | void scroll_to(int sxpos, int sypos); |
|---|
| 63 | |
|---|
| 64 | public: |
|---|
| 65 | AW_window *awm; |
|---|
| 66 | AW_device *device; // device to draw in |
|---|
| 67 | DI_MATRIX *di_matrix; // the Matrix |
|---|
| 68 | |
|---|
| 69 | DI_MATRIX *get_matrix(); |
|---|
| 70 | |
|---|
| 71 | void monitor_vertical_scroll_cb(AW_window *); // vertical and horizontal |
|---|
| 72 | void monitor_horizontal_scroll_cb(AW_window *); // scrollbar movements |
|---|
| 73 | void display(bool clear); // display data |
|---|
| 74 | void resized(); // call after resize main window |
|---|
| 75 | |
|---|
| 76 | // ******************** real public section ******************* |
|---|
| 77 | void set_slider_min(double d) { min_view_dist = d; }; |
|---|
| 78 | void set_slider_max(double d) { max_view_dist = d; }; |
|---|
| 79 | |
|---|
| 80 | void handle_move(AW_event& event); |
|---|
| 81 | void scroll_cells(int cells_x, int cells_y); |
|---|
| 82 | |
|---|
| 83 | DI_dmatrix(); |
|---|
| 84 | void init(DI_MATRIX *matrix=0); // set the output matrix |
|---|
| 85 | |
|---|
| 86 | // if matrix == 0, use DI_MATRIX::root |
|---|
| 87 | }; |
|---|
| 88 | |
|---|
| 89 | struct save_matrix_params; |
|---|
| 90 | AW_window *DI_create_view_matrix_window(AW_root *awr, DI_dmatrix *dmatrix, save_matrix_params *sparam); |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | #else |
|---|
| 94 | #error di_view_matrix.hxx included twice |
|---|
| 95 | #endif // DI_VIEW_MATRIX_HXX |
|---|