KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_embedded_files.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
25
26#include <set>
27#include <vector>
28
29#include <embedded_files.h>
31
32#include "grid_tricks.h"
33
34#define NO_MARGINS 0x0001
35
36
38{
39 enum
40 {
42 };
43
44public:
45 explicit EMBEDDED_FILES_GRID_TRICKS( WX_GRID* aGrid );
46
47 ~EMBEDDED_FILES_GRID_TRICKS() override = default;
48
49 void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
50 void doPopupSelection( wxCommandEvent& event ) override;
51
52protected:
53 //virtual void optionsEditor( int aRow ) = 0;
54
55 virtual bool supportsVisibilityColumn() { return false; }
56
58};
59
60
62{
63public:
64 PANEL_EMBEDDED_FILES( wxWindow* aParent, EMBEDDED_FILES* aFiles, int aFlags = 0,
65 std::vector<const EMBEDDED_FILES*> aInheritedFiles = {} );
66 ~PANEL_EMBEDDED_FILES() override;
67
68 bool TransferDataFromWindow() override;
69 bool TransferDataToWindow() override;
70 bool GetEmbedFonts() const { return m_cbEmbedFonts->GetValue(); }
71
73 EMBEDDED_FILES::EMBEDDED_FILE* AddEmbeddedFile( const wxString& aFileName );
74 bool RemoveEmbeddedFile( const wxString& aFileName );
75
76protected:
77 void onFontEmbedClick( wxCommandEvent& event ) override;
78 void onAddEmbeddedFiles( wxCommandEvent& event ) override;
79 void onDeleteEmbeddedFile( wxCommandEvent& event ) override;
80 void onExportFiles( wxCommandEvent& event ) override;
81
82private:
85 std::vector<const EMBEDDED_FILES*> m_inheritedFiles;
86 std::set<wxString> m_inheritedFileNames;
87};
~EMBEDDED_FILES_GRID_TRICKS() override=default
void doPopupSelection(wxCommandEvent &event) override
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
GRID_TRICKS(WX_GRID *aGrid)
PANEL_EMBEDDED_FILES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
PANEL_EMBEDDED_FILES(wxWindow *aParent, EMBEDDED_FILES *aFiles, int aFlags=0, std::vector< const EMBEDDED_FILES * > aInheritedFiles={})
bool RemoveEmbeddedFile(const wxString &aFileName)
std::set< wxString > m_inheritedFileNames
EMBEDDED_FILES * GetLocalFiles()
void onFontEmbedClick(wxCommandEvent &event) override
void onAddEmbeddedFiles(wxCommandEvent &event) override
std::vector< const EMBEDDED_FILES * > m_inheritedFiles
void onDeleteEmbeddedFile(wxCommandEvent &event) override
bool TransferDataToWindow() override
EMBEDDED_FILES * m_localFiles
void onExportFiles(wxCommandEvent &event) override
EMBEDDED_FILES::EMBEDDED_FILE * AddEmbeddedFile(const wxString &aFileName)
bool TransferDataFromWindow() override
@ GRIDTRICKS_FIRST_CLIENT_ID
Definition grid_tricks.h:48