Blender  V2.93
spreadsheet_draw.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
19 #include "BLI_vector.hh"
20 
21 struct uiBlock;
22 struct bContext;
23 struct ARegion;
24 
25 namespace blender::ed::spreadsheet {
26 
29  int xmin, ymin;
30  int width, height;
31 };
32 
34  public:
38  int tot_rows = 0;
39  int tot_columns = 0;
40 
42  virtual ~SpreadsheetDrawer();
43 
44  virtual void draw_top_row_cell(int column_index, const CellDrawParams &params) const;
45 
46  virtual void draw_left_column_cell(int row_index, const CellDrawParams &params) const;
47 
48  virtual void draw_content_cell(int row_index,
49  int column_index,
50  const CellDrawParams &params) const;
51 
52  virtual int column_width(int column_index) const;
53 };
54 
56  ARegion *region,
57  const SpreadsheetDrawer &spreadsheet_drawer);
58 
59 } // namespace blender::ed::spreadsheet
virtual void draw_top_row_cell(int column_index, const CellDrawParams &params) const
virtual int column_width(int column_index) const
virtual void draw_left_column_cell(int row_index, const CellDrawParams &params) const
virtual void draw_content_cell(int row_index, int column_index, const CellDrawParams &params) const
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void draw_spreadsheet_in_region(const bContext *C, ARegion *region, const SpreadsheetDrawer &drawer)