21#ifndef __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_H__
22#define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_H__
24#include <yuni/core/event.h>
25#include <antares/date/date.h>
28#include <antares/study/study.h>
32#pragma warning(disable : 4250)
52class IRenderer :
public Yuni::IEventObserver<IRenderer>
59 cellStyleDefaultAlternate,
60 cellStyleDefaultDisabled,
61 cellStyleDefaultAlternateDisabled,
62 cellStyleDefaultCenter,
63 cellStyleDefaultCenterAlternate,
64 cellStyleDefaultCenterDisabled,
65 cellStyleDefaultCenterAlternateDisabled,
72 cellStyleConstraintEnabled,
73 cellStyleConstraintDisabled,
74 cellStyleConstraintNoWeight,
75 cellStyleConstraintWeight,
76 cellStyleConstraintWeightCount,
77 cellStyleConstraintOperator,
78 cellStyleConstraintType,
79 cellStyleLayerDisabled,
80 cellStyleFilterYearByYearOn,
81 cellStyleFilterYearByYearOff,
82 cellStyleFilterSynthesisOn,
83 cellStyleFilterSynthesisOff,
84 cellStyleFilterUndefined,
85 cellStyleAdqPatchVirtual,
86 cellStyleAdqPatchOutside,
87 cellStyleAdqPatchInside,
93 static const wxChar* CellStyleToCSSClass(CellStyle s);
94 static void CellStyleToCSSClass(CellStyle s, Yuni::String& str);
109 virtual bool valid()
const = 0;
156 virtual wxString
asString(
int x,
int y)
const;
160 virtual double asDouble(
int x,
int y)
const;
167 void appendCellValue(
int x,
int y, Yuni::String& s)
const;
178 virtual bool cellValue(
int x,
int y,
const Yuni::String& value) = 0;
183 virtual void resetColors(
int x,
185 wxColour& background,
186 wxColour& textForeground)
const = 0;
190 virtual IRenderer::CellStyle cellStyle(
int,
int y)
const;
191 IRenderer::CellStyle cellStyleWithNumericCheck(
int x,
int y)
const;
193 virtual wxColour cellBackgroundColor(
int,
int)
const;
194 virtual wxColour cellTextColor(
int,
int)
const;
251 virtual bool onMatrixResize(uint oldX, uint oldY, uint& newX, uint& newY);
281 virtual void applyLayerFiltering(
size_t layerID,
VGridHelper* gridHelper);
308#include "renderer.hxx"
Data provider for Datagrids.
Definition renderer.h:53
virtual bool circularShiftRowsUntilDate(MonthName month, uint daymonth)
Rotate all rows until a given date.
Definition renderer.hxx:125
virtual ~IRenderer()
Destructor.
Definition renderer.cpp:173
virtual bool ensureDataAreLoaded()
Make sure all data are effectively loaded.
Definition renderer.hxx:43
Data::Study::Ptr study
Attached study (if any)
Definition renderer.h:290
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 bool cellValue(int x, int y, const Yuni::String &value)=0
Try to modify a cell value.
virtual void onMatrixLoad()
Event triggered right after a matrix was loaded by the renderer.
Definition renderer.h:256
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 void resizeMatrixToXColumns(uint)
Resize the internal matrix with a given col count.
Definition renderer.h:238
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 wxString rowCaption(int rowIndx) const =0
Get the caption of a row.
virtual int internalWidth() const
The real width of the matrix in memory.
Definition renderer.hxx:33
Yuni::Event< void()> onRefresh
Event on refresh.
Definition renderer.h:285
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 void onStudyClosed()
Event: the study has been closed.
Definition renderer.cpp:184
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 void onScroll()
A scroll event has been triggered.
Definition renderer.h:276
virtual Date::Precision precision()
Time Precision.
Definition renderer.hxx:120
virtual int height() const =0
The effective height of the grid.
virtual wxString columnCaption(int colIndx) const =0
Get the caption of a column.
virtual wxColour horizontalBorderColor(int x, int y) const
Get the color of the horizontal bottom border.
Definition renderer.hxx:80
virtual void onStudyLoaded()
Event: the study has been loaded.
Definition renderer.cpp:179
virtual void onSelectCell(uint, uint)
A cell has been selected.
Definition renderer.h:272
bool invalidate
True to invalidate the current data and force a refresh for the next call to DBGrid:onDraw.
Definition renderer.h:293
IRenderer()
Default constructor.
Definition renderer.cpp:166
Date::Precision dataGridPrecision
The real precision asked by the datagrid.
Definition renderer.h:288
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