34 lines
1.0 KiB
C
Raw Normal View History

2019-02-02 11:30:40 +08:00
#ifndef TABLE_H
#define TABLE_H
2017-12-06 21:43:47 +08:00
#define MAX_COL_NUM 30
#define MAX_ROW_NUM 30
class c_table: public c_wnd
{
public:
virtual c_wnd* clone(){return new c_table();}
void set_sheet_align(unsigned int align_type){ m_align_type = align_type;}
void set_row_num(unsigned int row_num){ m_row_num = row_num;}
void set_col_num(unsigned int col_num){ m_col_num = col_num;}
void set_row_height(unsigned int height);
void set_col_width(unsigned int width);
int set_row_height(unsigned int index, unsigned int height);
int set_col_width(unsigned int index, unsigned int width);
2018-12-28 15:56:36 +08:00
void set_item(int row, int col, char* str, unsigned int color);
2017-12-06 21:43:47 +08:00
unsigned int get_row_num(){ return m_row_num;}
unsigned int get_col_num(){ return m_col_num;}
c_rect get_item_rect(int row, int col);
protected:
2018-12-28 15:56:36 +08:00
void draw_item(int col, int row, const char* str, unsigned int color);
2017-12-06 21:43:47 +08:00
unsigned int m_align_type;
unsigned int m_row_num;
unsigned int m_col_num;
unsigned int m_row_height[MAX_ROW_NUM];
unsigned int m_col_width[MAX_COL_NUM];
};
#endif