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.

88 lines
2.7 KiB

  1. #ifndef __LIBVIEWFRM_H__
  2. #define __LIBVIEWFRM_H__
  3. class WinEDAChoiceBox;
  4. class SCH_SCREEN;
  5. class CMP_LIBRARY;
  6. /**
  7. * Component library viewer main window.
  8. */
  9. class WinEDA_ViewlibFrame : public WinEDA_DrawFrame
  10. {
  11. private:
  12. WinEDAChoiceBox* SelpartBox;
  13. // List of libraries (for selection )
  14. wxSashLayoutWindow* m_LibListWindow;
  15. wxListBox* m_LibList; // The list of libs
  16. wxSize m_LibListSize; // size of the window
  17. // List of components in the selected library
  18. wxSashLayoutWindow* m_CmpListWindow;
  19. wxListBox* m_CmpList; // The list of components
  20. wxSize m_CmpListSize; // size of the window
  21. // Flags
  22. wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog
  23. wxString m_ConfigPath; // subpath for configuration
  24. protected:
  25. static wxString m_libraryName;
  26. static wxString m_entryName;
  27. static int m_unit;
  28. static int m_convert;
  29. static wxSize m_clientSize;
  30. public:
  31. WinEDA_ViewlibFrame( wxWindow* father,
  32. CMP_LIBRARY* Library = NULL,
  33. wxSemaphore* semaphore = NULL );
  34. ~WinEDA_ViewlibFrame();
  35. void OnSize( wxSizeEvent& event );
  36. void OnSashDrag( wxSashEvent& event );
  37. void ReCreateListLib();
  38. void ReCreateListCmp();
  39. void Process_Special_Functions( wxCommandEvent& event );
  40. void DisplayLibInfos();
  41. void RedrawActiveWindow( wxDC* DC, bool EraseBg );
  42. void OnCloseWindow( wxCloseEvent& Event );
  43. void ReCreateHToolbar();
  44. void ReCreateVToolbar();
  45. void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
  46. int BestZoom();
  47. void ClickOnLibList( wxCommandEvent& event );
  48. void ClickOnCmpList( wxCommandEvent& event );
  49. void OnSetRelativeOffset( wxCommandEvent& event );
  50. SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
  51. void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
  52. void LoadSettings();
  53. void SaveSettings();
  54. wxString& GetEntryName( void ) const { return m_entryName; }
  55. int GetUnit( void ) { return m_unit; }
  56. int GetConvert( void ) { return m_convert; }
  57. private:
  58. /** OnActivate event funtion( virtual )
  59. */
  60. virtual void OnActivate( wxActivateEvent& event );
  61. void SelectCurrentLibrary();
  62. void SelectAndViewLibraryPart( int option );
  63. void ExportToSchematicLibraryPart( wxCommandEvent& event );
  64. void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag );
  65. bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
  66. DECLARE_EVENT_TABLE()
  67. };
  68. #endif /* __LIBVIEWFRM_H__ */