00001
00002
00003 #ifndef jdb_table_h
00004 #define jdb_table_h
00005
00006
00007
00008
00009
00010
00011 class Jdb_table
00012 {
00013 public:
00014 enum
00015 {
00016 Nothing = 0,
00017 Handled,
00018 Redraw,
00019 Edit,
00020 Back,
00021 Exit,
00022 };
00023
00024 virtual unsigned col_width(unsigned col) const = 0;
00025 virtual unsigned cols() const = 0;
00026 virtual unsigned rows() const = 0;
00027 virtual char col_sep(unsigned col) const;
00028 virtual void draw_entry(unsigned row, unsigned col) = 0;
00029 virtual unsigned key_pressed(int key, unsigned &row, unsigned &col);
00030 virtual void print_statline(unsigned row, unsigned col) = 0;
00031 virtual bool has_row_labels() const;
00032 virtual bool has_col_labels() const;
00033 virtual unsigned width() const;
00034 virtual unsigned height() const;
00035
00036 virtual bool edit_entry(unsigned row, unsigned col, unsigned cx, unsigned cy);
00037
00038 public:
00039 bool show(unsigned crow,unsigned ccol);
00040
00041 void draw_table(unsigned row, unsigned col, unsigned lines, unsigned columns);
00042
00043 private:
00044 unsigned vis_cols(unsigned first_col, unsigned *w);
00045
00046 unsigned col_ofs(unsigned first_col, unsigned col);
00047 };
00048
00049 #endif // jdb_table_h