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( wxBitmap( 16, 16 ) ) );
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 ) );
117 stateImages.push_back( wxBitmapBundle( wxBitmap( 16, 16 ) ) );
119 SetStateImages( stateImages );
124 int logicSize = 24 * GetDPIScaleFactor() / GetContentScaleFactor();
125 int physSize = ToPhys( logicSize );
129 else if( physSize >= 48 )
131 else if( physSize >= 32 )
136 logicSize = std::min( logicSize, physSize );
137 int bmpsf = std::max( 1, physSize / logicSize );
139 logicSize = physSize / bmpsf;
141 auto toBitmap = [&](
BITMAPS aBmps )
143 wxBitmap bmp =
KiBitmap( aBmps, physSize );
144 bmp.SetScaleFactor( bmpsf );
145 wxASSERT(bmp.IsOk());
149 m_imageList =
new wxImageList( logicSize, logicSize,
true,
150 static_cast<int>( TREE_FILE_TYPE::MAX ) );
153 m_imageList->Add( toBitmap( BITMAPS::project_kicad ) );
154 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
155 m_imageList->Add( toBitmap( BITMAPS::icon_eeschema_24 ) );
156 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
157 m_imageList->Add( toBitmap( BITMAPS::icon_pcbnew_24 ) );
158 m_imageList->Add( toBitmap( BITMAPS::icon_gerbview_24 ) );
159 m_imageList->Add( toBitmap( BITMAPS::file_gerber_job ) );
160 m_imageList->Add( toBitmap( BITMAPS::file_html ) );
167 m_imageList->Add( toBitmap( BITMAPS::directory ) );
168 m_imageList->Add( toBitmap( BITMAPS::icon_cvpcb_24 ) );
175 m_imageList->Add( toBitmap( BITMAPS::icon_pagelayout_editor_24 ) );
188 wxBitmap blank_bitmap( size, size );
215 if( !myitem1 || !myitem2 )
218 if( myitem1->
GetType() == TREE_FILE_TYPE::DIRECTORY
219 && myitem2->
GetType() != TREE_FILE_TYPE::DIRECTORY )
222 if( myitem2->
GetType() == TREE_FILE_TYPE::DIRECTORY
223 && myitem1->
GetType() != TREE_FILE_TYPE::DIRECTORY )
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
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)