48 wxTreeCtrl* parent ) :
62 wxImageList* imglist =
m_parent->GetImageList();
65 if( !imglist || state < 0 || state >= imglist->GetImageCount() / ( treeEnumMax - 2 ) )
69 int imgid =
static_cast<int>(
m_type ) - 1 + state * ( treeEnumMax - 1 );
70 m_parent->SetItemImage( GetId(), imgid );
71 m_parent->SetItemImage( GetId(), imgid, wxTreeItemIcon_Selected );
113 const wxString sep = wxFileName().GetPathSeparator();
118 newFile = dirs + sep +
name;
126 wxRegEx reg( wxT(
"^.*\\" ) + ext + wxT(
"$" ), wxRE_ICASE );
128 if( check && !ext.IsEmpty() && !reg.Matches( newFile ) )
130 wxMessageDialog dialog(
m_parent,
_(
"Changing file extension will change file type.\n"
131 "Do you want to continue ?" ),
132 _(
"Rename File" ), wxYES_NO | wxICON_QUESTION );
134 if( wxID_YES != dialog.ShowModal() )
138 if( !wxRenameFile(
GetFileName(), newFile,
false ) )
140 wxMessageDialog(
m_parent,
_(
"Unable to rename file ... " ),
_(
"Permission error?" ),
141 wxICON_ERROR | wxOK );
177 wxTreeItemId
id = GetId();
227 wxLaunchDefaultBrowser( fullFileName );
247 packet = fullFileName.ToStdString();
254 packet = fullFileName.ToStdString();
static TOOL_ACTION editPCB
static TOOL_ACTION editOtherPCB
static TOOL_ACTION editOtherSch
static TOOL_ACTION editSchematic
static TOOL_ACTION openTextEditor
static TOOL_ACTION editDrawingSheet
static TOOL_ACTION editFootprints
static TOOL_ACTION viewGerbers
static TOOL_ACTION editSymbols
The main KiCad project manager frame.
const wxString SchLegacyFileName()
const wxString SchFileName()
void LoadProject(const wxFileName &aProjectFileName)
const wxString PcbLegacyFileName()
const wxString PcbFileName()
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
bool CanDelete() const
Determine if a file can be deleted via the project tree pane.
void SetRootFile(bool aValue)
bool Rename(const wxString &name, bool check=true)
const wxString & GetFileName() const
void SetType(TREE_FILE_TYPE aType)
void SetPopulated(bool aValue)
TREE_FILE_TYPE GetType() const
void SetFileName(const wxString &name)
const wxString GetDir() const
void Activate(PROJECT_TREE_PANE *aTreePrjFrame)
PROJECT_TREE_PANE Window to display the tree files.
PROJECT_TREE * m_TreeProject
KICAD_MANAGER_FRAME * m_Parent
static wxString GetFileExt(TREE_FILE_TYPE type)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
@ FRAME_SCH_SYMBOL_EDITOR
bool OpenPDF(const wxString &file)
Run the PDF viewer and display a PDF file.
void OpenFile(const wxString &file)
IDs used in KiCad main frame foe menuitems and tools.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.