source: tags/initial/PHYLO/PH_display.hxx

Last change on this file was 2, checked in by oldcode, 23 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1#define SPECIES_NAME_LEN 10    // only for displaying speciesnames
2 
3extern char **filter_text;
4
5class AP_display{
6          AW_device *device;                   // device to draw in
7          AW_pos screen_width;                 // dimensions of main screen
8          AW_pos screen_height;
9          long cell_width;                     // width and height of one cell
10          long cell_height;
11          long cell_offset;                    // don't write on base line of cell
12          long horiz_page_start;               // number of first element in this page
13          long vert_page_start;         
14          long vert_last_view_start;           // last value of scrollbars
15          long horiz_last_view_start;
16          long total_cells_horiz;
17          long total_cells_vert;
18          display_type display_what;         
19          long horiz_page_size;                // page size in cells (how many cells per page,
20          long vert_page_size;                 // vertical and horizontal)
21          long off_dx;                         // offset values for devic.shift_dx(y)
22          long off_dy; 
23         
24          void set_scrollbar_steps(AW_window *,long,long,long,long); 
25          void print(void);                    // print private parameters (debugging)
26         
27
28public:
29          AP_display(void);               // constructor
30   static AP_display *apdisplay;
31          void initialize(display_type);
32          void display(void);                  // display data (according to display type: matrix ...)
33          display_type displayed(void) { return display_what; };
34          void clear_window(void) { if(device) device->clear(); };
35          void resized(void);                  // call after resize main window
36          void monitor_vertical_scroll_cb(AW_window *);    // vertical and horizontal
37          void monitor_horizontal_scroll_cb(AW_window *);  // scrollbar movements
38};
39
40
41class AP_display_status
42{
43          AW_device *device;
44          short font_width; 
45          short font_height;
46          AW_pos max_x;                           // screensize
47          AW_pos max_y;
48          AW_pos x_pos;                           // position of cursor
49          AW_pos y_pos;
50          AW_pos tab_pos;
51                                     
52public:
53          AP_display_status(AW_device *);
54          void set_origin(void)              { device->reset();
55                                               device->shift_x(font_width); 
56                                               device->shift_y(font_height); };
57          void newline(void)                 { x_pos=0; 
58                                               y_pos+=(y_pos>=max_y) ? 0.0 : 1.0; };
59          AW_pos get_size(char c)            { return((c=='x') ? max_x : max_y); };
60          void set_cursor(AW_pos x,AW_pos y) { x_pos=(x<=max_x) ? x : x_pos; 
61                                               y_pos=(y<=max_y) ? y : y_pos; };
62          void move_x(AW_pos d)              { x_pos+=(x_pos+d<=max_x) ? d : 0; };
63          void move_y(AW_pos d)              { y_pos+=(y_pos+d<=max_y) ? d : 0; };
64          void set_cursor_x(AW_pos x)        { x_pos = x; };
65          void set_cursor_y(AW_pos y)        { y_pos = y; };
66          AW_pos get_cursor_pos(char c)      { return((c=='x') ? x_pos : y_pos); };
67          void set_tab(void)                 { tab_pos = x_pos; };       
68          AW_pos get_tab(void)               { return tab_pos; };
69          void write(const char *);                           // text to write
70          void write(long);                             // converts long
71          void write(double);                           // float to text
72          void clear(void);
73};         
74         
75
76
77           
78                           
Note: See TracBrowser for help on using the repository browser.