Antares Simulator
Power System Simulator
mainpanel.h
1 /*
2  * Copyright 2007-2025, 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_TOOLBOX_COMPONENT_MAIN_PANEL_H__
22 #define __ANTARES_TOOLBOX_COMPONENT_MAIN_PANEL_H__
23 
24 #include <wx/dc.h>
25 #include <ui/common/component/panel.h>
26 
27 namespace Antares::Component
28 {
29 class MainPanel final: public Panel, public Yuni::IEventObserver<MainPanel>
30 {
31 public:
33 
34 
38  MainPanel(wxWindow* parent);
40  virtual ~MainPanel();
41 
43 
45 
46  const wxString& studyCaption() const
48  {
49  return pStudyCaption;
50  }
51 
53  void studyCaption(const wxString& s);
54 
56 
58 
59  const wxString& author() const
61  {
62  return pAuthor;
63  }
64 
65  const wxString& editor() const
66  {
67  return pEditor;
68  }
69 
71  void author(const wxString& s);
73  void editor(const wxString& s);
74 
75  void refreshFromStudy();
76 
77 private:
81  void onDraw(wxPaintEvent& evt);
82 
86  void onEraseBackground(wxEraseEvent&)
87  {
88  }
89 
97  void addProperty(wxDC& dc,
98  const wxString& caption,
99  const wxString& text,
100  const wxSize& size,
101  int& posY) const;
102 
103  void onStudyChanged(Antares::Data::Study& study);
104  void onStudyChanged();
105 
106 private:
108  wxString pStudyCaption;
110  wxString pAuthor;
111  wxString pEditor; // TODO
113  int pCachedSizeY;
115  wxBitmap* pBeta;
117  wxBitmap* pRC;
118 
119  DECLARE_EVENT_TABLE()
120 
121 }; // class MainPanel
122 
123 } // namespace Antares::Component
124 
125 #endif // __ANTARES_TOOLBOX_COMPONENT_MAIN_PANEL_H__
Definition: mainpanel.h:30
MainPanel(wxWindow *parent)
Constructor.
Definition: mainpanel.cpp:40
const wxString & author() const
Get the author.
Definition: mainpanel.h:60
const wxString & studyCaption() const
Get the caption/title of the study.
Definition: mainpanel.h:47
virtual ~MainPanel()
Destructor.
Definition: mainpanel.cpp:60
Panel implementation.
Definition: panel.h:34
Definition: study.h:57