KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_edit_library_tables.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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
21#pragma once
22
23#include <dialog_shim.h>
24#include <functional>
25#include <wx/panel.h>
26#include <wx/aui/auibook.h>
27#include <widgets/wx_infobar.h>
28
29
31{
32public:
35
36public:
37 DIALOG_EDIT_LIBRARY_TABLES( wxWindow* aParent, const wxString& aTitle );
38
39 void InstallPanel( wxPanel* aPanel, wxAuiNotebook* aNotebook );
40
41 bool TransferDataToWindow() override;
42 bool TransferDataFromWindow() override;
43
44 void ShowInfoBarError( const wxString& aErrorMsg, bool aShowCloseButton = false,
45 WX_INFOBAR::MESSAGE_TYPE aType = WX_INFOBAR::MESSAGE_TYPE::GENERIC )
46 {
47 m_infoBar->RemoveAllButtons();
48
49 if( aShowCloseButton )
50 m_infoBar->AddCloseButton();
51
52 m_infoBar->ShowMessageFor( aErrorMsg, 8000, wxICON_ERROR, aType );
53 }
54
55 bool CanClose();
56
57protected:
59 wxAuiNotebook* m_notebook;
61 bool m_closeOKed = false;
62
63private:
64 void onCloseWindow( wxCloseEvent& aEvent );
65 void onCancelButton( wxCommandEvent& aEvent );
66};
void onCloseWindow(wxCloseEvent &aEvent)
void onCancelButton(wxCommandEvent &aEvent)
void InstallPanel(wxPanel *aPanel, wxAuiNotebook *aNotebook)
DIALOG_EDIT_LIBRARY_TABLES(wxWindow *aParent, const wxString &aTitle)
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
A modified version of the wxInfoBar class that allows us to:
Definition wx_infobar.h:76
INFOBAR_MESSAGE_TYPE MESSAGE_TYPE
Definition wx_infobar.h:94