Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
area.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_TOOLBOX_INPUT_AREA_H__
22#define __ANTARES_TOOLBOX_INPUT_AREA_H__
23
24#include <yuni/core/event.h>
25#include <wx/panel.h>
26#include <antares/study/study.h>
27#include "input.h"
28#include <wx/arrstr.h>
29#include "../components/htmllistbox/component.h"
30
31namespace Antares
32{
33namespace Toolbox
34{
35namespace InputSelector
36{
40class Area : public AInput, public Yuni::IEventObserver<Area>
41{
42public:
44
45
49 Area(wxWindow* parent);
51 virtual ~Area();
53
54 virtual wxPoint recommendedSize() const
55 {
56 return wxPoint(230, 70);
57 }
58
62 static Data::Area* lastArea();
63
64 void reloadLastArea();
65
66 virtual void update();
67
68public:
72 static Yuni::Event<void(Data::Area*)> onAreaChanged;
73
74protected:
75 virtual void internalBuildSubControls();
76
80 void clear();
81
83 void onDraw(wxPaintEvent& evt);
84
86 void onStudyEndUpdate();
87
88private:
89 void internalSelectionChanged();
90 void onApplicationOnQuit();
91 void onStudyClosed();
92
93private:
95 static wxPanel* pSharedSupport;
97 // static Component::HTMLListbox::Component* pAreaListbox;
98 // Event table
99 DECLARE_EVENT_TABLE()
100
101}; // class Area
102
103} // namespace InputSelector
104} // namespace Toolbox
105} // namespace Antares
106
107#endif // __ANTARES_TOOLBOX_INPUT_AREA_H__
Definition for a single area.
Definition area.h:52
Visual Component for displaying all available areas (and groups)
Definition area.h:41
virtual void update()
Clear then Update the input.
Definition area.cpp:486
static Data::Area * lastArea()
Get the last area selected by the component.
Definition area.cpp:360
virtual ~Area()
Destructor.
Definition area.cpp:350
void onStudyEndUpdate()
The study has been updated.
Definition area.cpp:438
static Yuni::Event< void(Data::Area *)> onAreaChanged
Public event, triggered when the selected area has changed.
Definition area.h:72
Area(wxWindow *parent)
Default Constructor.
Definition area.cpp:334
void onDraw(wxPaintEvent &evt)
Callback: draw event.
Definition area.cpp:454
virtual wxPoint recommendedSize() const
Get the recommended size for the control.
Definition area.h:54
void clear()
Clear the control and broadcast a change in the current selected area.
Definition area.cpp:402