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.

82 lines
2.6 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
  5. * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  6. * Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
  7. * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #include <base_screen.h>
  27. #include <base_struct.h>
  28. #include <fctsys.h>
  29. #include <trace_helpers.h>
  30. wxString BASE_SCREEN::m_PageLayoutDescrFileName; // the name of the page layout descr file.
  31. BASE_SCREEN::BASE_SCREEN( EDA_ITEM* aParent, KICAD_T aType ) :
  32. EDA_ITEM( aParent, aType )
  33. {
  34. m_Initialized = false;
  35. m_ScreenNumber = 1;
  36. m_NumberOfScreens = 1; // Hierarchy: Root: ScreenNumber = 1
  37. m_Center = true;
  38. m_FlagModified = false; // Set when any change is made on board.
  39. m_FlagSave = false; // Used in auto save set when an auto save is required.
  40. }
  41. void BASE_SCREEN::InitDataPoints( const wxSize& aPageSizeIU )
  42. {
  43. if( m_Center )
  44. {
  45. m_crossHairPosition.x = 0;
  46. m_crossHairPosition.y = 0;
  47. m_DrawOrg.x = -aPageSizeIU.x / 2;
  48. m_DrawOrg.y = -aPageSizeIU.y / 2;
  49. }
  50. else
  51. {
  52. m_crossHairPosition.x = aPageSizeIU.x / 2;
  53. m_crossHairPosition.y = aPageSizeIU.y / 2;
  54. m_DrawOrg.x = 0;
  55. m_DrawOrg.y = 0;
  56. }
  57. m_LocalOrigin = { 0, 0 };
  58. }
  59. #if defined(DEBUG)
  60. void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
  61. {
  62. // for now, make it look like XML, expand on this later.
  63. NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
  64. NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
  65. }
  66. #endif