KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_footprint_users.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 2
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 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#pragma once
21
22#include <wx/timer.h>
23
24#include <lib_id.h>
26
28
29class KIWAY;
30
31
36{
37public:
44 DIALOG_FOOTPRINT_USERS( wxWindow* aParent, KIWAY& aKiway, const LIB_ID& aFootprint, int aFootprintPinCount );
45
46private:
47 void onMatchTypeChanged( wxCommandEvent& aEvent );
48 void onLoadTimer( wxTimerEvent& aEvent );
49 void onUserActivated( wxDataViewEvent& aEvent );
50 void onUserRightClick( wxDataViewEvent& aEvent );
51 void onUserKeyDown( wxKeyEvent& aEvent );
52
55 void updateUsers();
56
58 int matchCategories() const;
59
62
63 void showUsers( const FOOTPRINT_USERS_RESULT& aResult );
64 void showLoadIndication( bool aShow, float aProgress = 0.0f );
65
67 wxString userSymbolName( int aRow ) const;
68
69 void openSymbolInEditor( const wxString& aSymbolName );
70 void copySymbolName( const wxString& aSymbolName );
71
75 wxTimer m_loadTimer;
77};
DIALOG_FOOTPRINT_USERS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Footprint users"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(750, 450), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void onMatchTypeChanged(wxCommandEvent &aEvent)
void showLoadIndication(bool aShow, float aProgress=0.0f)
void onUserActivated(wxDataViewEvent &aEvent)
void showUsers(const FOOTPRINT_USERS_RESULT &aResult)
void onUserRightClick(wxDataViewEvent &aEvent)
wxString userSymbolName(int aRow) const
Return the "library:symbol" name of a table row, or an empty string if there is none.
int matchCategories() const
Return the enabled match categories, as the bit set of FOOTPRINT_USERS_MATCH_CATEGORY.
void copySymbolName(const wxString &aSymbolName)
bool symbolLibrariesReady()
Return true once the symbol libraries are loaded, showing the progress when they are not.
void openSymbolInEditor(const wxString &aSymbolName)
void onLoadTimer(wxTimerEvent &aEvent)
void updateUsers()
Show the users for the enabled match categories, querying them when they are not cached yet.
DIALOG_FOOTPRINT_USERS(wxWindow *aParent, KIWAY &aKiway, const LIB_ID &aFootprint, int aFootprintPinCount)
void onUserKeyDown(wxKeyEvent &aEvent)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:348
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
The outcome of a footprint users query, and the JSON encoding used to move it across the Eeschema kif...