00001 #ifndef BCWIDGETGRID_H
00002 #define BCWIDGETGRID_H
00003
00004 #include "arraylist.h"
00005 #include "bcrelocatablewidget.h"
00006 #include "bctoggle.h"
00007 #include "bctextbox.h"
00008 #include "bcsubwindow.h"
00009
00010 #define BC_WG_Rows 25
00011 #define BC_WG_Cols 10
00012
00013
00014
00015
00016 class BC_WidgetGrid : public BC_RelocatableWidget {
00017 public:
00018
00019 BC_WidgetGrid(int x, int y, int x_r, int y_b, int colgaps, int rowgaps);
00020
00021 BC_RelocatableWidget * add(BC_RelocatableWidget *h, int row, int column);
00022 void calculate_maxs();
00023 void clear_widget(int row, int column);
00024
00025 int get_h();
00026 int get_h_wm();
00027 int get_w();
00028 int get_w_wm();
00029
00030 int getw_w(int row, int column);
00031 int getw_h(int row, int column);
00032
00033 int guess_x(int col);
00034 int guess_y(int row);
00035
00036 void move_widgets();
00037 void print();
00038 int reposition_widget(int x, int y, int w = -1, int h = -1);
00039
00040 void set_align(int r,int c,int va, int ha);
00041 void set_crspan(int r,int c,int cs, int rs);
00042 void set_minh(int c, int h);
00043 void set_minw(int c, int w);
00044 void setw_position(int row,int column,int x, int y);
00045
00046 enum {
00047 VALIGN_TOP,
00048 VALIGN_CENTER,
00049 VALIGN_BOTTOM
00050 };
00051
00052 enum {
00053 HALIGN_LEFT,
00054 HALIGN_CENTER,
00055 HALIGN_RIGHT
00056 };
00057
00058 enum {
00059 BC_WT_NONE,
00060 BC_WT_RelocatableWidget
00061 };
00062
00063 private:
00064 int widget_types[BC_WG_Rows][BC_WG_Cols];
00065 int widget_valign[BC_WG_Rows][BC_WG_Cols];
00066 int widget_halign[BC_WG_Rows][BC_WG_Cols];
00067 int widget_colspan[BC_WG_Rows][BC_WG_Cols];
00068 int widget_rowspan[BC_WG_Rows][BC_WG_Cols];
00069
00070
00071 BC_RelocatableWidget *widget_widgs[BC_WG_Rows][BC_WG_Cols];
00072
00073 int rowgaps;
00074 int colgaps;
00075
00076 int maxw[BC_WG_Cols];
00077 int maxh[BC_WG_Rows];
00078
00079 int minw[BC_WG_Cols];
00080 int minh[BC_WG_Rows];
00081
00082 int x_l,x_r,y_t,y_b;
00083 };
00084
00085
00086 class BC_WidgetGridList : public ArrayList<BC_WidgetGrid*>
00087 {
00088 public:
00089 BC_WidgetGridList();
00090 ~BC_WidgetGridList();
00091
00092
00093 private:
00094
00095 };
00096
00097 #endif