Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
renderer.hxx
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#include "renderer.h"
22#ifndef __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_HXX__
23#define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_HXX__
24
25namespace Antares
26{
27namespace Component
28{
29namespace Datagrid
30{
31namespace Renderer
32{
33inline int IRenderer::internalWidth() const
34{
35 return width();
36}
37
38inline int IRenderer::internalHeight() const
39{
40 return height();
41}
42
44{
45 return false;
46}
47
48inline IRenderer::CellStyle IRenderer::cellStyleWithNumericCheck(int x, int y) const
49{
50 return Yuni::Math::Zero(cellNumericValue(x, y))
51 ? ((y % 2) ? cellStyleDefaultAlternateDisabled : cellStyleDefaultDisabled)
52 : ((y % 2) ? cellStyleDefaultAlternate : cellStyleDefault);
53}
54
55inline IRenderer::CellStyle IRenderer::cellStyle(int, int y) const
56{
57 return ((y % 2) ? cellStyleDefaultAlternate : cellStyleDefault);
58}
59
60inline wxColour IRenderer::cellBackgroundColor(int, int) const
61{
62 return wxColour(255, 255, 255);
63}
64
65inline wxColour IRenderer::cellTextColor(int, int) const
66{
67 return wxColour(255, 0, 0);
68}
69
70inline bool IRenderer::onMatrixResize(uint, uint, uint&, uint&)
71{
72 return true;
73}
74
75inline wxColour IRenderer::verticalBorderColor(int, int) const
76{
77 return Default::BorderColor();
78}
79
80inline wxColour IRenderer::horizontalBorderColor(int, int) const
81{
82 return Default::BorderColor();
83}
84
85inline uint IRenderer::maxWidthResize() const
86{
87 return 0;
88}
89
90inline uint IRenderer::maxHeightResize() const
91{
92 return 0;
93}
94
95inline int IRenderer::cellAlignment(int, int) const
96{
97 return 0;
98}
99
100inline int IRenderer::columnWidthCustom(int) const
101{
102 return 0;
103}
104
105inline void IRenderer::hintForColumnWidth(int, wxString& out) const
106{
107 out.Clear();
108}
109
110inline wxString IRenderer::asString(int x, int y) const
111{
112 return cellValue(x, y);
113}
114
115inline double IRenderer::asDouble(int x, int y) const
116{
117 return cellNumericValue(x, y);
118}
119
120inline Date::Precision IRenderer::precision()
121{
122 return Date::stepAny;
123}
124
125inline bool IRenderer::circularShiftRowsUntilDate(MonthName, uint)
126{
127 return false; // not implemented
128}
129
130inline void IRenderer::applyLayerFiltering(size_t /* layerID */, VGridHelper* /* gridHelper */)
131{
132}
133
134} // namespace Renderer
135} // namespace Datagrid
136} // namespace Component
137} // namespace Antares
138
139#endif // __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_HXX__
virtual bool circularShiftRowsUntilDate(MonthName month, uint daymonth)
Rotate all rows until a given date.
Definition renderer.hxx:125
virtual bool ensureDataAreLoaded()
Make sure all data are effectively loaded.
Definition renderer.hxx:43
virtual double asDouble(int x, int y) const
Read a cell as a double.
Definition renderer.hxx:115
virtual int internalHeight() const
The real height of the matrix in memory.
Definition renderer.hxx:38
virtual double cellNumericValue(int x, int y) const =0
Get the floating value of a Cell.
virtual wxColour verticalBorderColor(int x, int y) const
Get the color of the vertical right border.
Definition renderer.hxx:75
virtual wxString cellValue(int x, int y) const =0
Get the string representation of a Cell.
virtual uint maxWidthResize() const
The most suitable column count.
Definition renderer.hxx:85
virtual wxString asString(int x, int y) const
Read a cell as a string.
Definition renderer.hxx:110
virtual void hintForColumnWidth(int x, wxString &out) const
String to use.
Definition renderer.hxx:105
virtual int internalWidth() const
The real width of the matrix in memory.
Definition renderer.hxx:33
virtual bool onMatrixResize(uint oldX, uint oldY, uint &newX, uint &newY)
Event trigerred before resizing a matrix.
Definition renderer.hxx:70
virtual int width() const =0
The effective width of the grid.
virtual int cellAlignment(int x, int y) const
Get the alignment of a cell (-1: left, 0: center, +1: right)
Definition renderer.hxx:95
virtual Date::Precision precision()
Time Precision.
Definition renderer.hxx:120
virtual int height() const =0
The effective height of the grid.
virtual wxColour horizontalBorderColor(int x, int y) const
Get the color of the horizontal bottom border.
Definition renderer.hxx:80
virtual uint maxHeightResize() const
The most suitable column count.
Definition renderer.hxx:90
virtual int columnWidthCustom(int x) const
Get how the a column must resize (0: auto, >0: specific width, <0: use custom string)
Definition renderer.hxx:100
Wrapper between a wxGridTableBase and a renderer
Definition gridhelper.h:47