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
7bdcad15
Commit
7bdcad15
authored
May 30, 2012
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flip to pcbnew text fields.
parent
b3fd915f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
13 deletions
+49
-13
wxPcbStruct.h
include/wxPcbStruct.h
+1
-0
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+4
-1
edit.cpp
pcbnew/edit.cpp
+6
-0
edit_pcb_text.cpp
pcbnew/edit_pcb_text.cpp
+23
-3
hotkeys.cpp
pcbnew/hotkeys.cpp
+4
-4
hotkeys.h
pcbnew/hotkeys.h
+1
-1
hotkeys_board_editor.cpp
pcbnew/hotkeys_board_editor.cpp
+6
-3
onrightclick.cpp
pcbnew/onrightclick.cpp
+3
-1
pcbnew_id.h
pcbnew/pcbnew_id.h
+1
-0
No files found.
include/wxPcbStruct.h
View file @
7bdcad15
...
...
@@ -928,6 +928,7 @@ public:
// Handling texts on the board
void
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
FlipTextePcb
(
TEXTE_PCB
*
aTextePcb
,
wxDC
*
aDC
);
TEXTE_PCB
*
Create_Texte_Pcb
(
wxDC
*
DC
);
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
...
...
pcbnew/class_pcb_text.cpp
View file @
7bdcad15
...
...
@@ -161,7 +161,10 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre )
{
m_Pos
.
y
=
aCentre
.
y
-
(
m_Pos
.
y
-
aCentre
.
y
);
// NEGATE( m_Orient ); not needed: m_Mirror handles this
if
(
(
GetLayer
()
==
LAYER_N_BACK
)
||
(
GetLayer
()
==
LAYER_N_FRONT
)
)
if
(
GetLayer
()
==
LAYER_N_BACK
||
GetLayer
()
==
LAYER_N_FRONT
||
GetLayer
()
==
SILKSCREEN_N_BACK
||
GetLayer
()
==
SILKSCREEN_N_FRONT
)
{
m_Mirror
=
not
m_Mirror
;
/* inverse mirror */
}
...
...
pcbnew/edit.cpp
View file @
7bdcad15
...
...
@@ -81,6 +81,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_TOOLBARH_PCB_SELECT_LAYER
:
case
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR
:
case
ID_POPUP_PCB_ROTATE_TEXTEPCB
:
case
ID_POPUP_PCB_FLIP_TEXTEPCB
:
case
ID_POPUP_PCB_EDIT_TEXTEPCB
:
case
ID_POPUP_PCB_EDIT_MIRE
:
case
ID_POPUP_PCB_ROTATE_TEXTMODULE
:
...
...
@@ -930,6 +931,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas
->
MoveCursorToCrossHair
();
break
;
case
ID_POPUP_PCB_FLIP_TEXTEPCB
:
FlipTextePcb
(
(
TEXTE_PCB
*
)
GetCurItem
(),
&
dc
);
m_canvas
->
MoveCursorToCrossHair
();
break
;
case
ID_POPUP_PCB_DELETE_TEXTEPCB
:
Delete_Texte_Pcb
(
(
TEXTE_PCB
*
)
GetCurItem
(),
&
dc
);
m_canvas
->
MoveCursorToCrossHair
();
...
...
pcbnew/edit_pcb_text.cpp
View file @
7bdcad15
...
...
@@ -216,7 +216,6 @@ TEXTE_PCB* PCB_EDIT_FRAME::Create_Texte_Pcb( wxDC* DC )
void
PCB_EDIT_FRAME
::
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
)
{
int
angle
=
900
;
int
drawmode
=
GR_XOR
;
if
(
TextePcb
==
NULL
)
return
;
...
...
@@ -228,13 +227,34 @@ void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
NORMALIZE_ANGLE_POS
(
TextePcb
->
m_Orient
);
/* Redraw text in new position. */
TextePcb
->
Draw
(
m_canvas
,
DC
,
drawmode
);
TextePcb
->
Draw
(
m_canvas
,
DC
,
GR_XOR
);
TextePcb
->
DisplayInfo
(
this
);
if
(
TextePcb
->
GetFlags
()
==
0
)
// i.e. not edited, or moved
SaveCopyInUndoList
(
TextePcb
,
UR_ROTATED
,
TextePcb
->
m_Pos
);
SaveCopyInUndoList
(
TextePcb
,
UR_ROTATED
,
TextePcb
->
GetPosition
()
);
else
// set flag edit, to show it was a complex command
TextePcb
->
SetFlags
(
IN_EDIT
);
OnModify
();
}
void
PCB_EDIT_FRAME
::
FlipTextePcb
(
TEXTE_PCB
*
aTextePcb
,
wxDC
*
aDC
)
{
if
(
aTextePcb
==
NULL
)
return
;
aTextePcb
->
Draw
(
m_canvas
,
aDC
,
GR_XOR
);
aTextePcb
->
Flip
(
aTextePcb
->
GetPosition
()
);
aTextePcb
->
Draw
(
m_canvas
,
aDC
,
GR_XOR
);
aTextePcb
->
DisplayInfo
(
this
);
if
(
aTextePcb
->
GetFlags
()
==
0
)
// i.e. not edited, or moved
SaveCopyInUndoList
(
aTextePcb
,
UR_FLIPPED
,
aTextePcb
->
GetPosition
()
);
else
// set flag edit, to show it was a complex command
aTextePcb
->
SetFlags
(
IN_EDIT
);
OnModify
();
}
pcbnew/hotkeys.cpp
View file @
7bdcad15
...
...
@@ -67,7 +67,7 @@ static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' );
static
EDA_HOTKEY
HkAddMicroVia
(
wxT
(
"Add MicroVia"
),
HK_ADD_MICROVIA
,
'V'
+
GR_KB_CTRL
);
static
EDA_HOTKEY
HkEndTrack
(
wxT
(
"End Track"
),
HK_END_TRACK
,
WXK_END
);
static
EDA_HOTKEY
HkEditBoardItem
(
wxT
(
"Edit Item"
),
HK_EDIT_ITEM
,
'E'
);
static
EDA_HOTKEY
HkFlip
Footprint
(
wxT
(
"Flip Footprint"
),
HK_FLIP_FOOTPRINT
,
'F'
);
static
EDA_HOTKEY
HkFlip
Item
(
wxT
(
"Flip Item"
),
HK_FLIP_ITEM
,
'F'
);
static
EDA_HOTKEY
HkRotateItem
(
wxT
(
"Rotate Item"
),
HK_ROTATE_ITEM
,
'R'
);
static
EDA_HOTKEY
HkMoveItem
(
wxT
(
"Move Item"
),
HK_MOVE_ITEM
,
'M'
);
static
EDA_HOTKEY
HkDragFootprint
(
wxT
(
"Drag Footprint"
),
HK_DRAG_ITEM
,
'G'
);
...
...
@@ -78,7 +78,7 @@ static EDA_HOTKEY HkLock_Unlock_Footprint( wxT( "Lock/Unlock Footprint" ),
static
EDA_HOTKEY
HkDelete
(
wxT
(
"Delete Track or Footprint"
),
HK_DELETE
,
WXK_DELETE
);
static
EDA_HOTKEY
HkResetLocalCoord
(
wxT
(
"Reset Local Coordinates"
),
HK_RESET_LOCAL_COORD
,
' '
);
static
EDA_HOTKEY
HkSwitchHighContrastMode
(
wxT
(
"Switch Highcontrast mode"
),
static
EDA_HOTKEY
HkSwitchHighContrastMode
(
wxT
(
"Switch Highcontrast mode"
),
HK_SWITCH_HIGHCONTRAST_MODE
,
'H'
);
/* Fit on Screen */
#if !defined( __WXMAC__ )
...
...
@@ -210,8 +210,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] =
&
HkSwitchTrackPosture
,
&
HkDragTrackKeepSlope
,
&
HkPlaceItem
,
&
HkEndTrack
,
&
HkMoveItem
,
&
Hk
FlipFootprint
,
&
HkRotateItem
,
&
HkDragFootprint
,
&
HkEndTrack
,
&
HkMoveItem
,
&
HkFlipItem
,
&
Hk
RotateItem
,
&
HkDragFootprint
,
&
HkGetAndMoveFootprint
,
&
HkLock_Unlock_Footprint
,
&
HkSavefile
,
&
HkLoadfile
,
&
HkFindItem
,
&
HkEditBoardItem
,
&
HkSwitch2CopperLayer
,
&
HkSwitch2InnerLayer1
,
...
...
pcbnew/hotkeys.h
View file @
7bdcad15
...
...
@@ -14,9 +14,9 @@ enum hotkey_id_commnand {
HK_DELETE
=
HK_COMMON_END
,
HK_BACK_SPACE
,
HK_ROTATE_ITEM
,
HK_FLIP_ITEM
,
HK_MOVE_ITEM
,
HK_DRAG_ITEM
,
HK_FLIP_FOOTPRINT
,
HK_GET_AND_MOVE_FOOTPRINT
,
HK_LOCK_UNLOCK_FOOTPRINT
,
HK_ADD_NEW_TRACK
,
...
...
pcbnew/hotkeys_board_editor.cpp
View file @
7bdcad15
...
...
@@ -624,9 +624,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
OnHotkeyRotateItem
(
HK_ROTATE_ITEM
);
break
;
case
HK_FLIP_
FOOTPRINT
:
// move to other side
OnHotkeyRotateItem
(
HK_FLIP_
FOOTPRINT
);
case
HK_FLIP_
ITEM
:
OnHotkeyRotateItem
(
HK_FLIP_
ITEM
);
break
;
case
HK_SWITCH_HIGHCONTRAST_MODE
:
// switch to high contrast mode and refresh the canvas
DisplayOpt
.
ContrastModeDisplay
=
!
DisplayOpt
.
ContrastModeDisplay
;
m_canvas
->
Refresh
();
...
...
@@ -1002,7 +1003,7 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
if
(
aIdCommand
==
HK_ROTATE_ITEM
)
// Rotation
evt_type
=
ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE
;
if
(
aIdCommand
==
HK_FLIP_
FOOTPRINT
)
// move to other side
if
(
aIdCommand
==
HK_FLIP_
ITEM
)
// move to other side
evt_type
=
ID_POPUP_PCB_CHANGE_SIDE_MODULE
;
}
break
;
...
...
@@ -1010,6 +1011,8 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
case
PCB_TEXT_T
:
if
(
aIdCommand
==
HK_ROTATE_ITEM
)
// Rotation
evt_type
=
ID_POPUP_PCB_ROTATE_TEXTEPCB
;
else
if
(
aIdCommand
==
HK_FLIP_ITEM
)
evt_type
=
ID_POPUP_PCB_FLIP_TEXTEPCB
;
break
;
...
...
pcbnew/onrightclick.cpp
View file @
7bdcad15
...
...
@@ -685,7 +685,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
msg
,
KiBitmap
(
rotate_module_pos_xpm
)
);
AddMenuItem
(
sub_menu_footprint
,
ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE
,
_
(
"Rotate -"
),
KiBitmap
(
rotate_module_neg_xpm
)
);
msg
=
AddHotkeyName
(
_
(
"Flip"
),
g_Board_Editor_Hokeys_Descr
,
HK_FLIP_
FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Flip"
),
g_Board_Editor_Hokeys_Descr
,
HK_FLIP_
ITEM
);
AddMenuItem
(
sub_menu_footprint
,
ID_POPUP_PCB_CHANGE_SIDE_MODULE
,
msg
,
KiBitmap
(
invert_module_xpm
)
);
...
...
@@ -839,6 +839,8 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
msg
=
AddHotkeyName
(
_
(
"Rotate"
),
g_Board_Editor_Hokeys_Descr
,
HK_ROTATE_ITEM
);
AddMenuItem
(
sub_menu_Text
,
ID_POPUP_PCB_ROTATE_TEXTEPCB
,
msg
,
KiBitmap
(
rotate_ccw_xpm
)
);
msg
=
AddHotkeyName
(
_
(
"Flip"
),
g_Board_Editor_Hokeys_Descr
,
HK_FLIP_ITEM
);
AddMenuItem
(
sub_menu_Text
,
ID_POPUP_PCB_FLIP_TEXTEPCB
,
msg
,
KiBitmap
(
invert_module_xpm
)
);
msg
=
AddHotkeyName
(
_
(
"Edit"
),
g_Board_Editor_Hokeys_Descr
,
HK_EDIT_ITEM
);
AddMenuItem
(
sub_menu_Text
,
ID_POPUP_PCB_EDIT_TEXTEPCB
,
msg
,
KiBitmap
(
edit_text_xpm
)
);
AddMenuItem
(
sub_menu_Text
,
ID_POPUP_PCB_RESET_TEXT_SIZE
,
...
...
pcbnew/pcbnew_id.h
View file @
7bdcad15
...
...
@@ -66,6 +66,7 @@ enum pcbnew_ids
ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST
,
ID_POPUP_PCB_ROTATE_TEXTEPCB
,
ID_POPUP_PCB_FLIP_TEXTEPCB
,
ID_POPUP_PCB_EDIT_TEXTEPCB
,
ID_POPUP_PCB_DELETE_TEXTEPCB
,
...
...
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