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.

75 lines
2.6 KiB

  1. /**
  2. * @file fp_conflict_assignment_selector.h
  3. */
  4. /*
  5. * This program source code file is part of KICAD, a free EDA CAD application.
  6. *
  7. * Copyright (C) 2010-2014 Jean-Pierre Charras <jp.charras at wanadoo.fr>
  8. * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version 2
  13. * of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, you may find one here:
  22. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  23. * or you may search the http://www.gnu.org website for the version 2 license,
  24. * or you may write to the Free Software Foundation, Inc.,
  25. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  26. */
  27. #include <fp_conflict_assignment_selector_base.h>
  28. class DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR : public DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE
  29. {
  30. public:
  31. DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR( wxWindow* parent );
  32. /**
  33. * Add a line to the selection list.
  34. *
  35. * @param aRef is the component reference text.
  36. * @param aFpSchName is the fpid text from the netlist.
  37. * @param aFpCmpName is the fpid text from the .cmp file.
  38. */
  39. void Add( const wxString& aRef, const wxString& aFpSchName, const wxString& aFpCmpName );
  40. /**
  41. * @param aReference is the component schematic reference.
  42. * @retval 0 for fpid text from the netlist.
  43. * @retval 1 for fpid text from the cmp file.
  44. * @retval -1 on error.
  45. */
  46. int GetSelection( const wxString& aReference );
  47. private:
  48. void OnSize( wxSizeEvent& event ) override;
  49. // Virtual: called when clicking on the column title:
  50. // when it is a column choice, set all item choices.
  51. void OnColumnClick( wxListEvent& event ) override;
  52. void OnItemClicked( wxMouseEvent& event ) override;
  53. void OnCancelClick( wxCommandEvent& event ) override { EndModal( wxID_CANCEL ); }
  54. void OnOKClick( wxCommandEvent& event ) override { EndModal( wxID_OK ); }
  55. void recalculateColumns();
  56. enum COL_ID
  57. {
  58. COL_REF, COL_FPSCH, COL_SELSCH, COL_SELCMP, COL_FPCMP,
  59. COL_COUNT
  60. };
  61. int m_lineCount;
  62. };