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
15479871
Commit
15479871
authored
Apr 18, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some enhancements.
parent
5cd2fad8
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
507 additions
and
512 deletions
+507
-512
GUI_Translation_HOWTO.odt
GUI_Translation_HOWTO.odt
+0
-0
GUI_Translation_HOWTO.pdf
GUI_Translation_HOWTO.pdf
+0
-0
edaappl.cpp
common/edaappl.cpp
+170
-232
wxPcbStruct.h
include/wxPcbStruct.h
+4
-4
class_pad.cpp
pcbnew/class_pad.cpp
+20
-0
class_pad.h
pcbnew/class_pad.h
+7
-0
classpcb.cpp
pcbnew/classpcb.cpp
+1
-1
edit.cpp
pcbnew/edit.cpp
+2
-2
editpads.cpp
pcbnew/editpads.cpp
+8
-4
files.cpp
pcbnew/files.cpp
+16
-16
globaleditpad.cpp
pcbnew/globaleditpad.cpp
+22
-24
initpcb.cpp
pcbnew/initpcb.cpp
+2
-0
ioascii.cpp
pcbnew/ioascii.cpp
+2
-26
modedit.cpp
pcbnew/modedit.cpp
+2
-2
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+1
-1
move-drag_pads.cpp
pcbnew/move-drag_pads.cpp
+31
-26
onrightclick.cpp
pcbnew/onrightclick.cpp
+130
-123
pcbplot.cpp
pcbnew/pcbplot.cpp
+1
-1
wxprint.cpp
share/wxprint.cpp
+88
-50
No files found.
GUI_Translation_HOWTO.odt
0 → 100644
View file @
15479871
File added
GUI_Translation_HOWTO.pdf
0 → 100644
View file @
15479871
File added
common/edaappl.cpp
View file @
15479871
...
@@ -54,6 +54,112 @@
...
@@ -54,6 +54,112 @@
#define FONT_DEFAULT_SIZE 10
/* Default font size.
#define FONT_DEFAULT_SIZE 10
/* Default font size.
* The real font size will be computed at run time */
* The real font size will be computed at run time */
/* A small class to handle the list od existing translations.
* the locale translation is automatic.
* the selection of languages is mainly for mainteners's convenience (tests...)
* To add a support to a new tranlation:
* create a new icon (flag of the country) (see Lang_Fr.xpm as an exemple)
* add a new item to s_Language_List[LANGUAGE_DESCR_COUNT]
* and set LANGUAGE_DESCR_COUNT to the new value
*/
struct
LANGUAGE_DESCR
{
int
m_WX_Lang_Identifier
;
// wxWidget locale identifier (see wxWidget doc)
int
m_KI_Lang_Identifier
;
// kicad identifier used in menu selection (see id.h)
const
char
**
m_Lang_Icon
;
// the icon used in menus
const
wxChar
*
m_Lang_Label
;
// Label used in menus
bool
m_DoNotTranslate
;
// set to true if the m_Lang_Label must not be translated
};
#define LANGUAGE_DESCR_COUNT 14
static
struct
LANGUAGE_DESCR
s_Language_List
[
LANGUAGE_DESCR_COUNT
]
=
{
{
wxLANGUAGE_DEFAULT
,
ID_LANGUAGE_DEFAULT
,
lang_def_xpm
,
_
(
"Default"
)
},
{
wxLANGUAGE_ENGLISH
,
ID_LANGUAGE_ENGLISH
,
lang_en_xpm
,
wxT
(
"English"
),
true
},
{
wxLANGUAGE_FRENCH
,
ID_LANGUAGE_FRENCH
,
lang_fr_xpm
,
_
(
"French"
)
},
{
wxLANGUAGE_SPANISH
,
ID_LANGUAGE_SPANISH
,
lang_es_xpm
,
_
(
"Spanish"
)
},
{
wxLANGUAGE_PORTUGUESE
,
ID_LANGUAGE_PORTUGUESE
,
lang_pt_xpm
,
_
(
"Portuguese"
)
},
{
wxLANGUAGE_ITALIAN
,
ID_LANGUAGE_ITALIAN
,
lang_it_xpm
,
_
(
"Italian"
)
},
{
wxLANGUAGE_GERMAN
,
ID_LANGUAGE_GERMAN
,
lang_de_xpm
,
_
(
"German"
)
},
{
wxLANGUAGE_SLOVENIAN
,
ID_LANGUAGE_SLOVENIAN
,
lang_sl_xpm
,
_
(
"Slovenian"
)
},
{
wxLANGUAGE_HUNGARIAN
,
ID_LANGUAGE_HUNGARIAN
,
lang_hu_xpm
,
_
(
"Hungarian"
)
},
{
wxLANGUAGE_POLISH
,
ID_LANGUAGE_POLISH
,
lang_po_xpm
,
_
(
"Polish"
)
},
{
wxLANGUAGE_RUSSIAN
,
ID_LANGUAGE_RUSSIAN
,
lang_ru_xpm
,
_
(
"Russian"
)
},
{
wxLANGUAGE_KOREAN
,
ID_LANGUAGE_KOREAN
,
lang_ko_xpm
,
_
(
"Korean"
)
},
{
wxLANGUAGE_CHINESE_SIMPLIFIED
,
ID_LANGUAGE_CHINESE_SIMPLIFIED
,
lang_chinese_xpm
,
_
(
"Chinese simplified"
)
},
{
wxLANGUAGE_CATALAN
,
ID_LANGUAGE_CATALAN
,
lang_catalan_xpm
,
_
(
"Catalan"
)
}
};
/**************************/
/**************************/
/* WinEDA_App Constructor */
/* WinEDA_App Constructor */
...
@@ -120,7 +226,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
...
@@ -120,7 +226,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
/* Init kicad environment
/* Init kicad environment
* the environment variable KICAD (if exists) gives the kicad path:
* the environment variable KICAD (if exists) gives the kicad path:
* something like set KICAD=d:\kicad
* something like set KICAD=d:\kicad
*/
*/
m_Env_Defined
=
wxGetEnv
(
wxT
(
"KICAD"
),
&
m_KicadEnv
);
m_Env_Defined
=
wxGetEnv
(
wxT
(
"KICAD"
),
&
m_KicadEnv
);
if
(
m_Env_Defined
)
// ensure m_KicadEnv ends by "/"
if
(
m_Env_Defined
)
// ensure m_KicadEnv ends by "/"
{
{
...
@@ -147,10 +253,10 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
...
@@ -147,10 +253,10 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
g_MsgFont
=
new
wxFont
(
g_StdFontPointSize
,
wxFONTFAMILY_ROMAN
,
wxNORMAL
,
wxNORMAL
);
g_MsgFont
=
new
wxFont
(
g_StdFontPointSize
,
wxFONTFAMILY_ROMAN
,
wxNORMAL
,
wxNORMAL
);
g_DialogFont
=
new
wxFont
(
g_DialogFontPointSize
,
wxFONTFAMILY_ROMAN
,
wxNORMAL
,
wxNORMAL
);
g_DialogFont
=
new
wxFont
(
g_DialogFontPointSize
,
wxFONTFAMILY_ROMAN
,
wxNORMAL
,
wxNORMAL
);
g_ItalicFont
=
new
wxFont
(
g_DialogFontPointSize
,
g_ItalicFont
=
new
wxFont
(
g_DialogFontPointSize
,
wxFONTFAMILY_ROMAN
,
wxFONTFAMILY_ROMAN
,
wxFONTSTYLE_ITALIC
,
wxFONTSTYLE_ITALIC
,
wxNORMAL
);
wxNORMAL
);
g_FixedFont
=
new
wxFont
(
g_FixedFontPointSize
,
wxFONTFAMILY_MODERN
,
wxNORMAL
,
wxNORMAL
);
g_FixedFont
=
new
wxFont
(
g_FixedFontPointSize
,
wxFONTFAMILY_MODERN
,
wxNORMAL
,
wxNORMAL
);
/* installation des gestionnaires de visu d'images (pour help) */
/* installation des gestionnaires de visu d'images (pour help) */
wxImage
::
AddHandler
(
new
wxPNGHandler
);
wxImage
::
AddHandler
(
new
wxPNGHandler
);
...
@@ -190,8 +296,8 @@ void WinEDA_App::InitOnLineHelp()
...
@@ -190,8 +296,8 @@ void WinEDA_App::InitOnLineHelp()
if
(
wxFileExists
(
fullfilename
)
)
if
(
wxFileExists
(
fullfilename
)
)
{
{
m_HtmlCtrl
=
new
wxHtmlHelpController
(
wxHF_TOOLBAR
|
m_HtmlCtrl
=
new
wxHtmlHelpController
(
wxHF_TOOLBAR
|
wxHF_CONTENTS
|
wxHF_PRINT
|
wxHF_OPEN_FILES
wxHF_CONTENTS
|
wxHF_PRINT
|
wxHF_OPEN_FILES
/*| wxHF_SEARCH */
);
/*| wxHF_SEARCH */
);
m_HtmlCtrl
->
UseConfig
(
m_EDA_CommonConfig
);
m_HtmlCtrl
->
UseConfig
(
m_EDA_CommonConfig
);
m_HtmlCtrl
->
SetTitleFormat
(
wxT
(
"Kicad Help"
)
);
m_HtmlCtrl
->
SetTitleFormat
(
wxT
(
"Kicad Help"
)
);
m_HtmlCtrl
->
AddBook
(
fullfilename
);
m_HtmlCtrl
->
AddBook
(
fullfilename
);
...
@@ -202,30 +308,34 @@ void WinEDA_App::InitOnLineHelp()
...
@@ -202,30 +308,34 @@ void WinEDA_App::InitOnLineHelp()
/*******************************/
/*******************************/
bool
WinEDA_App
::
SetBinDir
()
bool
WinEDA_App
::
SetBinDir
()
/*******************************/
/*******************************/
// Find the path to the executable and store it in WinEDA_App::m_BinDir
// Find the path to the executable and store it in WinEDA_App::m_BinDir
{
{
#ifdef __APPLE__
#ifdef __APPLE__
// Derive path from location of the app bundle
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
();
// Derive path from location of the app bundle
if
(
mainBundle
==
NULL
)
return
false
;
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
();
CFURLRef
urlref
=
CFBundleCopyBundleURL
(
mainBundle
);
if
(
mainBundle
==
NULL
)
if
(
urlref
==
NULL
)
return
false
;
return
false
;
CFStringRef
str
=
CFURLCopyFileSystemPath
(
urlref
,
kCFURLPOSIXPathStyle
);
CFURLRef
urlref
=
CFBundleCopyBundleURL
(
mainBundle
);
if
(
str
==
NULL
)
return
false
;
if
(
urlref
==
NULL
)
char
*
native_str
=
NULL
;
return
false
;
int
len
=
CFStringGetMaximumSizeForEncoding
(
CFStringGetLength
(
str
),
CFStringRef
str
=
CFURLCopyFileSystemPath
(
urlref
,
kCFURLPOSIXPathStyle
);
kCFStringEncodingUTF8
)
+
1
;
if
(
str
==
NULL
)
native_str
=
new
char
[
len
];
return
false
;
CFStringGetCString
(
str
,
native_str
,
len
,
kCFStringEncodingUTF8
);
char
*
native_str
=
NULL
;
m_BinDir
=
CONV_FROM_UTF8
(
native_str
);
int
len
=
CFStringGetMaximumSizeForEncoding
(
CFStringGetLength
(
str
),
delete
[]
native_str
;
kCFStringEncodingUTF8
)
+
1
;
native_str
=
new
char
[
len
];
#elif defined(__UNIX__)
CFStringGetCString
(
str
,
native_str
,
len
,
kCFStringEncodingUTF8
);
m_BinDir
=
CONV_FROM_UTF8
(
native_str
);
// Under Linux, if argv[0] doesn't the complete path to the executable,
delete
[]
native_str
;
// it's necessary to obtain it using "which <filename>".
FILE
*
ftmp
;
#elif defined (__UNIX__)
// Under Linux, if argv[0] doesn't the complete path to the executable,
// it's necessary to obtain it using "which <filename>".
FILE
*
ftmp
;
#define TMP_FILE "/tmp/kicad.tmp"
#define TMP_FILE "/tmp/kicad.tmp"
char
Line
[
1024
];
char
Line
[
1024
];
...
@@ -428,67 +538,19 @@ bool WinEDA_App::SetLanguage( bool first_time )
...
@@ -428,67 +538,19 @@ bool WinEDA_App::SetLanguage( bool first_time )
void
WinEDA_App
::
SetLanguageIdentifier
(
int
menu_id
)
void
WinEDA_App
::
SetLanguageIdentifier
(
int
menu_id
)
/**************************************************/
/**************************************************/
/* return in m_LanguageId the
language id (wxWidgets language identifier)
/* return in m_LanguageId the
wxWidgets language identifier Id
* from menu id (internal menu identifier)
* from
the kicad
menu id (internal menu identifier)
*/
*/
{
{
switch
(
menu_id
)
unsigned
int
ii
;
{
case
ID_LANGUAGE_ITALIAN
:
m_LanguageId
=
wxLANGUAGE_ITALIAN
;
break
;
case
ID_LANGUAGE_PORTUGUESE
:
m_LanguageId
=
wxLANGUAGE_PORTUGUESE
;
break
;
case
ID_LANGUAGE_RUSSIAN
:
m_LanguageId
=
wxLANGUAGE_RUSSIAN
;
break
;
case
ID_LANGUAGE_GERMAN
:
m_LanguageId
=
wxLANGUAGE_GERMAN
;
break
;
case
ID_LANGUAGE_SPANISH
:
m_LanguageId
=
wxLANGUAGE_SPANISH
;
break
;
case
ID_LANGUAGE_ENGLISH
:
m_LanguageId
=
wxLANGUAGE_ENGLISH
;
break
;
case
ID_LANGUAGE_FRENCH
:
m_LanguageId
=
wxLANGUAGE_FRENCH
;
break
;
case
ID_LANGUAGE_SLOVENIAN
:
m_LanguageId
=
wxLANGUAGE_SLOVENIAN
;
break
;
case
ID_LANGUAGE_HUNGARIAN
:
m_LanguageId
=
wxLANGUAGE_HUNGARIAN
;
break
;
case
ID_LANGUAGE_POLISH
:
m_LanguageId
=
wxLANGUAGE_POLISH
;
break
;
case
ID_LANGUAGE_KOREAN
:
m_LanguageId
=
wxLANGUAGE_KOREAN
;
break
;
case
ID_LANGUAGE_CATALAN
:
m_LanguageId
=
wxLANGUAGE_CATALAN
;
break
;
case
ID_LANGUAGE_CHINESE_SIMPLIFIED
:
m_LanguageId
=
wxLANGUAGE_CHINESE_SIMPLIFIED
;
break
;
default
:
for
(
ii
=
0
;
ii
<
LANGUAGE_DESCR_COUNT
;
ii
++
)
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
{
break
;
if
(
menu_id
==
s_Language_List
[
ii
].
m_KI_Lang_Identifier
)
{
m_LanguageId
=
s_Language_List
[
ii
].
m_WX_Lang_Identifier
;
break
;
}
}
}
}
}
...
@@ -500,163 +562,38 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
...
@@ -500,163 +562,38 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
/* Create menu list for language choice.
/* Create menu list for language choice.
*/
*/
{
{
wxMenuItem
*
item
;
wxMenuItem
*
item
;
unsigned
int
ii
;
if
(
m_Language_Menu
==
NULL
)
if
(
m_Language_Menu
==
NULL
)
{
{
m_Language_Menu
=
new
wxMenu
;
m_Language_Menu
=
new
wxMenu
;
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_DEFAULT
,
for
(
ii
=
0
;
ii
<
LANGUAGE_DESCR_COUNT
;
ii
++
)
_
(
"Default"
),
wxEmptyString
,
wxITEM_CHECK
);
{
SETBITMAPS
(
lang_def_xpm
);
wxString
MenuLabel
=
s_Language_List
[
ii
].
m_DoNotTranslate
?
m_Language_Menu
->
Append
(
item
);
s_Language_List
[
ii
].
m_Lang_Label
:
wxGetTranslation
(
s_Language_List
[
ii
].
m_Lang_Label
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_ENGLISH
,
item
=
new
wxMenuItem
(
m_Language_Menu
,
s_Language_List
[
ii
].
m_KI_Lang_Identifier
,
wxT
(
"English"
),
wxEmptyString
,
wxITEM_CHECK
);
MenuLabel
,
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_en_xpm
);
SETBITMAPS
(
s_Language_List
[
ii
].
m_Lang_Icon
);
m_Language_Menu
->
Append
(
item
);
m_Language_Menu
->
Append
(
item
);
}
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_FRENCH
,
_
(
"French"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_fr_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_SPANISH
,
_
(
"Spanish"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_es_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_PORTUGUESE
,
_
(
"Portuguese"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_pt_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_ITALIAN
,
_
(
"Italian"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_it_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_GERMAN
,
_
(
"German"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_de_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_SLOVENIAN
,
_
(
"Slovenian"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_sl_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_HUNGARIAN
,
_
(
"Hungarian"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_hu_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_POLISH
,
_
(
"Polish"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_po_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_RUSSIAN
,
_
(
"Russian"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_ru_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_KOREAN
,
_
(
"Korean"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_ko_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_CATALAN
,
_
(
"Catalan"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_catalan_xpm
);
m_Language_Menu
->
Append
(
item
);
item
=
new
wxMenuItem
(
m_Language_Menu
,
ID_LANGUAGE_CHINESE_SIMPLIFIED
,
_
(
"Chinese simplified"
),
wxEmptyString
,
wxITEM_CHECK
);
SETBITMAPS
(
lang_chinese_xpm
);
m_Language_Menu
->
Append
(
item
);
}
}
m_Language_Menu
->
Check
(
ID_LANGUAGE_CATALAN
,
FALSE
);
for
(
ii
=
0
;
ii
<
LANGUAGE_DESCR_COUNT
;
ii
++
)
m_Language_Menu
->
Check
(
ID_LANGUAGE_CHINESE_SIMPLIFIED
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_KOREAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_RUSSIAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_POLISH
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_HUNGARIAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_SLOVENIAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_ITALIAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_PORTUGUESE
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_GERMAN
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_SPANISH
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_FRENCH
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_ENGLISH
,
FALSE
);
m_Language_Menu
->
Check
(
ID_LANGUAGE_DEFAULT
,
FALSE
);
switch
(
m_LanguageId
)
{
{
case
wxLANGUAGE_CATALAN
:
if
(
m_LanguageId
==
s_Language_List
[
ii
].
m_WX_Lang_Identifier
)
m_Language_Menu
->
Check
(
ID_LANGUAGE_CATALAN
,
TRUE
);
m_Language_Menu
->
Check
(
s_Language_List
[
ii
].
m_KI_Lang_Identifier
,
true
);
break
;
else
m_Language_Menu
->
Check
(
s_Language_List
[
ii
].
m_KI_Lang_Identifier
,
false
);
case
wxLANGUAGE_CHINESE_SIMPLIFIED
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_CHINESE_SIMPLIFIED
,
TRUE
);
break
;
case
wxLANGUAGE_KOREAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_KOREAN
,
TRUE
);
break
;
case
wxLANGUAGE_RUSSIAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_RUSSIAN
,
TRUE
);
break
;
case
wxLANGUAGE_GERMAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_GERMAN
,
TRUE
);
break
;
case
wxLANGUAGE_FRENCH
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_FRENCH
,
TRUE
);
break
;
case
wxLANGUAGE_ENGLISH
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_ENGLISH
,
TRUE
);
break
;
case
wxLANGUAGE_SPANISH
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_SPANISH
,
TRUE
);
break
;
case
wxLANGUAGE_PORTUGUESE
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_PORTUGUESE
,
TRUE
);
break
;
case
wxLANGUAGE_ITALIAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_ITALIAN
,
TRUE
);
break
;
case
wxLANGUAGE_SLOVENIAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_SLOVENIAN
,
TRUE
);
break
;
case
wxLANGUAGE_HUNGARIAN
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_HUNGARIAN
,
TRUE
);
break
;
case
wxLANGUAGE_POLISH
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_POLISH
,
TRUE
);
break
;
default
:
m_Language_Menu
->
Check
(
ID_LANGUAGE_DEFAULT
,
TRUE
);
break
;
}
}
if
(
MasterMenu
)
if
(
MasterMenu
)
{
{
ADD_MENUITEM_WITH_HELP_AND_SUBMENU
(
MasterMenu
,
m_Language_Menu
,
ADD_MENUITEM_WITH_HELP_AND_SUBMENU
(
MasterMenu
,
m_Language_Menu
,
ID_LANGUAGE_CHOICE
,
_
(
"Language"
),
ID_LANGUAGE_CHOICE
,
_
(
"Language"
),
wxT
(
"For test only, use Default setup for normal use"
),
wxT
(
"For test only, use Default setup for normal use"
),
language_xpm
);
language_xpm
);
}
}
return
m_Language_Menu
;
return
m_Language_Menu
;
}
}
...
@@ -665,8 +602,9 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
...
@@ -665,8 +602,9 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
/**********************/
/**********************/
int
WinEDA_App
::
OnRun
()
int
WinEDA_App
::
OnRun
()
/**********************/
/**********************/
/* Run init scripts
/* Run init scripts
*/
*/
{
{
#ifdef KICAD_PYTHON
#ifdef KICAD_PYTHON
PyHandler
::
GetInstance
()
->
RunScripts
();
PyHandler
::
GetInstance
()
->
RunScripts
();
...
...
include/wxPcbStruct.h
View file @
15479871
...
@@ -214,14 +214,14 @@ public:
...
@@ -214,14 +214,14 @@ public:
wxDC
*
DC
,
const
wxPoint
&
pos
);
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Pads sur modules
// Pads sur modules
void
AddPad
(
MODULE
*
Module
,
wxDC
*
DC
);
void
AddPad
(
MODULE
*
Module
,
bool
draw
);
void
DeletePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
DeletePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
StartMovePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
StartMovePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
RotatePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
RotatePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
PlacePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
PlacePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
Export_Pad_Settings
(
D_PAD
*
pt_p
ad
);
void
Export_Pad_Settings
(
D_PAD
*
aP
ad
);
void
Import_Pad_Settings
(
D_PAD
*
pt_pad
,
wxDC
*
DC
);
void
Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
);
void
Global_Import_Pad_Settings
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
Global_Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
);
// loading footprints
// loading footprints
...
...
pcbnew/class_pad.cpp
View file @
15479871
...
@@ -82,6 +82,23 @@ void D_PAD::ComputeRayon()
...
@@ -82,6 +82,23 @@ void D_PAD::ComputeRayon()
}
}
/**
* Function GetBoundingBox
* returns the bounding box of this pad
* Mainly used to redraw the screen area occuped by the pad
*/
EDA_Rect
D_PAD
::
GetBoundingBox
()
{
// Calculate area:
ComputeRayon
();
// calculate the radius of the area, considered as a circle
EDA_Rect
area
;
area
.
SetOrigin
(
m_Pos
);
area
.
Inflate
(
m_Rayon
,
m_Rayon
);
return
area
;
}
/*********************************************/
/*********************************************/
const
wxPoint
D_PAD
::
ReturnShapePos
()
const
wxPoint
D_PAD
::
ReturnShapePos
()
/*********************************************/
/*********************************************/
...
@@ -239,6 +256,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
...
@@ -239,6 +256,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
int
zoom
;
int
zoom
;
int
fillpad
=
0
;
int
fillpad
=
0
;
wxPoint
shape_pos
;
wxPoint
shape_pos
;
if
(
m_Flags
&
DO_NOT_DRAW
)
return
;
wxASSERT
(
panel
);
wxASSERT
(
panel
);
...
...
pcbnew/class_pad.h
View file @
15479871
...
@@ -172,6 +172,13 @@ public:
...
@@ -172,6 +172,13 @@ public:
}
}
/**
* Function GetBoundingBox
* returns the bounding box of this Footprint
* Mainly used to redraw the screen area occuped by the footprint
*/
EDA_Rect
GetBoundingBox
();
/**
/**
* Function Compare
* Function Compare
* compares two pads and return 0 if they are equal.
* compares two pads and return 0 if they are equal.
...
...
pcbnew/classpcb.cpp
View file @
15479871
...
@@ -30,6 +30,7 @@ PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN )
...
@@ -30,6 +30,7 @@ PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN )
m_Type
=
idscreen
;
m_Type
=
idscreen
;
SetGridList
(
g_GridList
);
SetGridList
(
g_GridList
);
SetZoomList
(
zoom_list
);
SetZoomList
(
zoom_list
);
m_Grid
=
wxSize
(
500
,
500
);
/* pas de la grille en 1/10000 "*/
Init
();
Init
();
}
}
...
@@ -50,7 +51,6 @@ void PCB_SCREEN::Init()
...
@@ -50,7 +51,6 @@ void PCB_SCREEN::Init()
m_Route_Layer_TOP
=
CMP_N
;
/* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_TOP
=
CMP_N
;
/* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_BOTTOM
=
COPPER_LAYER_N
;
m_Route_Layer_BOTTOM
=
COPPER_LAYER_N
;
m_Zoom
=
128
;
/* valeur */
m_Zoom
=
128
;
/* valeur */
m_Grid
=
wxSize
(
500
,
500
);
/* pas de la grille en 1/10000 "*/
}
}
...
...
pcbnew/edit.cpp
View file @
15479871
...
@@ -663,12 +663,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -663,12 +663,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
:
case
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
:
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
Import_Pad_Settings
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
Import_Pad_Settings
(
(
D_PAD
*
)
GetCurItem
(),
true
);
break
;
break
;
case
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
:
case
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
:
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
Global_Import_Pad_Settings
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
Global_Import_Pad_Settings
(
(
D_PAD
*
)
GetCurItem
(),
true
);
break
;
break
;
case
ID_POPUP_PCB_EXPORT_PAD_SETTINGS
:
case
ID_POPUP_PCB_EXPORT_PAD_SETTINGS
:
...
...
pcbnew/editpads.cpp
View file @
15479871
...
@@ -442,8 +442,12 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
...
@@ -442,8 +442,12 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module
=
(
MODULE
*
)
CurrentPad
->
m_Parent
;
Module
=
(
MODULE
*
)
CurrentPad
->
m_Parent
;
Module
->
m_LastEdit_Time
=
time
(
NULL
);
Module
->
m_LastEdit_Time
=
time
(
NULL
);
if
(
m_DC
)
if
(
m_DC
)
// redraw the area where the pas was, without pad
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_XOR
);
{
CurrentPad
->
m_Flags
|=
DO_NOT_DRAW
;
m_Parent
->
DrawPanel
->
PostDirtyRect
(
CurrentPad
->
GetBoundingBox
()
);
CurrentPad
->
m_Flags
&=
~
DO_NOT_DRAW
;
}
CurrentPad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
CurrentPad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
CurrentPad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
CurrentPad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
if
(
CurrentPad
->
m_Pos
!=
g_Pad_Master
.
m_Pos
)
if
(
CurrentPad
->
m_Pos
!=
g_Pad_Master
.
m_Pos
)
...
@@ -529,8 +533,8 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
...
@@ -529,8 +533,8 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module
->
Set_Rectangle_Encadrement
();
Module
->
Set_Rectangle_Encadrement
();
CurrentPad
->
Display_Infos
(
m_Parent
);
CurrentPad
->
Display_Infos
(
m_Parent
);
if
(
m_DC
)
if
(
m_DC
)
// redraw the area where the pas was
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_OR
);
m_Parent
->
DrawPanel
->
PostDirtyRect
(
CurrentPad
->
GetBoundingBox
()
);
m_Parent
->
GetScreen
()
->
SetModify
();
m_Parent
->
GetScreen
()
->
SetModify
();
}
}
...
...
pcbnew/files.cpp
View file @
15479871
...
@@ -98,7 +98,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
...
@@ -98,7 +98,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
Clear_Pcb
(
TRUE
);
Clear_Pcb
(
TRUE
);
wxSetWorkingDirectory
(
wxPathOnly
(
GetLastProject
(
id
-
ID_LOAD_FILE_1
)
)
);
wxSetWorkingDirectory
(
wxPathOnly
(
GetLastProject
(
id
-
ID_LOAD_FILE_1
)
)
);
LoadOnePcbFile
(
GetLastProject
(
id
-
ID_LOAD_FILE_1
).
GetData
(),
LoadOnePcbFile
(
GetLastProject
(
id
-
ID_LOAD_FILE_1
).
GetData
(),
FALSE
);
false
);
ReCreateAuxiliaryToolbar
();
ReCreateAuxiliaryToolbar
();
break
;
break
;
...
@@ -211,7 +211,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
...
@@ -211,7 +211,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
// Reload the corresponding configuration file:
// Reload the corresponding configuration file:
wxSetWorkingDirectory
(
wxPathOnly
(
GetScreen
()
->
m_FileName
)
);
wxSetWorkingDirectory
(
wxPathOnly
(
GetScreen
()
->
m_FileName
)
);
if
(
Append
)
if
(
Append
)
ReadPcbFile
(
source
,
TRUE
);
ReadPcbFile
(
source
,
true
);
else
else
{
{
Read_Config
(
GetScreen
()
->
m_FileName
);
Read_Config
(
GetScreen
()
->
m_FileName
);
...
@@ -222,7 +222,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
...
@@ -222,7 +222,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
m_DisplayModEdge
=
DisplayOpt
.
DisplayModEdge
;
m_DisplayModEdge
=
DisplayOpt
.
DisplayModEdge
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
ReadPcbFile
(
source
,
FALSE
);
ReadPcbFile
(
source
,
false
);
}
}
fclose
(
source
);
fclose
(
source
);
...
@@ -245,18 +245,18 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
...
@@ -245,18 +245,18 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
/* reset the auto save timer */
/* reset the auto save timer */
g_SaveTime
=
time
(
NULL
);
g_SaveTime
=
time
(
NULL
);
#if 0 && defined(DEBUG)
#if 0 && defined(DEBUG)
// note this freezes up pcbnew when run under the kicad project
// note this freezes up pcbnew when run under the kicad project
// manager. runs fine from command prompt. This is because the kicad
// manager. runs fine from command prompt. This is because the kicad
// project manager redirects stdout of the child pcbnew process to itself,
// project manager redirects stdout of the child pcbnew process to itself,
// but never reads from that pipe, and that in turn eventually blocks
// but never reads from that pipe, and that in turn eventually blocks
// the pcbnew program when the pipe it is writing to gets full.
// the pcbnew program when the pipe it is writing to gets full.
// Output the board object tree to stdout, but please run from command prompt:
// Output the board object tree to stdout, but please run from command prompt:
m_Pcb->Show( 0, std::cout );
m_Pcb->Show( 0, std::cout );
#endif
#endif
return
1
;
return
1
;
}
}
...
@@ -273,14 +273,14 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -273,14 +273,14 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
wxString
upperTxt
;
wxString
upperTxt
;
wxString
lowerTxt
;
wxString
lowerTxt
;
wxString
msg
;
wxString
msg
;
bool
saveok
=
TRUE
;
bool
saveok
=
TRUE
;
FILE
*
dest
;
FILE
*
dest
;
if
(
FileName
==
wxEmptyString
)
if
(
FileName
==
wxEmptyString
)
{
{
msg
=
wxT
(
"*"
)
+
PcbExtBuffer
;
msg
=
wxT
(
"*"
)
+
PcbExtBuffer
;
FullFileName
=
EDA_FileSelector
(
_
(
"Save board files:"
),
FullFileName
=
EDA_FileSelector
(
_
(
"Save board files:"
),
wxEmptyString
,
/* Chemin par defaut */
wxEmptyString
,
/* Chemin par defaut */
GetScreen
()
->
m_FileName
,
/* nom fichier par defaut */
GetScreen
()
->
m_FileName
,
/* nom fichier par defaut */
...
@@ -292,7 +292,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -292,7 +292,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
);
);
if
(
FullFileName
==
wxEmptyString
)
if
(
FullFileName
==
wxEmptyString
)
return
FALSE
;
return
FALSE
;
GetScreen
()
->
m_FileName
=
FullFileName
;
GetScreen
()
->
m_FileName
=
FullFileName
;
}
}
else
else
...
@@ -327,7 +327,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -327,7 +327,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
}
}
else
else
{
{
BackupFileName
=
wxEmptyString
;
BackupFileName
=
wxEmptyString
;
saveok
=
FALSE
;
saveok
=
FALSE
;
}
}
...
@@ -344,7 +344,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -344,7 +344,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
{
{
GetScreen
()
->
m_FileName
=
FullFileName
;
GetScreen
()
->
m_FileName
=
FullFileName
;
SetTitle
(
GetScreen
()
->
m_FileName
);
SetTitle
(
GetScreen
()
->
m_FileName
);
SavePcbFormatAscii
(
dest
);
SavePcbFormatAscii
(
dest
);
fclose
(
dest
);
fclose
(
dest
);
}
}
...
@@ -364,9 +364,9 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -364,9 +364,9 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
lowerTxt
+=
FullFileName
;
lowerTxt
+=
FullFileName
;
Affiche_1_Parametre
(
this
,
1
,
upperTxt
,
lowerTxt
,
CYAN
);
Affiche_1_Parametre
(
this
,
1
,
upperTxt
,
lowerTxt
,
CYAN
);
g_SaveTime
=
time
(
NULL
);
/* Reset timer for the automatic saving */
g_SaveTime
=
time
(
NULL
);
/* Reset timer for the automatic saving */
GetScreen
()
->
ClrModify
();
GetScreen
()
->
ClrModify
();
return
TRUE
;
return
TRUE
;
}
}
pcbnew/globaleditpad.cpp
View file @
15479871
...
@@ -38,7 +38,6 @@ class WinEDA_PadGlobalEditFrame : public wxDialog
...
@@ -38,7 +38,6 @@ class WinEDA_PadGlobalEditFrame : public wxDialog
private
:
private
:
WinEDA_BasePcbFrame
*
m_Parent
;
WinEDA_BasePcbFrame
*
m_Parent
;
wxDC
*
m_DC
;
D_PAD
*
CurrentPad
;
D_PAD
*
CurrentPad
;
wxCheckBox
*
m_Pad_Shape_Filter
;
wxCheckBox
*
m_Pad_Shape_Filter
;
wxCheckBox
*
m_Pad_Layer_Filter
;
wxCheckBox
*
m_Pad_Layer_Filter
;
...
@@ -51,8 +50,7 @@ private:
...
@@ -51,8 +50,7 @@ private:
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_PadGlobalEditFrame
(
WinEDA_BasePcbFrame
*
parent
,
WinEDA_PadGlobalEditFrame
(
WinEDA_BasePcbFrame
*
parent
,
D_PAD
*
Pad
);
D_PAD
*
Pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
~
WinEDA_PadGlobalEditFrame
()
{
}
~
WinEDA_PadGlobalEditFrame
()
{
}
private
:
private
:
...
@@ -72,10 +70,8 @@ END_EVENT_TABLE()
...
@@ -72,10 +70,8 @@ END_EVENT_TABLE()
/********************************************************************************/
/********************************************************************************/
WinEDA_PadGlobalEditFrame
::
WinEDA_PadGlobalEditFrame
(
WinEDA_BasePcbFrame
*
parent
,
WinEDA_PadGlobalEditFrame
::
WinEDA_PadGlobalEditFrame
(
WinEDA_BasePcbFrame
*
parent
,
D_PAD
*
Pad
,
D_PAD
*
Pad
)
:
wxDC
*
DC
,
wxDialog
(
parent
,
-
1
,
_
(
"Pads Global Edit"
),
wxDefaultPosition
,
wxSize
(
310
,
235
),
const
wxPoint
&
framepos
)
:
wxDialog
(
parent
,
-
1
,
_
(
"Pads Global Edit"
),
framepos
,
wxSize
(
310
,
235
),
DIALOG_STYLE
)
DIALOG_STYLE
)
/********************************************************************************/
/********************************************************************************/
{
{
...
@@ -84,7 +80,6 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
...
@@ -84,7 +80,6 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
m_Parent
=
parent
;
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
m_DC
=
DC
;
Centre
();
Centre
();
CurrentPad
=
Pad
;
CurrentPad
=
Pad
;
...
@@ -206,26 +201,24 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
...
@@ -206,26 +201,24 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
/***************************************************************************/
/***************************************************************************/
void
WinEDA_BasePcbFrame
::
Global_Import_Pad_Settings
(
D_PAD
*
Pad
,
wxDC
*
DC
)
void
WinEDA_BasePcbFrame
::
Global_Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
)
/***************************************************************************/
/***************************************************************************/
/*
/** Function Global_Import_Pad_Settings
* Routine de selection et de correction des dimensions des pastilles
* Function to change pad caracteristics for the given footprint
* de tous les modules
* or alls footprints which look like the given footprint
* - semblables a l'module de reference selectionnee,
* @param aPad pad to use as pattern. The given footprint is the parent of this pad
* c.a.d de meme nom de librairie
* @param aDraw: if true: redraws the footprint
* - ou sur l'module localisee, selon le menu d'appel
*/
*/
{
{
D_PAD
*
pt_pad
;
MODULE
*
Module_Ref
,
*
Module
;
MODULE
*
Module_Ref
,
*
Module
;
int
diag
;
int
diag
;
bool
Edit_Same_Modules
=
FALSE
;
bool
Edit_Same_Modules
=
FALSE
;
if
(
Pad
==
NULL
)
if
(
a
Pad
==
NULL
)
return
;
return
;
Module
=
(
MODULE
*
)
Pad
->
m_Parent
;
Module
=
(
MODULE
*
)
a
Pad
->
m_Parent
;
if
(
Module
==
NULL
)
if
(
Module
==
NULL
)
{
{
...
@@ -237,8 +230,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
...
@@ -237,8 +230,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module
->
Display_Infos
(
this
);
Module
->
Display_Infos
(
this
);
WinEDA_PadGlobalEditFrame
*
frame
=
new
WinEDA_PadGlobalEditFrame
(
this
,
Pad
,
DC
,
WinEDA_PadGlobalEditFrame
*
frame
=
new
WinEDA_PadGlobalEditFrame
(
this
,
aPad
);
wxPoint
(
-
1
,
-
1
)
);
diag
=
frame
->
ShowModal
();
diag
=
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
Destroy
();
...
@@ -266,9 +258,14 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
...
@@ -266,9 +258,14 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module
->
Display_Infos
(
this
);
Module
->
Display_Infos
(
this
);
/* Effacement du module */
/* Effacement du module */
Module
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
if
(
aDraw
)
{
pt_pad
=
(
D_PAD
*
)
Module
->
m_Pads
;
Module
->
m_Flags
|=
DO_NOT_DRAW
;
DrawPanel
->
PostDirtyRect
(
Module
->
GetBoundingBox
()
);
Module
->
m_Flags
&=
~
DO_NOT_DRAW
;
}
D_PAD
*
pt_pad
=
(
D_PAD
*
)
Module
->
m_Pads
;
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
{
{
/* Filtrage des modifications interdites */
/* Filtrage des modifications interdites */
...
@@ -345,7 +342,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
...
@@ -345,7 +342,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
}
}
Module
->
Set_Rectangle_Encadrement
();
Module
->
Set_Rectangle_Encadrement
();
Module
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
if
(
aDraw
)
DrawPanel
->
PostDirtyRect
(
Module
->
GetBoundingBox
()
);
}
}
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
...
...
pcbnew/initpcb.cpp
View file @
15479871
...
@@ -145,7 +145,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
...
@@ -145,7 +145,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
SetCurItem
(
NULL
);
SetCurItem
(
NULL
);
/* Init parametres de gestion */
/* Init parametres de gestion */
wxSize
gridsize
=
GetScreen
()
->
GetGrid
();
((
PCB_SCREEN
*
)
GetScreen
())
->
Init
();
((
PCB_SCREEN
*
)
GetScreen
())
->
Init
();
GetScreen
()
->
SetGrid
(
gridsize
);
g_HightLigt_Status
=
0
;
g_HightLigt_Status
=
0
;
...
...
pcbnew/ioascii.cpp
View file @
15479871
...
@@ -355,19 +355,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
...
@@ -355,19 +355,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
continue
;
continue
;
}
}
if
(
stricmp
(
Line
,
"GridSize"
)
==
0
)
{
wxSize
Grid
;
Grid
.
x
=
atoi
(
data
);
data
=
strtok
(
NULL
,
" =
\n\r
"
);
if
(
data
)
Grid
.
y
=
atoi
(
data
);
else
Grid
.
y
=
Grid
.
x
;
GetScreen
()
->
SetGrid
(
Grid
);
continue
;
}
if
(
stricmp
(
Line
,
"ZoneGridSize"
)
==
0
)
if
(
stricmp
(
Line
,
"ZoneGridSize"
)
==
0
)
{
{
g_GridRoutingSize
=
atoi
(
data
);
g_GridRoutingSize
=
atoi
(
data
);
...
@@ -518,23 +505,12 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
...
@@ -518,23 +505,12 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
/******************************************************************************/
/******************************************************************************/
{
{
char
text
[
1024
];
char
text
[
1024
];
int
ii
,
jj
;
int
ii
;
fprintf
(
aFile
,
"$SETUP
\n
"
);
fprintf
(
aFile
,
"$SETUP
\n
"
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
fprintf
(
aFile
,
text
);
fprintf
(
aFile
,
text
);
if
(
aFrame
->
GetScreen
()
->
m_UserGridIsON
)
ii
=
jj
=
-
1
;
else
{
ii
=
aFrame
->
GetScreen
()
->
GetGrid
().
x
;
jj
=
aFrame
->
GetScreen
()
->
GetGrid
().
y
;
}
sprintf
(
text
,
"GridSize %d %d
\n
"
,
ii
,
jj
);
fprintf
(
aFile
,
text
);
sprintf
(
text
,
"UserGridSize %lf %lf %s
\n
"
,
sprintf
(
text
,
"UserGridSize %lf %lf %s
\n
"
,
aFrame
->
GetScreen
()
->
m_UserGrid
.
x
,
aFrame
->
GetScreen
()
->
m_UserGrid
.
y
,
aFrame
->
GetScreen
()
->
m_UserGrid
.
x
,
aFrame
->
GetScreen
()
->
m_UserGrid
.
y
,
(
g_UserGrid_Unit
==
0
)
?
"INCH"
:
"mm"
);
(
g_UserGrid_Unit
==
0
)
?
"INCH"
:
"mm"
);
...
@@ -551,7 +527,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
...
@@ -551,7 +527,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
}
}
fprintf
(
aFile
,
"TrackWidth %d
\n
"
,
g_DesignSettings
.
m_CurrentTrackWidth
);
fprintf
(
aFile
,
"TrackWidth %d
\n
"
,
g_DesignSettings
.
m_CurrentTrackWidth
);
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
for
(
i
nt
i
i
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
{
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
break
;
break
;
...
...
pcbnew/modedit.cpp
View file @
15479871
...
@@ -462,12 +462,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -462,12 +462,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
:
case
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
:
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
Import_Pad_Settings
(
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
(),
&
dc
);
Import_Pad_Settings
(
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
(),
true
);
break
;
break
;
case
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
:
case
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
:
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
Global_Import_Pad_Settings
(
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
(),
&
dc
);
Global_Import_Pad_Settings
(
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
(),
true
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
...
...
pcbnew/modedit_onclick.cpp
View file @
15479871
...
@@ -157,7 +157,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -157,7 +157,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if
(
m_Pcb
->
m_Modules
)
if
(
m_Pcb
->
m_Modules
)
{
{
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
SaveCopyInUndoList
(
m_Pcb
->
m_Modules
);
AddPad
(
m_Pcb
->
m_Modules
,
DC
);
AddPad
(
m_Pcb
->
m_Modules
,
true
);
}
}
break
;
break
;
...
...
pcbnew/move-drag_pads.cpp
View file @
15479871
...
@@ -132,7 +132,7 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
...
@@ -132,7 +132,7 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
/***********************************************************************/
/***********************************************************************/
void
WinEDA_BasePcbFrame
::
Import_Pad_Settings
(
D_PAD
*
pt_pad
,
wxDC
*
DC
)
void
WinEDA_BasePcbFrame
::
Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
)
/***********************************************************************/
/***********************************************************************/
/* Met a jour les nouvelles valeurs de dimensions du pad pointe par pt_pad
/* Met a jour les nouvelles valeurs de dimensions du pad pointe par pt_pad
...
@@ -141,29 +141,33 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
...
@@ -141,29 +141,33 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
* - la position et les noms ne sont pas touches
* - la position et les noms ne sont pas touches
*/
*/
{
{
if
(
DC
)
if
(
aDraw
)
pt_pad
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
{
aPad
->
m_Flags
|=
DO_NOT_DRAW
;
pt_pad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
DrawPanel
->
PostDirtyRect
(
aPad
->
GetBoundingBox
()
);
pt_pad
->
m_Masque_Layer
=
g_Pad_Master
.
m_Masque_Layer
;
aPad
->
m_Flags
&=
~
DO_NOT_DRAW
;
pt_pad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
}
pt_pad
->
m_Orient
=
g_Pad_Master
.
m_Orient
+
(
(
MODULE
*
)
pt_pad
->
m_Parent
)
->
m_Orient
;
aPad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
pt_pad
->
m_Size
=
g_Pad_Master
.
m_Size
;
aPad
->
m_Masque_Layer
=
g_Pad_Master
.
m_Masque_Layer
;
pt_pad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
aPad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
pt_pad
->
m_Offset
=
g_Pad_Master
.
m_Offset
;
aPad
->
m_Orient
=
g_Pad_Master
.
m_Orient
+
pt_pad
->
m_Drill
=
g_Pad_Master
.
m_Drill
;
(
(
MODULE
*
)
aPad
->
m_Parent
)
->
m_Orient
;
pt_pad
->
m_DrillShape
=
g_Pad_Master
.
m_DrillShape
;
aPad
->
m_Size
=
g_Pad_Master
.
m_Size
;
aPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
aPad
->
m_Offset
=
g_Pad_Master
.
m_Offset
;
aPad
->
m_Drill
=
g_Pad_Master
.
m_Drill
;
aPad
->
m_DrillShape
=
g_Pad_Master
.
m_DrillShape
;
/* Traitement des cas particuliers : */
/* Traitement des cas particuliers : */
switch
(
g_Pad_Master
.
m_PadShape
)
switch
(
g_Pad_Master
.
m_PadShape
)
{
{
case
PAD_TRAPEZOID
:
case
PAD_TRAPEZOID
:
pt_p
ad
->
m_DeltaSize
=
g_Pad_Master
.
m_DeltaSize
;
aP
ad
->
m_DeltaSize
=
g_Pad_Master
.
m_DeltaSize
;
break
;
break
;
case
PAD_CIRCLE
:
case
PAD_CIRCLE
:
pt_pad
->
m_Size
.
y
=
pt_p
ad
->
m_Size
.
x
;
aPad
->
m_Size
.
y
=
aP
ad
->
m_Size
.
x
;
break
;
break
;
}
}
...
@@ -171,21 +175,21 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
...
@@ -171,21 +175,21 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
{
{
case
PAD_SMD
:
case
PAD_SMD
:
case
PAD_CONN
:
case
PAD_CONN
:
pt_p
ad
->
m_Drill
=
wxSize
(
0
,
0
);
aP
ad
->
m_Drill
=
wxSize
(
0
,
0
);
pt_p
ad
->
m_Offset
.
x
=
0
;
aP
ad
->
m_Offset
.
x
=
0
;
pt_p
ad
->
m_Offset
.
y
=
0
;
aP
ad
->
m_Offset
.
y
=
0
;
}
}
pt_p
ad
->
ComputeRayon
();
aP
ad
->
ComputeRayon
();
if
(
DC
)
if
(
aDraw
)
pt_pad
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
DrawPanel
->
PostDirtyRect
(
aPad
->
GetBoundingBox
()
);
(
(
MODULE
*
)
pt_p
ad
->
m_Parent
)
->
m_LastEdit_Time
=
time
(
NULL
);
(
(
MODULE
*
)
aP
ad
->
m_Parent
)
->
m_LastEdit_Time
=
time
(
NULL
);
}
}
/***********************************************************/
/***********************************************************/
void
WinEDA_BasePcbFrame
::
AddPad
(
MODULE
*
Module
,
wxDC
*
DC
)
void
WinEDA_BasePcbFrame
::
AddPad
(
MODULE
*
Module
,
bool
draw
)
/***********************************************************/
/***********************************************************/
/* Routine d'ajout d'un pad sur l'module selectionnee */
/* Routine d'ajout d'un pad sur l'module selectionnee */
{
{
...
@@ -218,7 +222,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
...
@@ -218,7 +222,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
}
}
/* Mise a jour des caract de la pastille : */
/* Mise a jour des caract de la pastille : */
Import_Pad_Settings
(
Pad
,
NULL
);
Import_Pad_Settings
(
Pad
,
false
);
Pad
->
m_Netname
.
Empty
();
Pad
->
m_Netname
.
Empty
();
Pad
->
m_Pos
=
GetScreen
()
->
m_Curseur
;
Pad
->
m_Pos
=
GetScreen
()
->
m_Curseur
;
...
@@ -248,7 +252,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
...
@@ -248,7 +252,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
/* Redessin du module */
/* Redessin du module */
Module
->
Set_Rectangle_Encadrement
();
Module
->
Set_Rectangle_Encadrement
();
Pad
->
Display_Infos
(
this
);
Pad
->
Display_Infos
(
this
);
Module
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
if
(
draw
)
DrawPanel
->
PostDirtyRect
(
Module
->
GetBoundingBox
()
);
}
}
...
...
pcbnew/onrightclick.cpp
View file @
15479871
/**************************************************
******************************
/
/**************************************************/
/* onrightclick.cpp:
fonctions de l'edition du PCB appel�es par le bouton droit
*/
/* onrightclick.cpp:
Right mouse button functions
*/
/**************************************************
******************************
/
/**************************************************/
#include "fctsys.h"
#include "fctsys.h"
...
@@ -86,8 +86,8 @@ static wxMenu* Append_Track_Width_List()
...
@@ -86,8 +86,8 @@ static wxMenu* Append_Track_Width_List()
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
break
;
break
;
value
=
To_User_Unit
(
g_UnitMetric
,
value
=
To_User_Unit
(
g_UnitMetric
,
g_DesignSettings
.
m_TrackWidthHistory
[
ii
],
g_DesignSettings
.
m_TrackWidthHistory
[
ii
],
PCB_INTERNAL_UNIT
);
PCB_INTERNAL_UNIT
);
if
(
g_UnitMetric
==
INCHES
)
// Affichage en mils
if
(
g_UnitMetric
==
INCHES
)
// Affichage en mils
msg
.
Printf
(
_
(
"Track %.1f"
),
value
*
1000
);
msg
.
Printf
(
_
(
"Track %.1f"
),
value
*
1000
);
else
else
...
@@ -106,8 +106,8 @@ static wxMenu* Append_Track_Width_List()
...
@@ -106,8 +106,8 @@ static wxMenu* Append_Track_Width_List()
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
0
)
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
0
)
break
;
break
;
value
=
To_User_Unit
(
g_UnitMetric
,
value
=
To_User_Unit
(
g_UnitMetric
,
g_DesignSettings
.
m_ViaSizeHistory
[
ii
],
g_DesignSettings
.
m_ViaSizeHistory
[
ii
],
PCB_INTERNAL_UNIT
);
PCB_INTERNAL_UNIT
);
if
(
g_UnitMetric
==
INCHES
)
if
(
g_UnitMetric
==
INCHES
)
msg
.
Printf
(
_
(
"Via %.1f"
),
value
*
1000
);
msg
.
Printf
(
_
(
"Via %.1f"
),
value
*
1000
);
else
else
...
@@ -154,12 +154,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -154,12 +154,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
item
&&
item
->
m_Flags
)
if
(
item
&&
item
->
m_Flags
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
_
(
"Cancel"
),
cancel_xpm
);
_
(
"Cancel"
),
cancel_xpm
);
}
}
else
else
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CLOSE_CURRENT_TOOL
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CLOSE_CURRENT_TOOL
,
_
(
"End Tool"
),
cancel_tool_xpm
);
_
(
"End Tool"
),
cancel_tool_xpm
);
}
}
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
...
@@ -168,7 +168,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -168,7 +168,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
item
&&
item
->
m_Flags
)
if
(
item
&&
item
->
m_Flags
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
_
(
"Cancel"
),
cancel_xpm
);
_
(
"Cancel"
),
cancel_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
}
}
...
@@ -227,23 +227,23 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -227,23 +227,23 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
!
(
(
MODULE
*
)
item
)
->
IsLocked
()
)
if
(
!
(
(
MODULE
*
)
item
)
->
IsLocked
()
)
{
{
msg
=
AddHotkeyName
(
_
(
msg
=
AddHotkeyName
(
_
(
"Lock Module"
),
s_Board_Editor_Hokeys_Descr
,
"Lock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
HK_LOCK_UNLOCK_FOOTPRINT
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE
,
msg
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE
,
msg
,
Locked_xpm
);
Locked_xpm
);
}
}
else
else
{
{
msg
=
AddHotkeyName
(
_
(
msg
=
AddHotkeyName
(
_
(
"Unlock Module"
),
s_Board_Editor_Hokeys_Descr
,
"Unlock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
HK_LOCK_UNLOCK_FOOTPRINT
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FREE_MODULE
,
msg
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FREE_MODULE
,
msg
,
Unlocked_xpm
);
Unlocked_xpm
);
}
}
if
(
!
flags
)
if
(
!
flags
)
aPopMenu
->
Append
(
ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE
,
aPopMenu
->
Append
(
ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE
,
_
(
"Auto place Module"
)
);
_
(
"Auto place Module"
)
);
}
}
if
(
m_HTOOL_current_state
==
ID_TOOLBARH_PCB_AUTOROUTE
)
if
(
m_HTOOL_current_state
==
ID_TOOLBARH_PCB_AUTOROUTE
)
...
@@ -265,12 +265,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -265,12 +265,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_MOVE_DRAWING_REQUEST
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_MOVE_DRAWING_REQUEST
,
_
(
"Move Drawing"
),
move_xpm
);
_
(
"Move Drawing"
),
move_xpm
);
}
}
if
(
flags
&
IS_NEW
)
if
(
flags
&
IS_NEW
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_STOP_CURRENT_DRAWING
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_STOP_CURRENT_DRAWING
,
_
(
"End Drawing"
),
apply_xpm
);
_
(
"End Drawing"
),
apply_xpm
);
}
}
aPopMenu
->
Append
(
ID_POPUP_PCB_EDIT_DRAWING
,
_
(
"Edit Drawing"
)
);
aPopMenu
->
Append
(
ID_POPUP_PCB_EDIT_DRAWING
,
_
(
"Edit Drawing"
)
);
aPopMenu
->
Append
(
ID_POPUP_PCB_DELETE_DRAWING
,
_
(
"Delete Drawing"
)
);
aPopMenu
->
Append
(
ID_POPUP_PCB_DELETE_DRAWING
,
_
(
"Delete Drawing"
)
);
...
@@ -278,11 +278,11 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -278,11 +278,11 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case
TYPEZONE
:
// Item used to fill a zone
case
TYPEZONE
:
// Item used to fill a zone
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_ZONE
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_ZONE
,
_
(
"Delete Zone Filling"
),
delete_xpm
);
_
(
"Delete Zone Filling"
),
delete_xpm
);
break
;
break
;
case
TYPEZONE_CONTAINER
:
// Item used to handle a zone area (outlines, holes ...)
case
TYPEZONE_CONTAINER
:
// Item used to handle a zone area (outlines, holes ...)
if
(
flags
&
IS_NEW
)
if
(
flags
&
IS_NEW
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE
,
_
(
"Close Zone Outline"
),
apply_xpm
);
_
(
"Close Zone Outline"
),
apply_xpm
);
...
@@ -305,29 +305,29 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -305,29 +305,29 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case
TYPEMARKER
:
case
TYPEMARKER
:
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_MARKER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_MARKER
,
_
(
"Delete Marker"
),
delete_xpm
);
_
(
"Delete Marker"
),
delete_xpm
);
break
;
break
;
case
TYPECOTATION
:
case
TYPECOTATION
:
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_EDIT_COTATION
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_EDIT_COTATION
,
_
(
"Edit Dimension"
),
edit_xpm
);
_
(
"Edit Dimension"
),
edit_xpm
);
}
}
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_COTATION
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_COTATION
,
_
(
"Delete Dimension"
),
delete_xpm
);
_
(
"Delete Dimension"
),
delete_xpm
);
break
;
break
;
case
TYPEMIRE
:
case
TYPEMIRE
:
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_MOVE_MIRE_REQUEST
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_MOVE_MIRE_REQUEST
,
_
(
"Move Target"
),
move_xpm
);
_
(
"Move Target"
),
move_xpm
);
}
}
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_EDIT_MIRE
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_EDIT_MIRE
,
_
(
"Edit Target"
),
edit_xpm
);
_
(
"Edit Target"
),
edit_xpm
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_MIRE
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_MIRE
,
_
(
"Delete Target"
),
delete_xpm
);
_
(
"Delete Target"
),
delete_xpm
);
break
;
break
;
case
TYPEEDGEMODULE
:
case
TYPEEDGEMODULE
:
...
@@ -360,9 +360,9 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -360,9 +360,9 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
!
flags
)
if
(
!
flags
)
{
{
msg
=
AddHotkeyName
(
_
(
"Get and Move Footprint"
),
msg
=
AddHotkeyName
(
_
(
"Get and Move Footprint"
),
s_Board_Editor_Hokeys_Descr
,
HK_GET_AND_MOVE_FOOTPRINT
);
s_Board_Editor_Hokeys_Descr
,
HK_GET_AND_MOVE_FOOTPRINT
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
,
msg
,
Move_Module_xpm
);
msg
,
Move_Module_xpm
);
}
}
/* Traitement des fonctions specifiques */
/* Traitement des fonctions specifiques */
...
@@ -373,12 +373,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -373,12 +373,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if
(
m_Pcb
->
m_ZoneDescriptorList
.
size
()
>
0
)
if
(
m_Pcb
->
m_ZoneDescriptorList
.
size
()
>
0
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_FILL_ALL_ZONES
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_FILL_ALL_ZONES
,
_
(
"Fill or Refill All Zones"
),
fill_zone_xpm
);
_
(
"Fill or Refill All Zones"
),
fill_zone_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER
,
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
break
;
break
;
...
@@ -386,12 +386,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -386,12 +386,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case
ID_TRACK_BUTT
:
case
ID_TRACK_BUTT
:
{
{
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
Append_Track_Width_List
(),
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
Append_Track_Width_List
(),
ID_POPUP_PCB_SELECT_WIDTH
,
ID_POPUP_PCB_SELECT_WIDTH
,
_
(
"Select Track Width"
),
width_track_xpm
);
_
(
"Select Track Width"
),
width_track_xpm
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_CU_LAYER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_CU_LAYER
,
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER_PAIR
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER_PAIR
,
_
(
"Select layer pair for vias"
),
select_layer_pair_xpm
);
_
(
"Select layer pair for vias"
),
select_layer_pair_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
break
;
break
;
...
@@ -402,13 +402,13 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -402,13 +402,13 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case
ID_LINE_COMMENT_BUTT
:
case
ID_LINE_COMMENT_BUTT
:
case
ID_PCB_COTATION_BUTT
:
case
ID_PCB_COTATION_BUTT
:
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_NO_CU_LAYER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_NO_CU_LAYER
,
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
break
;
break
;
case
ID_COMPONENT_BUTT
:
case
ID_COMPONENT_BUTT
:
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC
,
_
(
"Footprint documentation"
),
book_xpm
);
_
(
"Footprint documentation"
),
book_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
break
;
break
;
...
@@ -417,15 +417,15 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -417,15 +417,15 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
{
wxMenu
*
commands
=
new
wxMenu
;
wxMenu
*
commands
=
new
wxMenu
;
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
commands
,
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
commands
,
ID_POPUP_PCB_AUTOPLACE_COMMANDS
,
_
(
ID_POPUP_PCB_AUTOPLACE_COMMANDS
,
_
(
"Glob Move and Place"
),
move_xpm
);
"Glob Move and Place"
),
move_xpm
);
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES
,
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES
,
_
(
"Unlock All Modules"
),
Unlocked_xpm
);
_
(
"Unlock All Modules"
),
Unlocked_xpm
);
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES
,
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES
,
_
(
"Lock All Modules"
),
Locked_xpm
);
_
(
"Lock All Modules"
),
Locked_xpm
);
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOMOVE_ALL_MODULES
,
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_AUTOMOVE_ALL_MODULES
,
_
(
"Move All Modules"
),
move_xpm
);
_
(
"Move All Modules"
),
move_xpm
);
commands
->
Append
(
ID_POPUP_PCB_AUTOMOVE_NEW_MODULES
,
_
(
"Move New Modules"
)
);
commands
->
Append
(
ID_POPUP_PCB_AUTOMOVE_NEW_MODULES
,
_
(
"Move New Modules"
)
);
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
commands
->
Append
(
ID_POPUP_PCB_AUTOPLACE_ALL_MODULES
,
_
(
"Autoplace All Modules"
)
);
commands
->
Append
(
ID_POPUP_PCB_AUTOPLACE_ALL_MODULES
,
_
(
"Autoplace All Modules"
)
);
...
@@ -433,7 +433,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -433,7 +433,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
commands
->
Append
(
ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE
,
_
(
"Autoplace Next Module"
)
);
commands
->
Append
(
ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE
,
_
(
"Autoplace Next Module"
)
);
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_REORIENT_ALL_MODULES
,
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_REORIENT_ALL_MODULES
,
_
(
"Orient All Modules"
),
rotate_module_pos_xpm
);
_
(
"Orient All Modules"
),
rotate_module_pos_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
...
@@ -442,7 +442,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -442,7 +442,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
wxMenu
*
commands
=
new
wxMenu
;
wxMenu
*
commands
=
new
wxMenu
;
aPopMenu
->
Append
(
ID_POPUP_PCB_AUTOROUTE_COMMANDS
,
_
(
"Global Autoroute"
),
commands
);
aPopMenu
->
Append
(
ID_POPUP_PCB_AUTOROUTE_COMMANDS
,
_
(
"Global Autoroute"
),
commands
);
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_SELECT_LAYER_PAIR
,
ADD_MENUITEM
(
commands
,
ID_POPUP_PCB_SELECT_LAYER_PAIR
,
_
(
"Select layer pair"
),
select_layer_pair_xpm
);
_
(
"Select layer pair"
),
select_layer_pair_xpm
);
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_ALL_MODULES
,
_
(
"Autoroute All Modules"
)
);
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_ALL_MODULES
,
_
(
"Autoroute All Modules"
)
);
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
...
@@ -451,19 +451,19 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -451,19 +451,19 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
{
commands
->
AppendSeparator
();
commands
->
AppendSeparator
();
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER
,
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER
,
_
(
"Global AutoRouter"
)
);
_
(
"Global AutoRouter"
)
);
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA
,
commands
->
Append
(
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA
,
_
(
"Read Global AutoRouter Data"
)
);
_
(
"Read Global AutoRouter Data"
)
);
}
}
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
}
}
if
(
locate_track
)
if
(
locate_track
)
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
Append_Track_Width_List
(),
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
Append_Track_Width_List
(),
ID_POPUP_PCB_SELECT_WIDTH
,
_
(
"Select Track Width"
),
ID_POPUP_PCB_SELECT_WIDTH
,
_
(
"Select Track Width"
),
width_track_xpm
);
width_track_xpm
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_SELECT_LAYER
,
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
_
(
"Select Working Layer"
),
Select_W_Layer_xpm
);
aPopMenu
->
AppendSeparator
();
aPopMenu
->
AppendSeparator
();
break
;
break
;
}
}
...
@@ -481,20 +481,20 @@ void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu )
...
@@ -481,20 +481,20 @@ void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu )
*/
*/
{
{
ADD_MENUITEM
(
menu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
ADD_MENUITEM
(
menu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
_
(
"Cancel Block"
),
cancel_xpm
);
_
(
"Cancel Block"
),
cancel_xpm
);
ADD_MENUITEM
(
menu
,
ID_POPUP_ZOOM_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_ZOOM_BLOCK
,
_
(
"Zoom Block (drag middle mouse)"
),
zoom_selected_xpm
);
_
(
"Zoom Block (drag middle mouse)"
),
zoom_selected_xpm
);
menu
->
AppendSeparator
();
menu
->
AppendSeparator
();
ADD_MENUITEM
(
menu
,
ID_POPUP_PLACE_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_PLACE_BLOCK
,
_
(
"Place Block"
),
apply_xpm
);
_
(
"Place Block"
),
apply_xpm
);
ADD_MENUITEM
(
menu
,
ID_POPUP_COPY_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_COPY_BLOCK
,
_
(
"Copy Block (shift + drag mouse)"
),
copyblock_xpm
);
_
(
"Copy Block (shift + drag mouse)"
),
copyblock_xpm
);
ADD_MENUITEM
(
menu
,
ID_POPUP_INVERT_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_INVERT_BLOCK
,
_
(
"Flip Block (alt + drag mouse)"
),
invert_module_xpm
);
_
(
"Flip Block (alt + drag mouse)"
),
invert_module_xpm
);
ADD_MENUITEM
(
menu
,
ID_POPUP_ROTATE_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_ROTATE_BLOCK
,
_
(
"Rotate Block (ctrl + drag mouse)"
),
rotate_pos_xpm
);
_
(
"Rotate Block (ctrl + drag mouse)"
),
rotate_pos_xpm
);
ADD_MENUITEM
(
menu
,
ID_POPUP_DELETE_BLOCK
,
ADD_MENUITEM
(
menu
,
ID_POPUP_DELETE_BLOCK
,
_
(
"Delete Block (shift+ctrl + drag mouse)"
),
delete_xpm
);
_
(
"Delete Block (shift+ctrl + drag mouse)"
),
delete_xpm
);
}
}
...
@@ -517,7 +517,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -517,7 +517,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
wxMenu
*
via_mnu
=
new
wxMenu
();
wxMenu
*
via_mnu
=
new
wxMenu
();
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
via_mnu
,
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
via_mnu
,
ID_POPUP_PCB_VIA_EDITING
,
_
(
"Edit Via"
),
edit_xpm
);
ID_POPUP_PCB_VIA_EDITING
,
_
(
"Edit Via"
),
edit_xpm
);
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
,
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
,
_
(
"Set via hole to Default"
),
apply_xpm
);
_
(
"Set via hole to Default"
),
apply_xpm
);
msg
=
_
(
"Set via hole to a specific value. This specfic value is currently"
);
msg
=
_
(
"Set via hole to a specific value. This specfic value is currently"
);
...
@@ -528,13 +528,13 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -528,13 +528,13 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
msg
=
_
(
"Set alt via hole value. This value is currently"
);
msg
=
_
(
"Set alt via hole value. This value is currently"
);
msg
<<
wxT
(
" "
)
<<
ReturnStringFromValue
(
g_UnitMetric
,
g_DesignSettings
.
m_ViaDrillCustomValue
,
m_InternalUnits
);
msg
<<
wxT
(
" "
)
<<
ReturnStringFromValue
(
g_UnitMetric
,
g_DesignSettings
.
m_ViaDrillCustomValue
,
m_InternalUnits
);
ADD_MENUITEM_WITH_HELP
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
,
ADD_MENUITEM_WITH_HELP
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
,
_
(
"Set the via hole alt value"
),
msg
,
edit_xpm
);
_
(
"Set the via hole alt value"
),
msg
,
edit_xpm
);
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
_
(
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
_
(
"Export Via hole to alt value"
),
Export_Options_Pad_xpm
);
"Export Via hole to alt value"
),
Export_Options_Pad_xpm
);
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
,
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
,
_
(
"Export via hole to others id vias"
),
global_options_pad_xpm
);
_
(
"Export via hole to others id vias"
),
global_options_pad_xpm
);
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
,
ADD_MENUITEM
(
via_mnu
,
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
,
_
(
"Set ALL via holes to default"
),
apply_xpm
);
_
(
"Set ALL via holes to default"
),
apply_xpm
);
if
(
!
Track
->
IsDrillDefault
()
)
if
(
!
Track
->
IsDrillDefault
()
)
{
{
via_mnu
->
Enable
(
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
FALSE
);
via_mnu
->
Enable
(
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
FALSE
);
...
@@ -547,27 +547,27 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -547,27 +547,27 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
if
(
Track
->
IsPointOnEnds
(
cursorPosition
,
-
1
)
!=
0
)
if
(
Track
->
IsPointOnEnds
(
cursorPosition
,
-
1
)
!=
0
)
{
{
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_MOVE_TRACK_NODE
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_MOVE_TRACK_NODE
,
_
(
"Move Node"
),
move_xpm
);
_
(
"Move Node"
),
move_xpm
);
}
}
else
else
{
{
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE
,
_
(
"Drag Segments, keep slope"
),
drag_segment_withslope_xpm
);
_
(
"Drag Segments, keep slope"
),
drag_segment_withslope_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
,
_
(
"Drag Segment"
),
drag_track_segment_xpm
);
_
(
"Drag Segment"
),
drag_track_segment_xpm
);
#if 0
#if 0
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_SEGMENT,
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_SEGMENT,
_( "Move Segment" ), move_track_segment_xpm );
_( "Move Segment" ), move_track_segment_xpm );
#endif
#endif
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_BREAK_TRACK
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_BREAK_TRACK
,
_
(
"Break Track"
),
Break_Line_xpm
);
_
(
"Break Track"
),
Break_Line_xpm
);
}
}
}
}
}
}
else
if
(
flags
&
IS_DRAGGED
)
// Drag via or node in progress
else
if
(
flags
&
IS_DRAGGED
)
// Drag via or node in progress
{
{
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE
,
_
(
"Place Node"
),
apply_xpm
);
_
(
"Place Node"
),
apply_xpm
);
return
;
return
;
}
}
else
// Edition in progress
else
// Edition in progress
...
@@ -581,11 +581,11 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -581,11 +581,11 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
PopMenu
->
Append
(
ID_POPUP_PCB_PLACE_VIA
,
msg
);
PopMenu
->
Append
(
ID_POPUP_PCB_PLACE_VIA
,
msg
);
// See if we can place a Micro Via (4 or more layers, and start from an external layer):
// See if we can place a Micro Via (4 or more layers, and start from an external layer):
if
(
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
IsMicroViaAcceptable
()
)
if
(
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
IsMicroViaAcceptable
()
)
{
{
msg
=
AddHotkeyName
(
_
(
msg
=
AddHotkeyName
(
_
(
"Place Micro Via"
),
s_Board_Editor_Hokeys_Descr
,
"Place Micro Via"
),
s_Board_Editor_Hokeys_Descr
,
HK_ADD_MICROVIA
);
HK_ADD_MICROVIA
);
PopMenu
->
Append
(
ID_POPUP_PCB_PLACE_MICROVIA
,
msg
);
PopMenu
->
Append
(
ID_POPUP_PCB_PLACE_MICROVIA
,
msg
);
}
}
}
}
...
@@ -601,39 +601,39 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -601,39 +601,39 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
Track
->
Type
()
==
TYPEVIA
?
_
(
"Edit Via"
)
:
_
(
"Edit Segment"
),
width_segment_xpm
);
Track
->
Type
()
==
TYPEVIA
?
_
(
"Edit Via"
)
:
_
(
"Edit Segment"
),
width_segment_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_TRACK
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_TRACK
,
_
(
"Edit Track"
),
width_track_xpm
);
_
(
"Edit Track"
),
width_track_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_NET
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_NET
,
_
(
"Edit Net"
),
width_net_xpm
);
_
(
"Edit Net"
),
width_net_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE
,
_
(
"Edit ALL Tracks and Vias"
),
width_track_via_xpm
);
_
(
"Edit ALL Tracks and Vias"
),
width_track_via_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE
,
_
(
"Edit ALL Vias (no track)"
),
width_vias_xpm
);
_
(
"Edit ALL Vias (no track)"
),
width_vias_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE
,
_
(
"Edit ALL Tracks (no via)"
),
width_track_xpm
);
_
(
"Edit ALL Tracks (no via)"
),
width_track_xpm
);
}
}
// Delete control:
// Delete control:
track_mnu
=
new
wxMenu
;
track_mnu
=
new
wxMenu
;
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
track_mnu
,
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
track_mnu
,
ID_POPUP_PCB_DELETE_TRACK_MNU
,
_
(
"Delete"
),
delete_xpm
);
ID_POPUP_PCB_DELETE_TRACK_MNU
,
_
(
"Delete"
),
delete_xpm
);
msg
=
AddHotkeyName
(
Track
->
Type
()
==
TYPEVIA
?
_
(
"Delete Via"
)
:
_
(
"Delete Segment"
),
msg
=
AddHotkeyName
(
Track
->
Type
()
==
TYPEVIA
?
_
(
"Delete Via"
)
:
_
(
"Delete Segment"
),
s_Board_Editor_Hokeys_Descr
,
HK_BACK_SPACE
);
s_Board_Editor_Hokeys_Descr
,
HK_BACK_SPACE
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACKSEG
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACKSEG
,
msg
,
Delete_Line_xpm
);
msg
,
Delete_Line_xpm
);
if
(
!
flags
)
if
(
!
flags
)
{
{
msg
=
AddHotkeyName
(
_
(
"Delete Track"
),
s_Board_Editor_Hokeys_Descr
,
HK_DELETE
);
msg
=
AddHotkeyName
(
_
(
"Delete Track"
),
s_Board_Editor_Hokeys_Descr
,
HK_DELETE
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACK
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACK
,
msg
,
Delete_Track_xpm
);
msg
,
Delete_Track_xpm
);
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACKNET
,
ADD_MENUITEM
(
track_mnu
,
ID_POPUP_PCB_DELETE_TRACKNET
,
_
(
"Delete Net"
),
Delete_Net_xpm
);
_
(
"Delete Net"
),
Delete_Net_xpm
);
}
}
track_mnu
=
new
wxMenu
;
track_mnu
=
new
wxMenu
;
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
track_mnu
,
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
track_mnu
,
ID_POPUP_PCB_SETFLAGS_TRACK_MNU
,
_
(
"Set Flags"
),
Flag_xpm
);
ID_POPUP_PCB_SETFLAGS_TRACK_MNU
,
_
(
"Set Flags"
),
Flag_xpm
);
track_mnu
->
Append
(
ID_POPUP_PCB_LOCK_ON_TRACKSEG
,
_
(
"Locked: Yes"
),
wxEmptyString
,
TRUE
);
track_mnu
->
Append
(
ID_POPUP_PCB_LOCK_ON_TRACKSEG
,
_
(
"Locked: Yes"
),
wxEmptyString
,
TRUE
);
track_mnu
->
Append
(
ID_POPUP_PCB_LOCK_OFF_TRACKSEG
,
_
(
"Locked: No"
),
wxEmptyString
,
TRUE
);
track_mnu
->
Append
(
ID_POPUP_PCB_LOCK_OFF_TRACKSEG
,
_
(
"Locked: No"
),
wxEmptyString
,
TRUE
);
...
@@ -661,66 +661,66 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
...
@@ -661,66 +661,66 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
/* Create the wxMenuitem list for zone outlines editing and zone filling
/* Create the wxMenuitem list for zone outlines editing and zone filling
*/
*/
{
{
if
(
edge_zone
->
m_Flags
==
IS_DRAGGED
)
if
(
edge_zone
->
m_Flags
==
IS_DRAGGED
)
{
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT
,
_
(
"Place Edge Outline"
),
apply_xpm
);
_
(
"Place Edge Outline"
),
apply_xpm
);
}
}
else
if
(
edge_zone
->
m_Flags
)
else
if
(
edge_zone
->
m_Flags
)
{
{
if
(
(
edge_zone
->
m_Flags
&
IN_EDIT
)
)
if
(
(
edge_zone
->
m_Flags
&
IN_EDIT
)
)
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_ZONE_CORNER
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_ZONE_CORNER
,
_
(
"Place Corner"
),
apply_xpm
);
_
(
"Place Corner"
),
apply_xpm
);
else
else
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_ZONE_OUTLINES
,
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_PLACE_ZONE_OUTLINES
,
_
(
"Place Zone"
),
apply_xpm
);
_
(
"Place Zone"
),
apply_xpm
);
}
}
else
else
{
{
wxMenu
*
zones_menu
=
new
wxMenu
();
wxMenu
*
zones_menu
=
new
wxMenu
();
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
zones_menu
,
ADD_MENUITEM_WITH_SUBMENU
(
aPopMenu
,
zones_menu
,
-
1
,
_
(
"Zones"
),
add_zone_xpm
);
-
1
,
_
(
"Zones"
),
add_zone_xpm
);
int
index
;
int
index
;
if
(
(
index
=
edge_zone
->
HitTestForCorner
(
GetScreen
()
->
RefPos
(
true
)
)
)
>=
0
)
if
(
(
index
=
edge_zone
->
HitTestForCorner
(
GetScreen
()
->
RefPos
(
true
)
)
)
>=
0
)
{
{
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_MOVE_ZONE_CORNER
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_MOVE_ZONE_CORNER
,
_
(
"Move Corner"
),
move_xpm
);
_
(
"Move Corner"
),
move_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CORNER
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CORNER
,
_
(
"Delete Corner"
),
delete_xpm
);
_
(
"Delete Corner"
),
delete_xpm
);
}
}
else
if
(
(
index
=
edge_zone
->
HitTestForEdge
(
GetScreen
()
->
RefPos
(
true
)
)
)
>=
0
)
else
if
(
(
index
=
edge_zone
->
HitTestForEdge
(
GetScreen
()
->
RefPos
(
true
)
)
)
>=
0
)
{
{
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ADD_ZONE_CORNER
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ADD_ZONE_CORNER
,
_
(
"Create Corner"
),
Add_Corner_xpm
);
_
(
"Create Corner"
),
Add_Corner_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT
,
_
(
"Drag Outline Segment"
),
drag_outline_segment_xpm
);
_
(
"Drag Outline Segment"
),
drag_outline_segment_xpm
);
}
}
zones_menu
->
AppendSeparator
();
zones_menu
->
AppendSeparator
();
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE
,
_
(
"Add Similar Zone"
),
add_zone_xpm
);
_
(
"Add Similar Zone"
),
add_zone_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE
,
_
(
"Add Cutout Area"
),
add_zone_cutout
);
_
(
"Add Cutout Area"
),
add_zone_cutout
);
zones_menu
->
AppendSeparator
();
zones_menu
->
AppendSeparator
();
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_FILL_ZONE
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_FILL_ZONE
,
_
(
"Fill Zone"
),
fill_zone_xpm
);
_
(
"Fill Zone"
),
fill_zone_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_MOVE_ZONE_OUTLINES
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_MOVE_ZONE_OUTLINES
,
_
(
"Move Zone"
),
move_xpm
);
_
(
"Move Zone"
),
move_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_EDIT_ZONE_PARAMS
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_EDIT_ZONE_PARAMS
,
_
(
"Edit Zone Params"
),
edit_xpm
);
_
(
"Edit Zone Params"
),
edit_xpm
);
zones_menu
->
AppendSeparator
();
zones_menu
->
AppendSeparator
();
if
(
index
>=
0
&&
edge_zone
->
m_Poly
->
IsCutoutContour
(
edge_zone
->
m_CornerSelection
)
)
if
(
index
>=
0
&&
edge_zone
->
m_Poly
->
IsCutoutContour
(
edge_zone
->
m_CornerSelection
)
)
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CUTOUT
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CUTOUT
,
_
(
"Delete Cutout"
),
delete_xpm
);
_
(
"Delete Cutout"
),
delete_xpm
);
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER
,
ADD_MENUITEM
(
zones_menu
,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER
,
_
(
"Delete Zone Outline"
),
delete_xpm
);
_
(
"Delete Zone Outline"
),
delete_xpm
);
}
}
}
}
...
@@ -744,27 +744,27 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men
...
@@ -744,27 +744,27 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men
{
{
msg
=
AddHotkeyName
(
_
(
"Move"
),
s_Board_Editor_Hokeys_Descr
,
HK_MOVE_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Move"
),
s_Board_Editor_Hokeys_Descr
,
HK_MOVE_FOOTPRINT
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_MOVE_MODULE_REQUEST
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_MOVE_MODULE_REQUEST
,
msg
,
Move_Module_xpm
);
msg
,
Move_Module_xpm
);
msg
=
AddHotkeyName
(
_
(
"Drag"
),
s_Board_Editor_Hokeys_Descr
,
HK_DRAG_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Drag"
),
s_Board_Editor_Hokeys_Descr
,
HK_DRAG_FOOTPRINT
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_DRAG_MODULE_REQUEST
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_DRAG_MODULE_REQUEST
,
msg
,
Drag_Module_xpm
);
msg
,
Drag_Module_xpm
);
}
}
msg
=
AddHotkeyName
(
_
(
"Rotate +"
),
s_Board_Editor_Hokeys_Descr
,
HK_ROTATE_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Rotate +"
),
s_Board_Editor_Hokeys_Descr
,
HK_ROTATE_FOOTPRINT
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE
,
msg
,
rotate_module_pos_xpm
);
msg
,
rotate_module_pos_xpm
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE
,
_
(
"Rotate -"
),
rotate_module_neg_xpm
);
_
(
"Rotate -"
),
rotate_module_neg_xpm
);
msg
=
AddHotkeyName
(
_
(
"Flip"
),
s_Board_Editor_Hokeys_Descr
,
HK_FLIP_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Flip"
),
s_Board_Editor_Hokeys_Descr
,
HK_FLIP_FOOTPRINT
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_CHANGE_SIDE_MODULE
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_CHANGE_SIDE_MODULE
,
msg
,
invert_module_xpm
);
msg
,
invert_module_xpm
);
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_EDIT_MODULE
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_EDIT_MODULE
,
_
(
"Edit"
),
Edit_Module_xpm
);
_
(
"Edit"
),
Edit_Module_xpm
);
if
(
!
flags
)
if
(
!
flags
)
{
{
sub_menu_footprint
->
AppendSeparator
();
sub_menu_footprint
->
AppendSeparator
();
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_DELETE_MODULE
,
ADD_MENUITEM
(
sub_menu_footprint
,
ID_POPUP_PCB_DELETE_MODULE
,
_
(
"Delete Module"
),
Delete_Module_xpm
);
_
(
"Delete Module"
),
Delete_Module_xpm
);
}
}
}
}
...
@@ -787,16 +787,16 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m
...
@@ -787,16 +787,16 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m
if
(
!
flags
)
if
(
!
flags
)
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST
,
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST
,
_
(
"Move"
),
Move_Field_xpm
);
_
(
"Move"
),
Move_Field_xpm
);
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_ROTATE_TEXTMODULE
,
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_ROTATE_TEXTMODULE
,
_
(
"Rotate"
),
Rotate_Field_xpm
);
_
(
"Rotate"
),
Rotate_Field_xpm
);
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_EDIT_TEXTMODULE
,
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_EDIT_TEXTMODULE
,
_
(
"Edit"
),
edit_text_xpm
);
_
(
"Edit"
),
edit_text_xpm
);
if
(
FpText
->
m_Type
==
TEXT_is_DIVERS
)
if
(
FpText
->
m_Type
==
TEXT_is_DIVERS
)
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_DELETE_TEXTMODULE
,
ADD_MENUITEM
(
sub_menu_Fp_text
,
ID_POPUP_PCB_DELETE_TEXTMODULE
,
_
(
"Delete"
),
delete_xpm
);
_
(
"Delete"
),
delete_xpm
);
if
(
!
flags
)
if
(
!
flags
)
{
{
...
@@ -825,26 +825,33 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
...
@@ -825,26 +825,33 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_MOVE_PAD_REQUEST
,
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_MOVE_PAD_REQUEST
,
_
(
"Move"
),
move_pad_xpm
);
_
(
"Move"
),
move_pad_xpm
);
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_DRAG_PAD_REQUEST
,
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_DRAG_PAD_REQUEST
,
_
(
"Drag"
),
drag_pad_xpm
);
_
(
"Drag"
),
drag_pad_xpm
);
}
}
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_EDIT_PAD
,
_
(
"Edit Pad"
),
options_pad_xpm
);
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_EDIT_PAD
,
_
(
"Edit Pad"
),
options_pad_xpm
);
sub_menu_Pad
->
AppendSeparator
();
sub_menu_Pad
->
AppendSeparator
();
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
,
ADD_MENUITEM_WITH_HELP
(
sub_menu_Pad
,
ID_POPUP_PCB_IMPORT_PAD_SETTINGS
,
_
(
"New Pad Settings"
),
options_new_pad_xpm
);
_
(
"New Pad Settings"
),
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_EXPORT_PAD_SETTINGS
,
_
(
"Copy current pad settings to this pad"
),
_
(
"Export Pad Settings"
),
Export_Options_Pad_xpm
);
options_new_pad_xpm
);
ADD_MENUITEM_WITH_HELP
(
sub_menu_Pad
,
ID_POPUP_PCB_EXPORT_PAD_SETTINGS
,
_
(
"Export Pad Settings"
),
_
(
"Copy this pad settings to current pad settings"
),
Export_Options_Pad_xpm
);
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
,
ADD_MENUITEM_WITH_HELP
(
sub_menu_Pad
,
ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS
,
_
(
"Global Pad Settings"
),
global_options_pad_xpm
);
_
(
"Global Pad Settings"
),
_
(
"Copy this pad settings to all pads in this footprint (or similar footprints)"
),
global_options_pad_xpm
);
sub_menu_Pad
->
AppendSeparator
();
sub_menu_Pad
->
AppendSeparator
();
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_DELETE_PAD
,
ADD_MENUITEM
(
sub_menu_Pad
,
ID_POPUP_PCB_DELETE_PAD
,
_
(
"delete"
),
Delete_Pad_xpm
);
_
(
"delete"
),
Delete_Pad_xpm
);
}
}
if
(
m_HTOOL_current_state
==
ID_TOOLBARH_PCB_AUTOROUTE
)
if
(
m_HTOOL_current_state
==
ID_TOOLBARH_PCB_AUTOROUTE
)
...
@@ -884,14 +891,14 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
...
@@ -884,14 +891,14 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
if
(
!
flags
)
if
(
!
flags
)
{
{
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST
,
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST
,
_
(
"Move"
),
move_text_xpm
);
_
(
"Move"
),
move_text_xpm
);
}
}
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_ROTATE_TEXTEPCB
,
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_ROTATE_TEXTEPCB
,
_
(
"Rotate"
),
rotate_pos_xpm
);
_
(
"Rotate"
),
rotate_pos_xpm
);
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_EDIT_TEXTEPCB
,
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_EDIT_TEXTEPCB
,
_
(
"Edit"
),
edit_text_xpm
);
_
(
"Edit"
),
edit_text_xpm
);
sub_menu_Text
->
AppendSeparator
();
sub_menu_Text
->
AppendSeparator
();
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_DELETE_TEXTEPCB
,
ADD_MENUITEM
(
sub_menu_Text
,
ID_POPUP_PCB_DELETE_TEXTEPCB
,
_
(
"Delete"
),
delete_text_xpm
);
_
(
"Delete"
),
delete_text_xpm
);
}
}
pcbnew/pcbplot.cpp
View file @
15479871
...
@@ -332,7 +332,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -332,7 +332,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
_
(
"Exclude contents of Edges_Pcb layer from all other layers"
)
);
_
(
"Exclude contents of Edges_Pcb layer from all other layers"
)
);
LeftBoxSizer
->
Add
(
m_Exclude_Edges_Pcb
,
0
,
wxGROW
|
wxALL
,
1
);
LeftBoxSizer
->
Add
(
m_Exclude_Edges_Pcb
,
0
,
wxGROW
|
wxALL
,
1
);
// Option
d'impression du cartouche
:
// Option
to plot page references
:
if
(
m_Parent
->
m_Print_Sheet_Ref
)
if
(
m_Parent
->
m_Print_Sheet_Ref
)
{
{
m_Plot_Sheet_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print sheet ref"
)
);
m_Plot_Sheet_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print sheet ref"
)
);
...
...
share/wxprint.cpp
View file @
15479871
...
@@ -39,7 +39,8 @@
...
@@ -39,7 +39,8 @@
#endif
#endif
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
//#include "gr_basic.h"
#include "common.h"
#include "common.h"
...
@@ -51,17 +52,17 @@
...
@@ -51,17 +52,17 @@
#ifdef PCBNEW
#ifdef PCBNEW
#include "pcbnew.h"
#include "pcbnew.h"
extern
float
Scale_X
,
Scale_Y
;
static
long
s_SelectedLayers
=
CUIVRE_LAYER
|
CMP_LAYER
|
SILKSCREEN_LAYER_CMP
|
SILKSCREEN_LAYER_CU
;
static
double
s_ScaleList
[]
=
{
0
,
0.5
,
0.7
,
0.999
,
1.0
,
1.4
,
2.0
,
3.0
,
4.0
};
#endif
#include "protos.h"
#include "protos.h"
//#define DEFAULT_ORIENTATION_PAPER wxPORTRAIT
// For pcbnew:
#define DEFAULT_ORIENTATION_PAPER wxLANDSCAPE
#define OPTKEY_LAYERBASE wxT( "PrintLayer_%d" )
#define OPTKEY_PRINT_X_FINESCALE_ADJ wxT( "PrintXFineScaleAdj" )
#define OPTKEY_PRINT_Y_FINESCALE_ADJ wxT( "PrintYFineScaleAdj" )
#define OPTKEY_PRINT_SCALE wxT( "PrintScale" )
#endif
#define DEFAULT_ORIENTATION_PAPER wxLANDSCAPE // other option is wxPORTRAIT
#ifdef EESCHEMA
#ifdef EESCHEMA
#define WIDTH_MAX_VALUE 100
#define WIDTH_MAX_VALUE 100
#else
#else
...
@@ -69,6 +70,14 @@ static double s_ScaleList[] =
...
@@ -69,6 +70,14 @@ static double s_ScaleList[] =
#endif
#endif
#define WIDTH_MIN_VALUE 1
#define WIDTH_MIN_VALUE 1
#ifdef PCBNEW
extern
float
Scale_X
,
Scale_Y
;
static
long
s_SelectedLayers
;
static
double
s_ScaleList
[]
=
{
0
,
0.5
,
0.7
,
0.999
,
1.0
,
1.4
,
2.0
,
3.0
,
4.0
};
#endif
// static print data and page setup data, to remember settings during the session
// static print data and page setup data, to remember settings during the session
static
wxPrintData
*
g_PrintData
;
static
wxPrintData
*
g_PrintData
;
...
@@ -82,6 +91,8 @@ static int s_Scale_Select = 3; // default selected scale = ScaleList[3]
...
@@ -82,6 +91,8 @@ static int s_Scale_Select = 3; // default selected scale = ScaleList[3]
static
bool
s_PrintMirror
;
static
bool
s_PrintMirror
;
static
bool
s_Print_Sheet_Ref
=
TRUE
;
static
bool
s_Print_Sheet_Ref
=
TRUE
;
/****************************************************************/
/****************************************************************/
/* frame de Preparation de l'impression (options, selections... */
/* frame de Preparation de l'impression (options, selections... */
/****************************************************************/
/****************************************************************/
...
@@ -101,17 +112,19 @@ public:
...
@@ -101,17 +112,19 @@ public:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_PrintFrame
*
m_PrintFrame
;
WinEDA_PrintFrame
*
m_PrintFrame
;
EDA_Printout
(
WinEDA_PrintFrame
*
print_frame
,
EDA_Printout
(
WinEDA_PrintFrame
*
print_frame
,
WinEDA_DrawFrame
*
parent
,
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
bool
print_ref
)
:
bool
print_ref
)
:
wxPrintout
(
title
)
{
wxPrintout
(
title
)
{
m_PrintFrame
=
print_frame
;
m_PrintFrame
=
print_frame
;
m_Parent
=
parent
;
m_Parent
=
parent
;
s_PrintMaskLayer
=
0xFFFFFFFF
;
s_PrintMaskLayer
=
0xFFFFFFFF
;
m_Print_Sheet_Ref
=
print_ref
;
m_Print_Sheet_Ref
=
print_ref
;
}
}
bool
OnPrintPage
(
int
page
);
bool
OnPrintPage
(
int
page
);
bool
HasPage
(
int
page
);
bool
HasPage
(
int
page
);
bool
OnBeginDocument
(
int
startPage
,
int
endPage
);
bool
OnBeginDocument
(
int
startPage
,
int
endPage
);
...
@@ -125,7 +138,7 @@ void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event )
...
@@ -125,7 +138,7 @@ void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event )
/*******************************************************/
/*******************************************************/
/* Prepare les structures de donn�es de gestion de l'impression
/* Prepare les structures de donn�es de gestion de l'impression
* et affiche la fenetre de dialogue de gestion de l'impression des feuilles
* et affiche la fenetre de dialogue de gestion de l'impression des feuilles
*/
*/
{
{
wxPoint
pos
=
GetPosition
();
wxPoint
pos
=
GetPosition
();
...
@@ -173,6 +186,10 @@ void WinEDA_PrintFrame::SetOthersDatas()
...
@@ -173,6 +186,10 @@ void WinEDA_PrintFrame::SetOthersDatas()
m_Print_Mirror
->
Enable
(
false
);
m_Print_Mirror
->
Enable
(
false
);
#endif
#endif
#if defined (PCBNEW)
wxConfig
*
config
=
m_Parent
->
m_Parent
->
m_EDA_Config
;
// Current config used by application
#endif
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
)
);
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
)
);
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
)
);
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
)
);
if
(
s_Print_Black_and_White
)
if
(
s_Print_Black_and_White
)
...
@@ -186,10 +203,10 @@ void WinEDA_PrintFrame::SetOthersDatas()
...
@@ -186,10 +203,10 @@ void WinEDA_PrintFrame::SetOthersDatas()
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
{
{
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
#if defined(PCBNEW)
#if defined
(PCBNEW)
((
WinEDA_PcbFrame
*
)
m_Parent
)
->
m_Pcb
->
GetLayerName
(
ii
)
);
(
(
WinEDA_PcbFrame
*
)
m_Parent
)
->
m_Pcb
->
GetLayerName
(
ii
)
);
#else
#else
ReturnLayerName
(
ii
)
);
ReturnLayerName
(
ii
)
);
#endif
#endif
if
(
mask
&
s_SelectedLayers
)
if
(
mask
&
s_SelectedLayers
)
...
@@ -203,11 +220,28 @@ void WinEDA_PrintFrame::SetOthersDatas()
...
@@ -203,11 +220,28 @@ void WinEDA_PrintFrame::SetOthersDatas()
}
}
// Read the scale adjust option
// Read the scale adjust option
if
(
m_Parent
->
m_Parent
->
m_EDA_C
onfig
)
if
(
c
onfig
)
{
{
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintXFineScaleAdj"
),
&
m_XScaleAdjust
);
config
->
Read
(
OPTKEY_PRINT_X_FINESCALE_ADJ
,
&
m_XScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintYFineScaleAdj"
),
&
m_YScaleAdjust
);
config
->
Read
(
OPTKEY_PRINT_Y_FINESCALE_ADJ
,
&
m_YScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintScale"
),
&
s_Scale_Select
);
config
->
Read
(
OPTKEY_PRINT_SCALE
,
&
s_Scale_Select
);
s_SelectedLayers
=
0
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
wxString
layerKey
;
bool
option
;
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
option
=
false
;
if
(
config
->
Read
(
layerKey
,
&
option
)
)
{
m_BoxSelecLayer
[
layer
]
->
SetValue
(
option
);
if
(
option
)
s_SelectedLayers
|=
1
<<
layer
;
}
}
}
}
m_ScaleOption
->
SetSelection
(
s_Scale_Select
);
m_ScaleOption
->
SetSelection
(
s_Scale_Select
);
...
@@ -287,9 +321,15 @@ void WinEDA_PrintFrame::OnClosePrintDialog()
...
@@ -287,9 +321,15 @@ void WinEDA_PrintFrame::OnClosePrintDialog()
#ifdef PCBNEW
#ifdef PCBNEW
if
(
Config
)
if
(
Config
)
{
{
Config
->
Write
(
wxT
(
"PrintXFineScaleAdj"
),
m_XScaleAdjust
);
Config
->
Write
(
OPTKEY_PRINT_X_FINESCALE_ADJ
,
m_XScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintYFineScaleAdj"
),
m_YScaleAdjust
);
Config
->
Write
(
OPTKEY_PRINT_Y_FINESCALE_ADJ
,
m_YScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintScale"
),
s_Scale_Select
);
Config
->
Write
(
OPTKEY_PRINT_SCALE
,
s_Scale_Select
);
wxString
layerKey
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
Config
->
Write
(
layerKey
,
m_BoxSelecLayer
[
layer
]
->
IsChecked
()
);
}
}
}
#endif
#endif
EndModal
(
0
);
EndModal
(
0
);
...
@@ -334,7 +374,7 @@ void WinEDA_PrintFrame::SetPenWidth()
...
@@ -334,7 +374,7 @@ void WinEDA_PrintFrame::SetPenWidth()
/****************************************/
/****************************************/
/* Get the new pen width value, and verify min et max value
/* Get the new pen width value, and verify min et max value
* NOTE: s_PrintPenMinWidth is in internal units
* NOTE: s_PrintPenMinWidth is in internal units
*/
*/
{
{
s_PrintPenMinWidth
=
m_DialogPenWidth
->
GetValue
();
s_PrintPenMinWidth
=
m_DialogPenWidth
->
GetValue
();
...
@@ -357,11 +397,11 @@ void WinEDA_PrintFrame::OnPrintSetup( wxCommandEvent& event )
...
@@ -357,11 +397,11 @@ void WinEDA_PrintFrame::OnPrintSetup( wxCommandEvent& event )
/* Open a dialog box for printer setup (printer options, page size ...)
/* Open a dialog box for printer setup (printer options, page size ...)
*/
*/
{
{
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
if
(
printDialogData
.
Ok
()
)
if
(
printDialogData
.
Ok
()
)
{
{
wxPrintDialog
printerDialog
(
this
,
&
printDialogData
);
wxPrintDialog
printerDialog
(
this
,
&
printDialogData
);
printerDialog
.
ShowModal
();
printerDialog
.
ShowModal
();
...
@@ -396,8 +436,8 @@ void WinEDA_PrintFrame::OnPrintPreview( wxCommandEvent& event )
...
@@ -396,8 +436,8 @@ void WinEDA_PrintFrame::OnPrintPreview( wxCommandEvent& event )
// Pass two printout objects: for preview, and possible printing.
// Pass two printout objects: for preview, and possible printing.
wxString
title
=
BuildPrintTitle
();
wxString
title
=
BuildPrintTitle
();
wxPrintPreview
*
preview
=
wxPrintPreview
*
preview
=
new
wxPrintPreview
(
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
new
wxPrintPreview
(
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
g_PrintData
);
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
g_PrintData
);
if
(
preview
==
NULL
)
if
(
preview
==
NULL
)
{
{
...
@@ -418,7 +458,7 @@ void WinEDA_PrintFrame::OnPrintPreview( wxCommandEvent& event )
...
@@ -418,7 +458,7 @@ void WinEDA_PrintFrame::OnPrintPreview( wxCommandEvent& event )
WSize
.
y
+=
6
;
WSize
.
y
+=
6
;
wxPreviewFrame
*
frame
=
new
wxPreviewFrame
(
preview
,
this
,
wxPreviewFrame
*
frame
=
new
wxPreviewFrame
(
preview
,
this
,
title
,
WPos
,
WSize
);
title
,
WPos
,
WSize
);
frame
->
Initialize
();
frame
->
Initialize
();
frame
->
Show
(
TRUE
);
frame
->
Show
(
TRUE
);
...
@@ -450,15 +490,15 @@ void WinEDA_PrintFrame::EDA_PrintPage( wxCommandEvent& event )
...
@@ -450,15 +490,15 @@ void WinEDA_PrintFrame::EDA_PrintPage( wxCommandEvent& event )
SetPenWidth
();
SetPenWidth
();
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrinter
printer
(
&
printDialogData
);
wxPrinter
printer
(
&
printDialogData
);
wxString
title
=
BuildPrintTitle
();
wxString
title
=
BuildPrintTitle
();
EDA_Printout
printout
(
this
,
m_Parent
,
title
,
print_ref
);
EDA_Printout
printout
(
this
,
m_Parent
,
title
,
print_ref
);
#ifndef __WINDOWS__
#ifndef __WINDOWS__
wxDC
*
dc
=
printout
.
GetDC
();
wxDC
*
dc
=
printout
.
GetDC
();
(
(
wxPostScriptDC
*
)
dc
)
->
SetResolution
(
600
);
// Postscript DC resolution is 600 ppi
(
(
wxPostScriptDC
*
)
dc
)
->
SetResolution
(
600
);
// Postscript DC resolution is 600 ppi
#endif
#endif
...
@@ -609,7 +649,7 @@ void EDA_Printout::DrawPage()
...
@@ -609,7 +649,7 @@ void EDA_Printout::DrawPage()
/********************************/
/********************************/
/*
/*
* This is the real print function: print the active screen
* This is the real print function: print the active screen
*/
*/
{
{
int
tmpzoom
;
int
tmpzoom
;
...
@@ -728,7 +768,7 @@ void EDA_Printout::DrawPage()
...
@@ -728,7 +768,7 @@ void EDA_Printout::DrawPage()
ftmp
*=
(
float
)
PlotAreaSize
.
x
/
PageSize_in_mm
.
x
;
/* ftmp is in pixels */
ftmp
*=
(
float
)
PlotAreaSize
.
x
/
PageSize_in_mm
.
x
;
/* ftmp is in pixels */
/* because the pen size will be scaled by the dc scale, we modify the size
/* because the pen size will be scaled by the dc scale, we modify the size
* in order to keep the requested value */
* in order to keep the requested value */
dc
->
GetUserScale
(
&
xdcscale
,
&
ydcscale
);
dc
->
GetUserScale
(
&
xdcscale
,
&
ydcscale
);
ftmp
/=
xdcscale
;
ftmp
/=
xdcscale
;
SetPenMinWidth
(
(
int
)
round
(
ftmp
)
);
SetPenMinWidth
(
(
int
)
round
(
ftmp
)
);
...
@@ -751,15 +791,13 @@ void EDA_Printout::DrawPage()
...
@@ -751,15 +791,13 @@ void EDA_Printout::DrawPage()
if
(
m_Print_Sheet_Ref
)
if
(
m_Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
dc
,
ActiveScreen
,
0
);
m_Parent
->
TraceWorkSheet
(
dc
,
ActiveScreen
,
0
);
if
(
userscale
==
1.0
)
// Draw the Sheet refs at optimum scale, and board at 1.0 scale
if
(
userscale
==
1.0
)
// Draw the Sheet refs at optimum scale, and board at 1.0 scale
{
{
m_Print_Sheet_Ref
=
FALSE
;
dc
->
SetUserScale
(
accurate_Yscale
,
accurate_Yscale
);
dc
->
SetUserScale
(
accurate_Yscale
,
accurate_Yscale
);
}
}
if
(
s_PrintMirror
)
if
(
s_PrintMirror
)
{
// To plot mirror, we revere the y axis, and modify the plot y origin
{
// To plot mirror, we rever
s
e the y axis, and modify the plot y origin
double
sx
,
sy
;
double
sx
,
sy
;
dc
->
GetUserScale
(
&
sx
,
&
sy
);
dc
->
GetUserScale
(
&
sx
,
&
sy
);
...
@@ -768,18 +806,18 @@ void EDA_Printout::DrawPage()
...
@@ -768,18 +806,18 @@ void EDA_Printout::DrawPage()
sy
/=
userscale
;
sy
/=
userscale
;
/* Plot offset y is moved by the y plot area size in order to have
/* Plot offset y is moved by the y plot area size in order to have
* the old draw area in the new draw area, because the draw origin has not moved
* the old draw area in the new draw area, because the draw origin has not moved
* (this is the upper left corner) but the Y axis is reversed, therefore the plotting area
* (this is the upper left corner) but the Y axis is reversed, therefore the plotting area
* is the y coordinate values from - PlotAreaSize.y to 0 */
* is the y coordinate values from - PlotAreaSize.y to 0 */
int
ysize
=
(
int
)
(
PlotAreaSize
.
y
/
sy
);
int
ysize
=
(
int
)
(
PlotAreaSize
.
y
/
sy
);
DrawOffset
.
y
+=
ysize
;
DrawOffset
.
y
+=
ysize
;
/* in order to keep the board position in the sheet
/* in order to keep the board position in the sheet
* (when user scale <= 1) the y offset in moved by the distance between
* (when user scale <= 1) the y offset in moved by the distance between
* the middle of the page and the middle of the board
* the middle of the page and the middle of the board
* This is equivalent to put the mirror axis to the board centre
* This is equivalent to put the mirror axis to the board centre
* for scales > 1, the DrawOffset was already computed to have the board centre
* for scales > 1, the DrawOffset was already computed to have the board centre
* to the middle of the page.
* to the middle of the page.
*/
*/
wxPoint
pcb_centre
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
();
wxPoint
pcb_centre
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
();
if
(
userscale
<=
1.0
)
if
(
userscale
<=
1.0
)
...
...
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