21#ifndef GRID_TEXT_BUTTON_HELPERS_H
22#define GRID_TEXT_BUTTON_HELPERS_H
30#include <wx/generic/gridctrl.h>
31#include <wx/generic/grideditors.h>
59 const std::vector<EMBEDDED_FILES*>& aAdditionalLookupFiles = {} );
63 const wxString& aSymbolNetlist = wxEmptyString );
70 const wxString& aPreselect = wxEmptyString ) :
75 wxGridCellEditor*
Clone()
const override
80 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
93 m_symbolNetlistProvider( aSymbolNetlistProvider )
98 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
111 std::vector<EMBEDDED_FILES*> aFilesStack = {} ) :
113 m_searchStack( aSearchStack ),
117 std::vector<EMBEDDED_FILES*> embedTargets;
119 if( !aFilesStack.empty() )
120 embedTargets.push_back( aFilesStack.front() );
133 wxGridCellEditor*
Clone()
const override
138 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
165 bool aNormalize,
const wxString& aNormalizeBasePath,
166 std::function<wxString(
WX_GRID*
grid,
int row )> aFileFilterFn,
167 std::function<wxString(
const wxString& )> aEmbedCallback =
nullptr ) :
168 m_dlg( aParentDialog ),
189 const wxString& aFileFilter,
bool aNormalize =
false,
190 const wxString& aNormalizeBasePath = wxEmptyString,
191 std::function<wxString(
const wxString& )> aEmbedCallback =
nullptr ) :
192 m_dlg( aParentDialog ),
201 wxGridCellEditor*
Clone()
const override
215 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
240 const bool aIsNullable =
false ) :
249 wxGridCellEditor*
Clone()
const override
254 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
255 void BeginEdit(
int aRow,
int aCol, wxGrid* aGrid )
override;
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
std::function< wxString(int)> m_symbolNetlistProvider
GRID_CELL_FPID_EDITOR(DIALOG_SHIM *aParent, const std::function< wxString(int)> &aSymbolNetlistProvider={})
wxGridCellEditor * Clone() const override
GRID_CELL_NULLABLE_INTERFACE()
virtual bool IsNullable() const
wxGridCellEditor * Clone() const override
GRID_CELL_PATH_EDITOR(DIALOG_SHIM *aParentDialog, WX_GRID *aGrid, wxString *aCurrentDir, const wxString &aFileFilter, bool aNormalize=false, const wxString &aNormalizeBasePath=wxEmptyString, std::function< wxString(const wxString &)> aEmbedCallback=nullptr)
Constructor.
std::function< wxString(WX_GRID *aGrid, int aRow)> m_fileFilterFn
wxString m_normalizeBasePath
std::function< wxString(const wxString &)> m_embedCallback
GRID_CELL_PATH_EDITOR(DIALOG_SHIM *aParentDialog, WX_GRID *aGrid, wxString *aCurrentDir, bool aNormalize, const wxString &aNormalizeBasePath, std::function< wxString(WX_GRID *grid, int row)> aFileFilterFn, std::function< wxString(const wxString &)> aEmbedCallback=nullptr)
Constructor.
wxGridCellEditor * Clone() const override
GRID_CELL_RUN_FUNCTION_EDITOR(DIALOG_SHIM *aParent, const std::function< void(int, int)> aFunction, const bool aIsNullable=false)
std::function< void(int, int)> m_function
wxGridCellEditor * Clone() const override
GRID_CELL_SYMBOL_ID_EDITOR(DIALOG_SHIM *aParent, const wxString &aPreselect=wxEmptyString)
void BeginEdit(int aRow, int aCol, wxGrid *aGrid) override
std::function< GRID_CELL_URL_EDITOR_CONTEXT(int)> m_contextProvider
SEARCH_STACK * m_searchStack
GRID_CELL_URL_EDITOR(DIALOG_SHIM *aParent, SEARCH_STACK *aSearchStack, const std::function< GRID_CELL_URL_EDITOR_CONTEXT(int)> &aContextProvider)
wxGridCellEditor * Clone() const override
GRID_CELL_URL_EDITOR(DIALOG_SHIM *aParent, SEARCH_STACK *aSearchStack=nullptr, std::vector< EMBEDDED_FILES * > aFilesStack={})
Look for files in a number of paths.
GRID_CELL_URL_EDITOR_CONTEXT MakeGridCellUrlEditorContext(const std::vector< EMBEDDED_FILES * > &aEmbedTargets, const std::vector< EMBEDDED_FILES * > &aAdditionalLookupFiles)
KICOMMON_API GRID_CELL_URL_EDITOR_CONTEXT MakeGridCellUrlEditorContext(const std::vector< EMBEDDED_FILES * > &aEmbedTargets, const std::vector< EMBEDDED_FILES * > &aAdditionalLookupFiles={})
KICOMMON_API bool SelectFootprintFromChooser(DIALOG_SHIM *aDialog, wxString &aFootprint, const wxString &aSymbolNetlist=wxEmptyString)
std::vector< EMBEDDED_FILES * > m_embedTargets
std::vector< EMBEDDED_FILES * > m_filesStack