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, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <set>
23#include <vector>
24
25#include <embedded_files.h>
27
28#include "grid_tricks.h"
29
30#define NO_MARGINS 0x0001
31
32
34{
35 enum
36 {
38 };
39
40public:
41 explicit EMBEDDED_FILES_GRID_TRICKS( WX_GRID* aGrid );
42
43 ~EMBEDDED_FILES_GRID_TRICKS() override = default;
44
45 void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
46 void doPopupSelection( wxCommandEvent& event ) override;
47
48protected:
49 //virtual void optionsEditor( int aRow ) = 0;
50
51 virtual bool supportsVisibilityColumn() { return false; }
52
54};
55
56
58{
59public:
60 PANEL_EMBEDDED_FILES( wxWindow* aParent, EMBEDDED_FILES* aFiles, int aFlags = 0,
61 std::vector<const EMBEDDED_FILES*> aInheritedFiles = {} );
62 ~PANEL_EMBEDDED_FILES() override;
63
64 bool TransferDataFromWindow() override;
65 bool TransferDataToWindow() override;
66 bool GetEmbedFonts() const { return m_cbEmbedFonts->GetValue(); }
67
69 EMBEDDED_FILES::EMBEDDED_FILE* AddEmbeddedFile( const wxString& aFileName );
70 bool RemoveEmbeddedFile( const wxString& aFileName );
71
72protected:
73 void onFontEmbedClick( wxCommandEvent& event ) override;
74 void onAddEmbeddedFiles( wxCommandEvent& event ) override;
75 void onDeleteEmbeddedFile( wxCommandEvent& event ) override;
76 void onExportFiles( wxCommandEvent& event ) override;
77
78private:
81 std::vector<const EMBEDDED_FILES*> m_inheritedFiles;
82 std::set<wxString> m_inheritedFileNames;
83};
~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:44