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.

66 lines
1.7 KiB

  1. /*********************************************************************/
  2. /** setvisu.cpp: initialisations de l'ecran d'affichage du composant **/
  3. /*********************************************************************/
  4. #include "fctsys.h"
  5. #include "wxstruct.h"
  6. #include "common.h"
  7. #include "cvpcb.h"
  8. #include "3d_viewer.h"
  9. #include "id.h"
  10. #include "bitmaps.h"
  11. #include "protos.h"
  12. /*******************************************/
  13. void WinEDA_CvpcbFrame::CreateScreenCmp(void)
  14. /*******************************************/
  15. /* Creation de la fenetre d'affichage du composant
  16. */
  17. {
  18. wxString msg, FootprintName;
  19. bool IsNew = FALSE;
  20. FootprintName = m_FootprintList->GetSelectedFootprint();
  21. if ( DrawFrame == NULL)
  22. {
  23. DrawFrame = new WinEDA_DisplayFrame(this, m_Parent, _("Module"),
  24. wxPoint(0,0) , wxSize(600,400) );
  25. IsNew = TRUE;
  26. }
  27. else DrawFrame->Maximize(FALSE);
  28. DrawFrame->SetFocus(); /* Active entree clavier */
  29. DrawFrame->Show(TRUE);
  30. if( ! FootprintName.IsEmpty() )
  31. {
  32. msg = _("Footprint: ") + FootprintName;
  33. DrawFrame->SetTitle(msg);
  34. STOREMOD * Module = GetModuleDescrByName(FootprintName);
  35. msg = _("Lib: ");
  36. if ( Module ) msg += Module->m_LibName;
  37. else msg += wxT("???");
  38. DrawFrame->SetStatusText(msg, 0);
  39. if ( DrawFrame->m_Pcb->m_Modules )
  40. {
  41. DeleteStructure( DrawFrame->m_Pcb->m_Modules );
  42. DrawFrame->m_Pcb->m_Modules = NULL;
  43. }
  44. DrawFrame->m_Pcb->m_Modules = DrawFrame->Get_Module(FootprintName);
  45. DrawFrame->Zoom_Automatique(FALSE);
  46. if ( DrawFrame->m_Draw3DFrame )
  47. DrawFrame->m_Draw3DFrame->NewDisplay();
  48. }
  49. else if ( !IsNew )
  50. {
  51. DrawFrame->ReDrawPanel();
  52. if ( DrawFrame->m_Draw3DFrame )
  53. DrawFrame->m_Draw3DFrame->NewDisplay();
  54. }
  55. }