28#include <wx/settings.h>
40#define PLATFORM_STYLE wxTR_LINES_AT_ROOT
42#define PLATFORM_STYLE wxTR_NO_LINES
47 PLATFORM_STYLE | wxTR_HAS_BUTTONS | wxTR_MULTIPLE, wxDefaultValidator,
48 wxT(
"EDATreeCtrl" ) ),
49 m_imageList( nullptr ),
50 m_statusImageList( nullptr )
53 m_gitCommon = std::make_unique<KIGIT_COMMON>(
nullptr );
75 wxVector<wxBitmapBundle> images;
99 images.push_back(
KiBitmapBundle( BITMAPS::icon_pagelayout_editor_24 ) );
107 wxVector<wxBitmapBundle> stateImages;
108 stateImages.push_back( wxBitmapBundle() );
109 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_good_check ) );
113 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_out_of_date ) );
114 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_changed_ahead ) );
117 SetStateImages( stateImages );
122 int logicSize = 24 * GetDPIScaleFactor() / GetContentScaleFactor();
123 int physSize = ToPhys( logicSize );
127 else if( physSize >= 48 )
129 else if( physSize >= 32 )
134 logicSize = std::min( logicSize, physSize );
135 int bmpsf = std::max( 1, physSize / logicSize );
137 logicSize = physSize / bmpsf;
139 auto toBitmap = [&](
BITMAPS aBmps )
141 wxBitmap bmp =
KiBitmap( aBmps, physSize );
142 bmp.SetScaleFactor( bmpsf );
143 wxASSERT(bmp.IsOk());
147 m_imageList =
new wxImageList( logicSize, logicSize,
true,
148 static_cast<int>( TREE_FILE_TYPE::MAX ) );
151 m_imageList->Add( toBitmap( BITMAPS::project_kicad ) );
152 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
153 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
154 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
155 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
156 m_imageList->Add( toBitmap( BITMAPS::icon_gerbview_24 ) );
157 m_imageList->Add( toBitmap( BITMAPS::file_gerber_job ) );
158 m_imageList->Add( toBitmap( BITMAPS::file_html ) );
165 m_imageList->Add( toBitmap( BITMAPS::directory ) );
166 m_imageList->Add( toBitmap( BITMAPS::icon_cvpcb_24 ) );
173 m_imageList->Add( toBitmap( BITMAPS::icon_pagelayout_editor_24 ) );
185 wxBitmap blank_bitmap( size, size );
211 if( !myitem1 || !myitem2 )
214 if( myitem1->
GetType() == TREE_FILE_TYPE::DIRECTORY
215 && myitem2->
GetType() != TREE_FILE_TYPE::DIRECTORY )
218 if( myitem2->
GetType() == TREE_FILE_TYPE::DIRECTORY
219 && myitem1->
GetType() != TREE_FILE_TYPE::DIRECTORY )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
BITMAPS
A list of all bitmap identifiers.
Handle one item (a file or a directory name) for the tree file.
const wxString & GetFileName() const
TREE_FILE_TYPE GetType() const
PROJECT_TREE_PANE Window to display the tree files.
PROJECT_TREE This is the class to show (as a tree) the files in the project directory.
PROJECT_TREE_PANE * m_projectTreePane
int OnCompareItems(const wxTreeItemId &item1, const wxTreeItemId &item2) override
wxImageList * m_statusImageList
PROJECT_TREE(PROJECT_TREE_PANE *parent)
std::unique_ptr< KIGIT_COMMON > m_gitCommon
wxImageList * m_imageList
IDs used in KiCad main frame foe menuitems and tools.
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)