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 ) );
108 wxVector<wxBitmapBundle> stateImages;
109 stateImages.push_back( wxBitmapBundle() );
110 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_good_check ) );
114 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_out_of_date ) );
115 stateImages.push_back(
KiBitmapBundle( BITMAPS::git_changed_ahead ) );
118 SetStateImages( stateImages );
123 int logicSize = 24 * GetDPIScaleFactor() / GetContentScaleFactor();
124 int physSize = ToPhys( logicSize );
128 else if( physSize >= 48 )
130 else if( physSize >= 32 )
135 logicSize = std::min( logicSize, physSize );
136 int bmpsf = std::max( 1, physSize / logicSize );
138 logicSize = physSize / bmpsf;
140 auto toBitmap = [&](
BITMAPS aBmps )
142 wxBitmap bmp =
KiBitmap( aBmps, physSize );
143 bmp.SetScaleFactor( bmpsf );
144 wxASSERT(bmp.IsOk());
148 m_imageList =
new wxImageList( logicSize, logicSize,
true,
149 static_cast<int>( TREE_FILE_TYPE::MAX ) );
152 m_imageList->Add( toBitmap( BITMAPS::project_kicad ) );
153 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
154 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
155 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
156 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
157 m_imageList->Add( toBitmap( BITMAPS::icon_gerbview_24 ) );
158 m_imageList->Add( toBitmap( BITMAPS::file_gerber_job ) );
159 m_imageList->Add( toBitmap( BITMAPS::file_html ) );
166 m_imageList->Add( toBitmap( BITMAPS::directory ) );
167 m_imageList->Add( toBitmap( BITMAPS::icon_cvpcb_24 ) );
174 m_imageList->Add( toBitmap( BITMAPS::icon_pagelayout_editor_24 ) );
187 wxBitmap blank_bitmap( size, size );
213 if( !myitem1 || !myitem2 )
216 if( myitem1->
GetType() == TREE_FILE_TYPE::DIRECTORY
217 && myitem2->
GetType() != TREE_FILE_TYPE::DIRECTORY )
220 if( myitem2->
GetType() == TREE_FILE_TYPE::DIRECTORY
221 && 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)