OpenCPN Partial API docs
Loading...
Searching...
No Matches
svg_button.h
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, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 **************************************************************************/
19
20#ifndef SVG__BUTTON__H_
21#define SVG__BUTTON__H_
22#include <fstream>
23#include <sstream>
24
25#include <wx/button.h>
26#include <wx/sstream.h>
27
28#ifndef ocpnUSE_wxBitmapBundle
29#include <wxSVG/svg.h>
30#endif
31
32#include "std_filesystem.h"
33
34
44class SvgButton : public wxButton {
45protected:
46 SvgButton(wxWindow* parent)
47 : wxButton(parent, wxID_ANY, wxEmptyString, wxDefaultPosition,
48 wxDefaultSize, wxBU_EXACTFIT | wxBU_BOTTOM) {}
49
54 void LoadIcon(const char* svg);
55
60 void LoadIcon(const fs::path& path);
61
62};
63
64#endif // SVG__BUTTON__H_
A button capable of loading an svg image.
Definition svg_button.h:44
void LoadIcon(const char *svg)
Load an svg icon available in memory.
void LoadIcon(const fs::path &path)
Load icon from svg file on disk.