Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
336d1b23
Commit
336d1b23
authored
Aug 13, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fix Bug #1211468
Pl_Editor: fix copyright in files. Enhancement when creating new items.
parent
31461a9b
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
372 additions
and
131 deletions
+372
-131
class_worksheet_dataitem.h
include/class_worksheet_dataitem.h
+8
-6
class_pl_editor_layout.cpp
pagelayout_editor/class_pl_editor_layout.cpp
+24
-1
class_pl_editor_layout.h
pagelayout_editor/class_pl_editor_layout.h
+23
-0
class_pl_editor_screen.cpp
pagelayout_editor/class_pl_editor_screen.cpp
+23
-0
class_pl_editor_screen.h
pagelayout_editor/class_pl_editor_screen.h
+25
-1
controle.cpp
pagelayout_editor/controle.cpp
+6
-6
design_tree_frame.cpp
pagelayout_editor/design_tree_frame.cpp
+6
-6
design_tree_frame.h
pagelayout_editor/design_tree_frame.h
+2
-2
dialog_new_dataitem.cpp
pagelayout_editor/dialogs/dialog_new_dataitem.cpp
+7
-7
dialogs_for_printing.cpp
pagelayout_editor/dialogs/dialogs_for_printing.cpp
+5
-2
events_functions.cpp
pagelayout_editor/events_functions.cpp
+99
-25
files.cpp
pagelayout_editor/files.cpp
+5
-5
hotkeys.cpp
pagelayout_editor/hotkeys.cpp
+3
-3
hotkeys.h
pagelayout_editor/hotkeys.h
+24
-0
invoke_pl_editor_dialog.h
pagelayout_editor/invoke_pl_editor_dialog.h
+3
-1
menubar.cpp
pagelayout_editor/menubar.cpp
+7
-6
onleftclick.cpp
pagelayout_editor/onleftclick.cpp
+0
-1
onrightclick.cpp
pagelayout_editor/onrightclick.cpp
+14
-10
page_layout_writer.cpp
pagelayout_editor/page_layout_writer.cpp
+2
-3
pl_editor.cpp
pagelayout_editor/pl_editor.cpp
+2
-2
pl_editor_config.cpp
pagelayout_editor/pl_editor_config.cpp
+7
-7
pl_editor_frame.cpp
pagelayout_editor/pl_editor_frame.cpp
+6
-6
pl_editor_frame.h
pagelayout_editor/pl_editor_frame.h
+5
-6
pl_editor_id.h
pagelayout_editor/pl_editor_id.h
+31
-3
pl_editor_undo_redo.cpp
pagelayout_editor/pl_editor_undo_redo.cpp
+3
-3
properties_frame.cpp
pagelayout_editor/properties_frame.cpp
+6
-6
properties_frame.h
pagelayout_editor/properties_frame.h
+6
-6
toolbars_pl_editor.cpp
pagelayout_editor/toolbars_pl_editor.cpp
+8
-6
dialog_copper_zones.cpp
pcbnew/dialogs/dialog_copper_zones.cpp
+12
-1
No files found.
include/class_worksheet_dataitem.h
View file @
336d1b23
...
...
@@ -19,15 +19,17 @@ class WS_DRAW_ITEM_TEXT; // Forward declaration
#define USE_ITALIC (1<<1) // has meaning for texts
#define USE_ALT_COLOR (1<<2)
#define SELECTED_STATE (1<<3) // When set, use the hight light color to draw item
#define LOCATE_STARTPOINT (1<<4) // Used in locate function:set by locate function
#define NEW_ITEM (1<<4) // Set for new items which can be deleted
// by an abort command
#define LOCATE_STARTPOINT (1<<5) // Used in locate function:set by locate function
// if the start point is located
#define LOCATE_ENDPOINT (1<<
5
) // Used in locate function:set by locate function
#define LOCATE_ENDPOINT (1<<
6
) // Used in locate function:set by locate function
// if the end point is located
#define PAGE1OPTION (3<<
6
) // flag to manage items drawn or not drawn only
#define PAGE1OPTION (3<<
7
) // flag to manage items drawn or not drawn only
// on page 1: NONE = item on all pages
#define PAGE1OPTION_NONE (0<<
6
) // NONE = item on all pages
#define PAGE1OPTION_PAGE1ONLY (1<<
6
) // = item only on page 1
#define PAGE1OPTION_NOTONPAGE1 (2<<
6
) // = item on all pages but page 1
#define PAGE1OPTION_NONE (0<<
7
) // NONE = item on all pages
#define PAGE1OPTION_PAGE1ONLY (1<<
7
) // = item only on page 1
#define PAGE1OPTION_NOTONPAGE1 (2<<
7
) // = item on all pages but page 1
// A coordinate is relative to a page corner.
// Any of the 4 corners can be a reference.
...
...
pagelayout_editor/class_pl_editor_layout.cpp
View file @
336d1b23
/**
* @file class_
gb
r_layout.cpp
* @file class_
pl_edito
r_layout.cpp
* @brief PL_EDITOR_LAYOUT class functions.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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 <limits.h>
#include <algorithm>
...
...
pagelayout_editor/class_pl_editor_layout.h
View file @
336d1b23
/**
* @file class_pl_editor_layout.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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
*/
#ifndef CLASS_PL_EDITOR_LAYOUT_H
#define CLASS_PL_EDITOR_LAYOUT_H
...
...
pagelayout_editor/class_pl_editor_screen.cpp
View file @
336d1b23
/**
* @file class_pl_editor_screen.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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 <fctsys.h>
#include <common.h>
...
...
pagelayout_editor/class_pl_editor_screen.h
View file @
336d1b23
/**
* @file class_pl_editor_layout.h
* @file class_pl_editor_screen.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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
*/
#ifndef CLASS_PL_EDITOR_SCREEN_H_
...
...
pagelayout_editor/controle.cpp
View file @
336d1b23
/**
* @file pagelayout_editor/controle.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
-2013 Jean-Pierre Charras jp.charras at wanadoo.fr
*
Copyright (C) 2013-2013 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pagelayout_editor/controle.cpp
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
...
...
pagelayout_editor/design_tree_frame.cpp
View file @
336d1b23
/**
* @file design_tree_frame.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file design_tree_frame.cpp
*/
#include <wx/imaglist.h>
#include <wx/wupdlock.h>
#include <fctsys.h>
...
...
pagelayout_editor/design_tree_frame.h
View file @
336d1b23
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/dialogs/dialog_new_dataitem.cpp
View file @
336d1b23
/**
* @file dialog_new_dataitem.cpp
* @brief a dialog called on creating a new plage layout data item.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,11 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file dialog_new_dataitem.cpp
* @brief a dialog called on creating a new plage layout data item.
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
...
...
pagelayout_editor/dialogs/dialogs_for_printing.cpp
View file @
336d1b23
...
...
@@ -2,8 +2,11 @@
* @file dialogs_for_printing.cpp
*/
/* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/events_functions.cpp
View file @
336d1b23
...
...
@@ -2,6 +2,29 @@
* @file pagelayout_editor/events_called_functions.cpp
* @brief page layout editor command event functions.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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 <fctsys.h>
#include <wx/treectrl.h>
...
...
@@ -38,7 +61,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_MENU
(
wxID_SAVEAS
,
PL_EDITOR_FRAME
::
Files_io
)
EVT_MENU
(
wxID_FILE
,
PL_EDITOR_FRAME
::
Files_io
)
EVT_MENU
(
ID_LOAD_DEFAULT_PAGE_LAYOUT
,
PL_EDITOR_FRAME
::
Files_io
)
EVT_MENU
(
ID_
OPEN_POLYGON
_DESCR_FILE
,
PL_EDITOR_FRAME
::
Files_io
)
EVT_MENU
(
ID_
APPEND
_DESCR_FILE
,
PL_EDITOR_FRAME
::
Files_io
)
EVT_MENU
(
ID_GEN_PLOT
,
PL_EDITOR_FRAME
::
ToPlotter
)
...
...
@@ -67,7 +90,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_TOOL
(
wxID_PREVIEW
,
PL_EDITOR_FRAME
::
ToPrinter
)
EVT_TOOL
(
ID_SHEET_SET
,
PL_EDITOR_FRAME
::
Process_Special_Functions
)
EVT_TOOL
(
ID_SHOW_REAL_MODE
,
PL_EDITOR_FRAME
::
OnSelectTitleBlockDisplayMode
)
EVT_TOOL
(
ID_SHOW_
LP
EDITOR_MODE
,
PL_EDITOR_FRAME
::
OnSelectTitleBlockDisplayMode
)
EVT_TOOL
(
ID_SHOW_
PL_
EDITOR_MODE
,
PL_EDITOR_FRAME
::
OnSelectTitleBlockDisplayMode
)
EVT_CHOICE
(
ID_SELECT_COORDINATE_ORIGIN
,
PL_EDITOR_FRAME
::
OnSelectCoordOriginCorner
)
EVT_CHOICE
(
ID_SELECT_PAGE_NUMBER
,
PL_EDITOR_FRAME
::
Process_Special_Functions
)
...
...
@@ -78,7 +101,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
PL_EDITOR_FRAME
::
Process_Special_Functions
)
EVT_UPDATE_UI
(
ID_SHOW_REAL_MODE
,
PL_EDITOR_FRAME
::
OnUpdateTitleBlockDisplayNormalMode
)
EVT_UPDATE_UI
(
ID_SHOW_
LP
EDITOR_MODE
,
PL_EDITOR_FRAME
::
OnUpdateTitleBlockDisplaySpecialMode
)
EVT_UPDATE_UI
(
ID_SHOW_
PL_
EDITOR_MODE
,
PL_EDITOR_FRAME
::
OnUpdateTitleBlockDisplaySpecialMode
)
END_EVENT_TABLE
()
...
...
@@ -157,7 +180,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree
();
item
=
NULL
;
}
m_canvas
->
Refresh
();
else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint
position
=
item
->
GetStartPosUi
();
SetCrossHairPosition
(
position
,
false
);
position
=
GetCrossHairPosition
();
if
(
m_canvas
->
IsPointOnDisplay
(
position
)
)
m_canvas
->
MoveCursorToCrossHair
();
else
RedrawScreen
(
position
,
true
);
item
->
SetFlags
(
NEW_ITEM
);
MoveItem
(
item
);
}
break
;
case
ID_POPUP_ITEM_ADD_RECT
:
...
...
@@ -171,7 +209,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree
();
item
=
NULL
;
}
m_canvas
->
Refresh
();
else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint
position
=
item
->
GetStartPosUi
();
SetCrossHairPosition
(
position
,
false
);
position
=
GetCrossHairPosition
();
if
(
m_canvas
->
IsPointOnDisplay
(
position
)
)
m_canvas
->
MoveCursorToCrossHair
();
else
RedrawScreen
(
position
,
true
);
item
->
SetFlags
(
NEW_ITEM
);
MoveItem
(
item
);
}
break
;
case
ID_POPUP_ITEM_ADD_TEXT
:
...
...
@@ -185,11 +238,16 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree
();
item
=
NULL
;
}
m_canvas
->
Refresh
();
else
{
// Put the new text in move mode:
item
->
SetFlags
(
NEW_ITEM
|
LOCATE_STARTPOINT
);
MoveItem
(
item
);
}
break
;
case
ID_POPUP_ITEM_A
DD_POLY
:
cmd
.
SetId
(
ID_
OPEN_POLYGON
_DESCR_FILE
);
case
ID_POPUP_ITEM_A
PPEND_PAGE_LAYOUT
:
cmd
.
SetId
(
ID_
APPEND
_DESCR_FILE
);
wxPostEvent
(
this
,
cmd
);
break
;
...
...
@@ -240,6 +298,11 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
/*
* Function moveItem: called when the mouse cursor is moving
* moves the item currently selected (or the start point or the end point)
* to the cursor position
*/
DPOINT
initialPosition
;
// The initial position of the item to move, in mm
wxPoint
initialPositionUi
;
// The initial position of the item to move, in Ui
wxPoint
initialCursorPosition
;
// The initial position of the cursor
...
...
@@ -265,10 +328,26 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio
aPanel
->
Refresh
();
}
/*
* Function abortMoveItem: called when an item is currently moving,
* and when the user aborts the move command.
* Restores the initial position of the item
*/
static
void
abortMoveItem
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
)
{
PL_EDITOR_SCREEN
*
screen
=
(
PL_EDITOR_SCREEN
*
)
aPanel
->
GetScreen
();
WORKSHEET_DATAITEM
*
item
=
screen
->
GetCurItem
();
if
(
(
item
->
GetFlags
()
&
NEW_ITEM
)
)
{
PL_EDITOR_FRAME
*
plframe
=
(
PL_EDITOR_FRAME
*
)
aPanel
->
GetParent
();
plframe
->
RemoveLastCommandInUndoList
();
WORKSHEET_LAYOUT
&
pglayout
=
WORKSHEET_LAYOUT
::
GetTheInstance
();
pglayout
.
Remove
(
item
);
plframe
->
RebuildDesignTree
();
}
else
{
if
(
(
item
->
GetFlags
()
&
LOCATE_STARTPOINT
)
)
{
item
->
MoveStartPointTo
(
initialPosition
);
...
...
@@ -279,13 +358,13 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
}
else
item
->
MoveTo
(
initialPosition
);
}
aPanel
->
SetMouseCapture
(
NULL
,
NULL
);
screen
->
SetCurItem
(
NULL
);
aPanel
->
Refresh
();
}
void
PL_EDITOR_FRAME
::
MoveItem
(
WORKSHEET_DATAITEM
*
aItem
)
{
wxCHECK_RET
(
aItem
!=
NULL
,
wxT
(
"Cannot move NULL item"
)
);
...
...
@@ -328,6 +407,8 @@ void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem )
DPOINT
currStartPos
=
aItem
->
GetStartPos
();
DPOINT
currEndPos
=
aItem
->
GetEndPos
();
aItem
->
ClearFlags
(
NEW_ITEM
);
// Save the curren layout before changes
if
(
(
aItem
->
GetFlags
()
&
LOCATE_STARTPOINT
)
)
{
...
...
@@ -363,7 +444,7 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
void
PL_EDITOR_FRAME
::
OnSelectTitleBlockDisplayMode
(
wxCommandEvent
&
event
)
{
WORKSHEET_DATAITEM
::
m_SpecialMode
=
(
event
.
GetId
()
==
ID_SHOW_
LP
EDITOR_MODE
);
WORKSHEET_DATAITEM
::
m_SpecialMode
=
(
event
.
GetId
()
==
ID_SHOW_
PL_
EDITOR_MODE
);
m_canvas
->
Refresh
();
}
...
...
@@ -446,20 +527,13 @@ void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event )
{
}
extern
void
AddNewItemsCommand
(
wxMenu
*
aMainMenu
);
void
PL_EDITOR_FRAME
::
OnTreeRightClick
(
wxTreeEvent
&
event
)
{
m_treePagelayout
->
SelectCell
(
event
.
GetItem
()
);
wxMenu
popMenu
;
AddMenuItem
(
&
popMenu
,
ID_POPUP_ITEM_ADD_LINE
,
_
(
"Add line"
),
KiBitmap
(
add_dashed_line_xpm
)
);
AddMenuItem
(
&
popMenu
,
ID_POPUP_ITEM_ADD_RECT
,
_
(
"Add rect"
),
KiBitmap
(
add_rectangle_xpm
)
);
AddMenuItem
(
&
popMenu
,
ID_POPUP_ITEM_ADD_TEXT
,
_
(
"Add text"
),
KiBitmap
(
add_text_xpm
)
);
AddMenuItem
(
&
popMenu
,
ID_POPUP_ITEM_ADD_POLY
,
_
(
"Import poly descr file"
),
KiBitmap
(
add_polygon_xpm
)
);
AddNewItemsCommand
(
&
popMenu
);
popMenu
.
AppendSeparator
();
AddMenuItem
(
&
popMenu
,
ID_POPUP_DESIGN_TREE_ITEM_DELETE
,
_
(
"Delete"
),
...
...
pagelayout_editor/files.cpp
View file @
336d1b23
/**
* @file
gerbview
/files.cpp
* @file
pl_editor
/files.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 201
2 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
*
Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 201
3 CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -112,9 +112,9 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
OnNewPageLayout
();
break
;
case
ID_
OPEN_POLYGON
_DESCR_FILE
:
case
ID_
APPEND
_DESCR_FILE
:
{
wxFileDialog
openFileDialog
(
this
,
_
(
"
Open polygon descr f
ile"
),
wxFileDialog
openFileDialog
(
this
,
_
(
"
Append Page Layout Descr F
ile"
),
wxEmptyString
,
wxEmptyString
,
PageLayoutDescrFileWildcard
,
wxFD_OPEN
);
...
...
pagelayout_editor/hotkeys.cpp
View file @
336d1b23
/**
* @file
gerbview
/hotkeys.cpp
* @file
pagelayout_editor
/hotkeys.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/hotkeys.h
View file @
336d1b23
...
...
@@ -2,6 +2,30 @@
* @file pagelayout_editor/hotkeys.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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
*/
#ifndef PL_EDITOR_KOTKEYS_H_
#define PL_EDITOR_KOTKEYS_H_
...
...
pagelayout_editor/invoke_pl_editor_dialog.h
View file @
336d1b23
/**
* @file invoke_pl_editor.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
*
...
...
pagelayout_editor/menubar.cpp
View file @
336d1b23
/**
* @file pagelayout_editor/menubar.cpp
* @brief (Re)Create the main menubar for Pl_Editor
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pl_editor/menubar.cpp
* @brief (Re)Create the main menubar for Pl_Editor
*/
#include <fctsys.h>
#include <appl_wxstruct.h>
...
...
pagelayout_editor/onleftclick.cpp
View file @
336d1b23
...
...
@@ -8,7 +8,6 @@
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.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
...
...
pagelayout_editor/onrightclick.cpp
View file @
336d1b23
...
...
@@ -8,7 +8,6 @@
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.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
...
...
@@ -40,6 +39,19 @@
#include <class_worksheet_dataitem.h>
#include <hotkeys.h>
// Helper function to add menuitems relative to items creation
void
AddNewItemsCommand
(
wxMenu
*
aMainMenu
)
{
AddMenuItem
(
aMainMenu
,
ID_POPUP_ITEM_ADD_LINE
,
_
(
"Add Line"
),
KiBitmap
(
add_dashed_line_xpm
)
);
AddMenuItem
(
aMainMenu
,
ID_POPUP_ITEM_ADD_RECT
,
_
(
"Add Rectangle"
),
KiBitmap
(
add_rectangle_xpm
)
);
AddMenuItem
(
aMainMenu
,
ID_POPUP_ITEM_ADD_TEXT
,
_
(
"Add Text"
),
KiBitmap
(
add_text_xpm
)
);
AddMenuItem
(
aMainMenu
,
ID_POPUP_ITEM_APPEND_PAGE_LAYOUT
,
_
(
"Append Page Layout Descr File"
),
KiBitmap
(
import_xpm
)
);
}
/* Prepare the right-click pullup menu.
* The menu already has a list of zoom commands.
...
...
@@ -102,15 +114,7 @@ bool PL_EDITOR_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu )
if
(
!
busy
)
{
AddMenuItem
(
aPopMenu
,
ID_POPUP_ITEM_ADD_LINE
,
_
(
"Add line"
),
KiBitmap
(
add_dashed_line_xpm
)
);
AddMenuItem
(
aPopMenu
,
ID_POPUP_ITEM_ADD_RECT
,
_
(
"Add rect"
),
KiBitmap
(
add_rectangle_xpm
)
);
AddMenuItem
(
aPopMenu
,
ID_POPUP_ITEM_ADD_TEXT
,
_
(
"Add text"
),
KiBitmap
(
add_text_xpm
)
);
AddMenuItem
(
aPopMenu
,
ID_POPUP_ITEM_ADD_POLY
,
_
(
"Import poly descr file"
),
KiBitmap
(
add_polygon_xpm
)
);
AddNewItemsCommand
(
aPopMenu
);
aPopMenu
->
AppendSeparator
();
}
...
...
pagelayout_editor/page_layout_writer.cpp
View file @
336d1b23
...
...
@@ -7,9 +7,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
* Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/pl_editor.cpp
View file @
336d1b23
...
...
@@ -6,8 +6,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/pl_editor_config.cpp
View file @
336d1b23
/**
* @file pl_editor_config.cpp
* @brief page layout editor configuration.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,11 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pl_editor_config.cpp
* @brief page layout editor configuration.
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
...
...
pagelayout_editor/pl_editor_frame.cpp
View file @
336d1b23
/**
* @file pl_editor_frame.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pl_editor_frame.cpp
*/
#include <fctsys.h>
#include <appl_wxstruct.h>
#include <class_drawpanel.h>
...
...
pagelayout_editor/pl_editor_frame.h
View file @
336d1b23
/**
* @file pl_editor_frame.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -23,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pl_editor_frame.h
*/
#ifndef _PL_EDITOR_FRAME_H
#define _PL_EDITOR_FRAME_H
...
...
pagelayout_editor/pl_editor_id.h
View file @
336d1b23
/**
* @file pl_editor_id.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* 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
*/
#ifndef _PL_EDITOR_ID_H_
#define _PL_EDITOR_ID_H_
...
...
@@ -22,12 +50,12 @@ enum pl_editor_ids
ID_DESIGN_TREE_FRAME
,
ID_SHOW_REAL_MODE
,
ID_SHOW_
LP
EDITOR_MODE
,
ID_SHOW_
PL_
EDITOR_MODE
,
ID_SELECT_COORDINATE_ORIGIN
,
ID_LOAD_DEFAULT_PAGE_LAYOUT
,
ID_SELECT_PAGE_NUMBER
,
ID_
OPEN_POLYGON
_DESCR_FILE
,
ID_
APPEND
_DESCR_FILE
,
ID_POPUP_START_RANGE
,
ID_POPUP_ITEM_DELETE
,
...
...
@@ -35,7 +63,7 @@ enum pl_editor_ids
ID_POPUP_ITEM_ADD_LINE
,
ID_POPUP_ITEM_ADD_RECT
,
ID_POPUP_ITEM_ADD_TEXT
,
ID_POPUP_ITEM_A
DD_POLY
,
ID_POPUP_ITEM_A
PPEND_PAGE_LAYOUT
,
ID_POPUP_ITEM_MOVE
,
ID_POPUP_ITEM_PLACE
,
ID_POPUP_ITEM_MOVE_START_POINT
,
...
...
pagelayout_editor/pl_editor_undo_redo.cpp
View file @
336d1b23
...
...
@@ -6,8 +6,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
pagelayout_editor/properties_frame.cpp
View file @
336d1b23
/**
* @file properties_frame.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file properties_frame.cpp
*/
#include <fctsys.h>
#include <wxstruct.h>
#include <class_drawpanel.h>
...
...
pagelayout_editor/properties_frame.h
View file @
336d1b23
/**
* @file properties_frame.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file properties_frame.h
*/
#ifndef _PROPERTIES_FRAME_H
#define _PROPERTIES_FRAME_H
...
...
pagelayout_editor/toolbars_pl_editor.cpp
View file @
336d1b23
/**
* @file toolbars_
gerbe
r.cpp
* @file toolbars_
pl_edito
r.cpp
* @brief Build tool bars
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013
Jean-Pierre Charras, jp.charras at wanadoo.fr
*
Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013
CERN
*
@author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -90,12 +90,14 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void )
// Display mode switch
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddTool
(
ID_SHOW_REAL_MODE
,
wxEmptyString
,
KiBitmap
(
pagelayout_normal_view_mode_xpm
),
m_mainToolBar
->
AddTool
(
ID_SHOW_REAL_MODE
,
wxEmptyString
,
KiBitmap
(
pagelayout_normal_view_mode_xpm
),
_
(
"Show title block like it will be displayed in applications
\n
"
"texts with format are replaced by the full text"
),
wxITEM_CHECK
);
m_mainToolBar
->
AddTool
(
ID_SHOW_LPEDITOR_MODE
,
wxEmptyString
,
KiBitmap
(
pagelayout_special_view_mode_xpm
),
_
(
"how title block in edit mode: texts are shown as is
\n
"
m_mainToolBar
->
AddTool
(
ID_SHOW_PL_EDITOR_MODE
,
wxEmptyString
,
KiBitmap
(
pagelayout_special_view_mode_xpm
),
_
(
"Show title block in edit mode: texts are shown as is:
\n
"
"texts with format are displayed with no change"
),
wxITEM_CHECK
);
...
...
pcbnew/dialogs/dialog_copper_zones.cpp
View file @
336d1b23
...
...
@@ -250,6 +250,7 @@ void DIALOG_COPPER_ZONE::initDialog()
int
layerCount
=
board
->
GetCopperLayerCount
();
wxImageList
*
imageList
=
new
wxImageList
(
LAYER_BITMAP_SIZE_X
,
LAYER_BITMAP_SIZE_Y
);
m_LayerSelectionCtrl
->
AssignImageList
(
imageList
,
wxIMAGE_LIST_SMALL
);
int
ctrlWidth
=
0
;
// Min width for m_LayerSelectionCtrl to show the layers names
for
(
LAYER_NUM
ii
=
FIRST_LAYER
;
ii
<
layerCount
;
++
ii
)
{
LAYER_NUM
layerNumber
=
LAYER_N_BACK
;
...
...
@@ -268,9 +269,19 @@ void DIALOG_COPPER_ZONE::initDialog()
if
(
m_settings
.
m_CurrentZone_Layer
==
layerNumber
)
m_LayerSelectionCtrl
->
Select
(
itemIndex
);
wxSize
tsize
(
GetTextSize
(
msg
,
m_LayerSelectionCtrl
)
);
ctrlWidth
=
std
::
max
(
ctrlWidth
,
tsize
.
x
);
}
m_LayerSelectionCtrl
->
SetColumnWidth
(
0
,
wxLIST_AUTOSIZE
);
// The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
// unfortunately this option does not work well both on
// wxWidgets 2.8 ( column witdth too small), and
// wxWidgets 2.9 ( column witdth too large)
ctrlWidth
+=
LAYER_BITMAP_SIZE_X
+
16
;
// Add bitmap width + margin between bitmap and text
m_LayerSelectionCtrl
->
SetColumnWidth
(
0
,
ctrlWidth
);
ctrlWidth
+=
4
;
// add small margin between text and window borders
m_LayerSelectionCtrl
->
SetMinSize
(
wxSize
(
ctrlWidth
,
-
1
));
wxString
netNameDoNotShowFilter
=
wxT
(
"N-*"
);
if
(
m_Config
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment