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.

57 lines
1.5 KiB

  1. /**
  2. * This file is part of the common libary.
  3. * @file dialog_get_component.h
  4. */
  5. #ifndef __INCLUDE_DIALOG_GET_COMPONENT_H__
  6. #define __INCLUDE_DIALOG_GET_COMPONENT_H__
  7. #include <../common/dialogs/dialog_get_component_base.h>
  8. void AddHistoryComponentName( wxArrayString& HistoryList,
  9. const wxString& Name );
  10. /* Dialog frame to choose a component name */
  11. class DIALOG_GET_COMPONENT : public DIALOG_GET_COMPONENT_BASE
  12. {
  13. private:
  14. bool m_auxToolSelector;
  15. wxString m_Text;
  16. bool m_selectionIsKeyword;
  17. public:
  18. bool m_GetExtraFunction;
  19. public:
  20. // Constructor and destructor
  21. DIALOG_GET_COMPONENT( EDA_DRAW_FRAME* parent,
  22. wxArrayString& HistoryList, const wxString& Title,
  23. bool show_extra_tool );
  24. ~DIALOG_GET_COMPONENT() {};
  25. /**
  26. * Function GetComponentName
  27. * @return the selection (name or keyword)
  28. */
  29. wxString GetComponentName( void );
  30. /**
  31. * Function IsKeyword
  32. * @return true if the returned string is a keyword
  33. */
  34. bool IsKeyword( void )
  35. {
  36. return m_selectionIsKeyword;
  37. }
  38. void SetComponentName( const wxString& name );
  39. private:
  40. void initDialog( wxArrayString& aHistoryList );
  41. void OnCancel( wxCommandEvent& event );
  42. void Accept( wxCommandEvent& event );
  43. void GetExtraSelection( wxCommandEvent& event );
  44. };
  45. #endif /* __INCLUDE_DIALOG_GET_COMPONENT_H__ */