Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
grid.h
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#ifndef __ANTARES_WINDOWS_INSPECTOR_GRID_H__
22#define __ANTARES_WINDOWS_INSPECTOR_GRID_H__
23
24#include <antares/study/study.h>
25#include <wx/propgrid/propgrid.h>
26#include <wx/propgrid/advprops.h>
27#include <wx/propgrid/manager.h>
28#include <wx/propgrid/editors.h>
29#include "frame.h"
30
31namespace Antares
32{
33namespace Window
34{
35namespace Inspector
36{
40class InspectorGrid final : public wxPropertyGrid
41{
42public:
43 InspectorGrid(Frame& frame,
44 wxWindow* parent,
45 wxWindowID id = wxID_ANY,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = (0)) :
49
50 wxPropertyGrid(parent, id, pos, size, style), pFrame(frame)
51 {
52 }
53
54 virtual ~InspectorGrid()
55 {
56 }
57
58 void apply(const InspectorData::Ptr& data)
59 {
60 pCurrentSelection = data;
61 }
62
63protected:
64 using PropertyNameType = Yuni::CString<128, false>;
65
66 void OnPropertyChanging(wxPropertyGridEvent& event);
67 bool onPropertyChanging_A(wxPGProperty*, const PropertyNameType& name, const wxVariant& value);
68 bool onPropertyChanging_C(wxPGProperty*, const PropertyNameType& name, const wxVariant& value);
69 bool onPropertyChanging_Constraint(wxPGProperty*,
70 const PropertyNameType& name,
71 const wxVariant& value);
72 bool onPropertyChanging_ThermalCluster(wxPGProperty*,
73 const PropertyNameType& name,
74 const wxVariant& value);
75 bool onPropertyChanging_RenewableClusters(const PropertyNameType& name, const wxVariant& value);
76 bool onPropertyChanging_L(wxPGProperty*, const PropertyNameType& name, const wxVariant& value);
77 bool onPropertyChanging_S(wxPGProperty*, const PropertyNameType& name, const wxVariant& value);
78
79private:
81 Frame& pFrame;
83 InspectorData::Ptr pCurrentSelection;
84 // Event table
85 DECLARE_EVENT_TABLE()
86
87}; // class InspectorGrid
88
89} // namespace Inspector
90} // namespace Window
91} // namespace Antares
92
93#endif // __ANTARES_WINDOWS_INSPECTOR_GRID_H__
std::shared_ptr< InspectorData > Ptr
The most suitable smart pointer for the class.
Definition data.h:44
Custom implementation of a property grid.
Definition grid.h:41