You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.6 KiB

  1. /********************/
  2. /* tool_cvpcb.cpp */
  3. /********************/
  4. #include "fctsys.h"
  5. #include "appl_wxstruct.h"
  6. #include "common.h"
  7. #include "trigo.h"
  8. #include "bitmaps.h"
  9. #include "cvpcb.h"
  10. #include "protos.h"
  11. #include "cvstruct.h"
  12. void WinEDA_CvpcbFrame::ReCreateHToolbar()
  13. {
  14. wxConfig* config = wxGetApp().m_EDA_Config;
  15. if( m_HToolBar != NULL )
  16. return;
  17. m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
  18. m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
  19. wxBitmap( open_xpm ),
  20. _( "Open a net list file" ) );
  21. m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString,
  22. wxBitmap( save_xpm ),
  23. _( "Save net list and footprint files" ) );
  24. m_HToolBar->AddSeparator();
  25. m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
  26. wxBitmap( config_xpm ),
  27. _( "Configuration" ) );
  28. m_HToolBar->AddSeparator();
  29. m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
  30. wxBitmap( module_xpm ),
  31. _( "View selected footprint" ) );
  32. m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
  33. wxBitmap( auto_associe_xpm ),
  34. _( "Perform automatic footprint association" ) );
  35. m_HToolBar->AddSeparator();
  36. m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
  37. wxBitmap( left_xpm ),
  38. _( "Select previous free component" ) );
  39. m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
  40. wxBitmap( right_xpm ),
  41. _( "Select next free component" ) );
  42. m_HToolBar->AddSeparator();
  43. m_HToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
  44. wxBitmap( delete_association_xpm ),
  45. _( "Delete all associations" ) );
  46. m_HToolBar->AddSeparator();
  47. m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
  48. wxBitmap( save_cmpstuff_xpm ),
  49. _( "Create export file (component/footprint list, \
  50. used by eeschema to fill the footprint field of components)" ) );
  51. m_HToolBar->AddSeparator();
  52. m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
  53. wxBitmap( datasheet_xpm ),
  54. _( "Display footprints list documentation" ) );
  55. m_HToolBar->AddSeparator();
  56. m_HToolBar->AddSeparator();
  57. m_HToolBar->AddRadioTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
  58. wxEmptyString,
  59. wxBitmap( module_filtered_list_xpm ),
  60. wxNullBitmap,
  61. _( "Display the filtered footprint list for the current component" ) );
  62. m_HToolBar->AddRadioTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
  63. wxEmptyString, wxBitmap( module_full_list_xpm ),
  64. wxNullBitmap,
  65. _( "Display the full footprint list (without filtering)" ) );
  66. if( config )
  67. {
  68. wxString key = wxT( FILTERFOOTPRINTKEY );
  69. int opt = config->Read( key, (long) 1 );
  70. m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt );
  71. m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, !opt );
  72. }
  73. // after adding the buttons to the toolbar, must call Realize() to reflect
  74. // the changes
  75. m_HToolBar->Realize();
  76. }