Browse Source
carve out TITLE_BLOCK class from BASE_SCREEN, add hashtables.h for PROPERTIES
pull/1/head
carve out TITLE_BLOCK class from BASE_SCREEN, add hashtables.h for PROPERTIES
pull/1/head
24 changed files with 400 additions and 218 deletions
-
18common/common_plot_functions.cpp
-
70common/dialogs/dialog_page_settings.cpp
-
3common/dialogs/dialog_page_settings.h
-
17common/worksheet.cpp
-
19eeschema/files-io.cpp
-
20eeschema/load_one_schematic_file.cpp
-
34eeschema/sch_screen.cpp
-
12eeschema/schframe.cpp
-
28include/class_base_screen.h
-
9include/class_sch_screen.h
-
95include/class_title_block.h
-
35include/hashtables.h
-
6include/richio.h
-
3include/wxBasePcbFrame.h
-
4include/wxstruct.h
-
20pcbnew/basepcbframe.cpp
-
7pcbnew/class_board.h
-
15pcbnew/export_gencad.cpp
-
11pcbnew/files.cpp
-
7pcbnew/io_mgr.h
-
46pcbnew/ioascii.cpp
-
50pcbnew/kicad_plugin.cpp
-
26pcbnew/pcb_plot_params.cpp
-
63pcbnew/pcb_plot_params.h
@ -0,0 +1,95 @@ |
|||
#ifndef TITLE_BLOCK_H_ |
|||
#define TITLE_BLOCK_H_ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <wx/string.h> |
|||
|
|||
|
|||
extern wxString GenDate(); |
|||
|
|||
|
|||
/** |
|||
* Class TITLE_BLOCK |
|||
* holds the information shown in the lower right corner of a plot, printout, or |
|||
* editing view. |
|||
* |
|||
* @author Dick Hollenbeck |
|||
*/ |
|||
class TITLE_BLOCK |
|||
{ |
|||
public: |
|||
// TITLE_BLOCK(); |
|||
|
|||
void SetTitle( const wxString& aTitle ) { m_title = aTitle; } |
|||
const wxString& GetTitle() const { return m_title; } |
|||
|
|||
/** |
|||
* Function SetDate |
|||
* sets the date field, and defaults to the current time and date. |
|||
*/ |
|||
void SetDate( const wxString& aDate = GenDate() ) { m_date = aDate; } |
|||
const wxString& GetDate() const { return m_date; } |
|||
|
|||
void SetRevision( const wxString& aRevision ) { m_revision = aRevision; } |
|||
const wxString& GetRevision() const { return m_revision; } |
|||
|
|||
void SetCompany( const wxString& aCompany ) { m_company = aCompany; } |
|||
const wxString& GetCompany() const { return m_company; } |
|||
|
|||
void SetComment1( const wxString& aComment ) { m_comment1 = aComment; } |
|||
const wxString& GetComment1() const { return m_comment1; } |
|||
|
|||
void SetComment2( const wxString& aComment ) { m_comment2 = aComment; } |
|||
const wxString& GetComment2() const { return m_comment2; } |
|||
|
|||
void SetComment3( const wxString& aComment ) { m_comment3 = aComment; } |
|||
const wxString& GetComment3() const { return m_comment3; } |
|||
|
|||
void SetComment4( const wxString& aComment ) { m_comment4 = aComment; } |
|||
const wxString& GetComment4() const { return m_comment4; } |
|||
|
|||
void Clear() |
|||
{ |
|||
m_title.clear(); |
|||
m_date.clear(); |
|||
m_revision.clear(); |
|||
m_company.clear(); |
|||
m_comment1.clear(); |
|||
m_comment2.clear(); |
|||
m_comment3.clear(); |
|||
m_comment4.clear(); |
|||
} |
|||
|
|||
private: |
|||
wxString m_title; |
|||
wxString m_date; |
|||
wxString m_revision; |
|||
wxString m_company; |
|||
wxString m_comment1; |
|||
wxString m_comment2; |
|||
wxString m_comment3; |
|||
wxString m_comment4; |
|||
}; |
|||
|
|||
#endif // TITLE_BLOCK_H_ |
@ -0,0 +1,35 @@ |
|||
#ifndef HASHTABLES_H_ |
|||
#define HASHTABLES_H_ |
|||
|
|||
// Declare some hashtables using a MACRO techique from here: |
|||
// http://docs.wxwidgets.org/trunk/classwx_hash_map.html |
|||
// This simplifies finding the correct hashtable header file. |
|||
// Ideally, std::unordered_map is what we are trying to use here, |
|||
// but its header file has been a moving target for some time. |
|||
// Let wx figure it out. |
|||
#include <wx/hashmap.h> |
|||
|
|||
/** |
|||
* Class PROPERTIES |
|||
* is an associative array consisting of a key and value tuple. |
|||
*/ |
|||
#if 1 |
|||
// key: const char* |
|||
// value: wxString |
|||
WX_DECLARE_HASH_MAP( char*, wxString, wxStringHash, wxStringEqual, PROPERTIES ); |
|||
#else |
|||
// key: wxString |
|||
// value: wxString |
|||
WX_DECLARE_STRING_HASH_MAP( wxString, PROPERTIES ); |
|||
#endif |
|||
|
|||
|
|||
/** |
|||
* Class KEYWORD_MAP |
|||
* is a hashtable consisting of a key and a value tuple. |
|||
* Key is a C string and value is an integer. |
|||
*/ |
|||
//WX_DECLARE_HASH_MAP( char*, int, wxStringHash, wxStringEqual, KEYWORD_MAP ); |
|||
|
|||
|
|||
#endif // HASHTABLES_H_ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue