32#include <magic_enum.hpp> 
   33#include <wx/listctrl.h> 
  122                                                          const std::vector<TOOL_ACTION*>& aTools,
 
  123                                                          const std::vector<ACTION_TOOLBAR_CONTROL*>& aControls ) :
 
  131    for( 
auto& tool : aTools )
 
  134    for( 
auto& control : aControls )
 
 
  175    for( 
auto& tb : magic_enum::enum_values<TOOLBAR_LOC>() )
 
  180        if( tbConfig.has_value() )
 
  187    auto firstTb = magic_enum::enum_cast<TOOLBAR_LOC>( 0 );
 
  189    if( firstTb.has_value() )
 
 
  199    wxArrayString tbChoices;
 
  202    for( 
auto& tb : magic_enum::enum_values<TOOLBAR_LOC>() )
 
  207        if( tbConfig.has_value() )
 
  214                      wxString::Format( 
"Unknown toolbar: %s", magic_enum::enum_name( tb ) ) );
 
  216        tbChoices.Add( tbName->second );
 
  227    auto firstTb = magic_enum::enum_cast<TOOLBAR_LOC>( 0 );
 
  229    if( firstTb.has_value() )
 
 
  249    if( currentTb.has_value() )
 
 
  266    wxTreeItemIdValue mainCookie;
 
  273    while( mainId.IsOk() )
 
  275        wxTreeItemData* treeData = 
m_toolbarTree->GetItemData( mainId );
 
  279        wxCHECK2( tbData, 
continue );
 
  304                wxTreeItemIdValue childCookie;
 
  305                wxTreeItemId      childId = 
m_toolbarTree->GetFirstChild( mainId, childCookie );
 
  307                while( childId.IsOk() )
 
  309                    wxTreeItemData* childTreeData = 
m_toolbarTree->GetItemData( childId );
 
  313                    wxCHECK2( childTbData, 
break );
 
  315                    switch( childTbData->
GetType() )
 
  321                        wxASSERT_MSG( 
false, 
"Invalid entry in a group" );
 
  329                    childId = 
m_toolbarTree->GetNextChild( mainId, childCookie );
 
  333            config.AppendGroup( grpConfig );
 
 
  366        switch( item.m_Type )
 
  372            m_toolbarTree->AppendItem( root, 
"Separator", -1, -1, sepTreeItem );
 
  380            spacerTreeItem->
SetSize( item.m_Size );
 
  381            m_toolbarTree->AppendItem( root, wxString::Format( 
"Spacer: %i", item.m_Size ), -1, -1,
 
  390            controlTreeItem->
SetName( item.m_ControlName );
 
  391            m_toolbarTree->AppendItem( root, item.m_ControlName, -1, -1, controlTreeItem );
 
  402                wxASSERT_MSG( 
false, wxString::Format( 
"Unable to find tool %s", item.m_ActionName ) );
 
  407            toolTreeItem->
SetAction( toolMap->second );
 
  413                imgIdx = imgMap->second;
 
  415            m_toolbarTree->AppendItem( root, toolMap->second->GetFriendlyName(), imgIdx, -1, toolTreeItem );
 
  423            groupTreeItem->
SetName( item.m_GroupName );
 
  425            wxTreeItemId groupId = 
m_toolbarTree->AppendItem( root, item.m_GroupName, -1, -1,
 
  435                    wxASSERT_MSG( 
false, wxString::Format( 
"Unable to find group tool %s", groupItem.
m_ActionName ) );
 
  440                toolTreeItem->
SetAction( toolMap->second );
 
  446                    imgIdx = imgMap->second;
 
  448                m_toolbarTree->AppendItem( groupId, toolMap->second->GetFriendlyName(),
 
  449                                           imgIdx, -1, toolTreeItem );
 
  459    wxTreeItemIdValue temp;
 
  460    wxTreeItemId firstItem = 
m_toolbarTree->GetFirstChild( root, temp );
 
  462    if( firstItem.IsOk()  )
 
 
  480    m_actionsList->InsertColumn( 0, 
"", wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE );
 
  483    int logicSize = 24 * GetDPIScaleFactor() / GetContentScaleFactor(); 
 
  484    int physSize = ToPhys( logicSize ); 
 
  488    else if( physSize >= 48 )
 
  490    else if( physSize >= 32 )
 
  495    logicSize = std::min( logicSize, physSize );
 
  496    int bmpsf = std::max( 1, physSize / logicSize );
 
  498    logicSize = physSize / bmpsf;
 
  503                wxBitmap bmp = 
KiBitmap( aBmps, physSize );
 
  504                bmp.SetScaleFactor( bmpsf );
 
  505                wxASSERT(bmp.IsOk());
 
  521        item.SetText( tool->GetFriendlyName() );
 
  522        item.SetData( 
static_cast<void*
>( tool ) );
 
  523        item.SetId( itemIdx++ );
 
  536                item.SetImage( idx );
 
 
  555    wxTreeItemId newItem;
 
  561        wxTreeItemId parent = 
m_toolbarTree->GetItemParent( selItem );
 
  565            wxTreeItemId secondParent = 
m_toolbarTree->GetItemParent( parent );
 
  567            if( secondParent.IsOk() )
 
 
  595    wxString label = wxString::Format( 
"Spacer: %i", treeItem->
GetSize() );
 
  597    wxTreeItemId newItem;
 
  603        wxTreeItemId parent = 
m_toolbarTree->GetItemParent( selItem );
 
  608            wxTreeItemId secondParent = 
m_toolbarTree->GetItemParent( parent );
 
  610            if( secondParent.IsOk() )
 
  617        newItem = 
m_toolbarTree->InsertItem( parent, selItem, label, -1, -1, treeItem );
 
 
  634    wxTreeItemId newItem;
 
  640        wxTreeItemId parent = 
m_toolbarTree->GetItemParent( selItem );
 
  645            wxTreeItemId secondParent = 
m_toolbarTree->GetItemParent( parent );
 
  647            if( secondParent.IsOk() )
 
  654        newItem = 
m_toolbarTree->InsertItem( parent, selItem, 
"Separator", -1, -1, treeItem );
 
 
  713    if( !item.IsOk() && prev.IsOk() )
 
 
  736    long actionIdx = 
m_actionsList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
 
  754        imgIdx = imgMap->second;
 
  759    wxTreeItemId newItem;
 
  769            newItem = 
m_toolbarTree->AppendItem( selItem, label, imgIdx, -1, toolTreeItem );
 
  774            wxTreeItemId parent = 
m_toolbarTree->GetItemParent( selItem );
 
  775            newItem = 
m_toolbarTree->InsertItem( parent, selItem, label, imgIdx, -1, toolTreeItem );
 
  791        if( ++actionIdx < m_actionsList->GetItemCount() )
 
  792            m_actionsList->SetItemState( actionIdx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
 
 
  799    wxTreeItemId 
id = 
event.GetItem();
 
  807            switch( tbData->GetType() )
 
 
  837    if( currentTb.has_value() )
 
  841    auto newTb = magic_enum::enum_cast<TOOLBAR_LOC>( event.GetInt() );
 
  843    if( newTb.has_value() )
 
 
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.
 
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.