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.

114 lines
4.3 KiB

  1. /*
  2. * This program source code file is part of KICAD, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2013 Kicad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  19. * or you may search the http://www.gnu.org website for the version 2 license,
  20. * or you may write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  22. */
  23. #ifndef _DIALOG_PAGES_SETTINGS_H_
  24. #define _DIALOG_PAGES_SETTINGS_H_
  25. #include <dialog_page_settings_base.h>
  26. #define MAX_PAGE_EXAMPLE_SIZE 200
  27. /*!
  28. * DIALOG_PAGES_SETTINGS class declaration
  29. */
  30. class DIALOG_PAGES_SETTINGS: public DIALOG_PAGES_SETTINGS_BASE
  31. {
  32. private:
  33. EDA_DRAW_FRAME* m_Parent;
  34. BASE_SCREEN* m_Screen;
  35. wxArrayString m_pageFmt; /// list of page sizes (not translated)
  36. bool m_initialized;
  37. bool m_modified;
  38. bool m_save_flag;
  39. wxBitmap* m_page_bitmap; /// Temporary bitmap for the page layout example.
  40. wxSize m_layout_size; /// Logical page layout size.
  41. PAGE_INFO m_pageInfo; /// Temporary page info.
  42. bool m_customFmt; /// true if the page selection is custom
  43. TITLE_BLOCK m_tb; /// Temporary title block (basic inscriptions).
  44. public:
  45. DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent );
  46. ~DIALOG_PAGES_SETTINGS();
  47. private:
  48. /// Initialises member variables
  49. void initDialog();
  50. /// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG
  51. void OnCloseWindow( wxCloseEvent& event );
  52. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
  53. void OnOkClick( wxCommandEvent& event );
  54. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
  55. void OnCancelClick( wxCommandEvent& event );
  56. /// exEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHICE_PAGE_SIZE
  57. void OnPaperSizeChoice( wxCommandEvent& event );
  58. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_USER_PAGE_SIZE_X
  59. void OnUserPageSizeXTextUpdated( wxCommandEvent& event );
  60. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_USER_PAGE_SIZE_Y
  61. void OnUserPageSizeYTextUpdated( wxCommandEvent& event );
  62. /// exEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE_PAGE_ORIENTATION
  63. void OnPageOrientationChoice( wxCommandEvent& event );
  64. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_REVISION
  65. void OnRevisionTextUpdated( wxCommandEvent& event );
  66. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_TITLE
  67. void OnTitleTextUpdated( wxCommandEvent& event );
  68. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMPANY
  69. void OnCompanyTextUpdated( wxCommandEvent& event );
  70. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT1
  71. void OnComment1TextUpdated( wxCommandEvent& event );
  72. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT2
  73. void OnComment2TextUpdated( wxCommandEvent& event );
  74. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT3
  75. void OnComment3TextUpdated( wxCommandEvent& event );
  76. /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT4
  77. void OnComment4TextUpdated( wxCommandEvent& event );
  78. void SetCurrentPageSizeSelection( const wxString& aPaperSize );
  79. void SavePageSettings( wxCommandEvent& event );
  80. /// Update page layout example
  81. void UpdatePageLayoutExample();
  82. /// Get page layout info from selected dialog items
  83. void GetPageLayoutInfoFromDialog();
  84. /// Get custom page size in mils from dialog
  85. void GetCustomSizeMilsFromDialog();
  86. };
  87. #endif // _DIALOG_PAGES_SETTINGS_H_