Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
listbox-panel.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_COMMON_COMPONENT_SPOTLIGHT_LISTBOX_PANEL_H__
22#define __ANTARES_COMMON_COMPONENT_SPOTLIGHT_LISTBOX_PANEL_H__
23
24#include <yuni/yuni.h>
25#include "../../wx-wrapper.h"
26#include <wx/scrolwin.h>
27#include "spotlight.h"
28
29namespace Antares
30{
31namespace Component
32{
33class ListboxPanel : public wxScrolledWindow, public Yuni::IEventObserver<ListboxPanel>
34{
35public:
36 enum
37 {
38 searchResultTextHeight = 25,
39 };
40
41public:
43
44
47 ListboxPanel(Spotlight* parent, uint flags);
49 virtual ~ListboxPanel();
51
52 void updateItems(const Spotlight::IItem::VectorPtr& vptr,
54
61
62protected:
64 void onDraw(wxPaintEvent& evt);
66 void onMouseMotion(wxMouseEvent& evt);
68 void onMouseLeave(wxMouseEvent&);
70 void onEraseBackground(wxEraseEvent&)
71 {
72 }
75
77 void onMouseLeftUp(wxMouseEvent& evt);
79 void onMouseDblClick(wxMouseEvent& evt);
84
85private:
87 Spotlight* pParent;
93 wxString pLonguestGroupName;
94 wxSize pLonguestGroupNameSize;
95 bool pRecomputeLonguestGroupNameSize;
96 wxColour pDisabledColor;
98 wxString pCacheResultText;
99 wxSize pCacheResultTextSize;
100 //
101 uint pMouseOverItem;
105 uint pFlags;
106
108 YString pLastGroupName;
109
110protected:
111 // Event table
112 DECLARE_EVENT_TABLE()
113
114}; // class ListboxPanel
115
116} // namespace Component
117} // namespace Antares
118
119#endif // __ANTARES_COMMON_COMPONENT_SPOTLIGHT_LISTBOX_PANEL_H__
Definition listbox-panel.h:34
void onMouseMotion(wxMouseEvent &evt)
Event: mouse moved.
Definition listbox-panel.cpp:82
void onMouseLeave(wxMouseEvent &)
Event: mouse leave.
Definition listbox-panel.cpp:127
void onMouseLeftUp(wxMouseEvent &evt)
Event: Mouse Click.
Definition listbox-panel.cpp:329
void onDraw(wxPaintEvent &evt)
Event: draw the panel.
Definition listbox-panel.cpp:138
void doSelectItemFromMouseDblClick()
Delayed event.
Definition listbox-panel.cpp:343
void onMouseDblClick(wxMouseEvent &evt)
Event: Mouse Double Click.
Definition listbox-panel.cpp:336
void resetProvider(Spotlight::IProvider::Ptr provider)
Reset the data provider.
Definition listbox-panel.cpp:133
virtual ~ListboxPanel()
Destructor.
Definition listbox-panel.cpp:70
void recomputeBoundsForLonguestGroupName(wxDC &dc)
Recompute the bounds of the longuest group name.
Definition listbox-panel.cpp:75
ListboxPanel(Spotlight *parent, uint flags)
Default constructor.
Definition listbox-panel.cpp:52
void doSelectItemFromMouseLeftUp()
Delayed event.
Definition listbox-panel.cpp:384
void onEraseBackground(wxEraseEvent &)
UI: Erase background, empty to avoid flickering.
Definition listbox-panel.h:70
std::shared_ptr< Vector > VectorPtr
Vector Ptr.
Definition spotlight.h:35
std::shared_ptr< IProvider > Ptr
ptr
Definition spotlight.h:34
std::shared_ptr< Vector > VectorPtr
Vector ptr.
Definition spotlight.h:36
Definition spotlight.h:40