initial commit
[goodguy/history.git] / cinelerra-5.0 / guicast / bcwidgetgrid.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2005 Pierre Dumuid
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef BCWIDGETGRID_H
23 #define BCWIDGETGRID_H
24
25 #include "arraylist.h"
26 #include "bcrelocatablewidget.h"
27 #include "bctoggle.h"
28 #include "bctextbox.h"
29 #include "bcsubwindow.h"
30
31 #define BC_WG_Rows 25
32 #define BC_WG_Cols 10
33
34
35
36
37 class BC_WidgetGrid : public BC_RelocatableWidget {
38 public:  
39         BC_WidgetGrid(int x, int y, int x_r, int y_b, int colgaps, int rowgaps);
40         virtual ~BC_WidgetGrid() {}
41
42         BC_RelocatableWidget * add(BC_RelocatableWidget *h, int row, int column);
43         void calculate_maxs();
44         void clear_widget(int row, int column);
45
46         int  get_h();
47         int  get_h_wm();
48         int  get_w();
49         int  get_w_wm();
50
51         int  getw_w(int row, int column);
52         int  getw_h(int row, int column);
53
54         int  guess_x(int col);
55         int  guess_y(int row);
56
57         void move_widgets();
58         void print();
59         int  reposition_widget(int x, int y, int w = -1, int h = -1);
60
61         void set_align(int r,int c,int va, int ha);
62         void set_crspan(int r,int c,int cs, int rs);
63         void set_minh(int c, int h);
64         void set_minw(int c, int w);
65         void setw_position(int row,int column,int x, int y);
66
67         enum {
68                 VALIGN_TOP,
69                 VALIGN_CENTER,
70                 VALIGN_BOTTOM
71         };
72
73         enum {
74                 HALIGN_LEFT,
75                 HALIGN_CENTER,
76                 HALIGN_RIGHT
77         };
78
79         enum {
80                 BC_WT_NONE,
81                 BC_WT_RelocatableWidget
82         };
83
84 private:
85         int            widget_types[BC_WG_Rows][BC_WG_Cols];
86         int            widget_valign[BC_WG_Rows][BC_WG_Cols];
87         int            widget_halign[BC_WG_Rows][BC_WG_Cols];
88         int            widget_colspan[BC_WG_Rows][BC_WG_Cols];
89         int            widget_rowspan[BC_WG_Rows][BC_WG_Cols];
90
91         // array of pointers:
92         BC_RelocatableWidget *widget_widgs[BC_WG_Rows][BC_WG_Cols];
93
94         int rowgaps;
95         int colgaps;
96
97         int maxw[BC_WG_Cols];
98         int maxh[BC_WG_Rows];
99
100         int minw[BC_WG_Cols];
101         int minh[BC_WG_Rows];
102         
103         int x_l,x_r,y_t,y_b; // left, right, top,bottom margins.
104 };
105
106
107 class BC_WidgetGridList : public ArrayList<BC_WidgetGrid*>
108 {
109 public:
110         BC_WidgetGridList();
111         ~BC_WidgetGridList();
112
113
114 private:
115         
116 };
117
118 #endif