OpenCPN Partial API docs
Loading...
Searching...
No Matches
std_icon.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2025 Alec Leamas *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/ *
16 **************************************************************************/
17
24#ifndef STD_ICON_H
25#define STD_ICON_H
26
27#include <string>
28
29#include <wx/bitmap.h>
30
31#include "observable_evtvar.h"
32
37class StdIcon {
38public:
46 StdIcon(const wxWindow* parent, const std::string& svg_file,
47 EventVar& color_change_evt, bool touch);
48
50 const wxBitmap& GetBitmap();
51
52private:
53 ObsListener m_color_change_lstnr;
54 EventVar& m_color_change_evt;
55 bool m_is_night;
56 wxBitmap m_day_bitmap;
57 wxBitmap m_night_bitmap;
58 wxBitmap& m_bitmap;
59};
60
61#endif // STD_ICON_H
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
Define an action to be performed when a KeyProvider is notified.
Definition observable.h:257
Small monochrome SVG icon scaled to the height of a char.
Definition std_icon.h:37
const wxBitmap & GetBitmap()
Return bitmap, either day or inverted night variant.
Definition std_icon.cpp:59
A common variable shared between producer and consumer which supports Listen() and Notify().