Commit 527de3e5 authored by jean-pierre charras's avatar jean-pierre charras

Minor enhancements, and minor code cleanup. Eeschema: added hotkey J to place junctions

parents a6a75605 355fc48e
...@@ -24,6 +24,34 @@ ...@@ -24,6 +24,34 @@
#include "bitmaps.h" #include "bitmaps.h"
// -----------------
// helper function (from wxWidgets, opengl/cube.cpp sample
// -----------------
void CheckGLError()
{
GLenum errLast = GL_NO_ERROR;
for ( ;; )
{
GLenum err = glGetError();
if ( err == GL_NO_ERROR )
return;
// normally the error is reset by the call to glGetError() but if
// glGetError() itself returns an error, we risk looping forever here
// so check that we get a different error than the last time
if ( err == errLast )
{
wxLogError(wxT("OpenGL error state couldn't be reset."));
return;
}
errLast = err;
wxLogError(wxT("OpenGL error %d"), err);
}
}
/* /*
* Pcb3D_GLCanvas implementation * Pcb3D_GLCanvas implementation
*/ */
...@@ -538,6 +566,8 @@ void Pcb3D_GLCanvas::InitGL() ...@@ -538,6 +566,8 @@ void Pcb3D_GLCanvas::InitGL()
// Setup light souces: // Setup light souces:
SetLights(); SetLights();
CheckGLError();
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif #endif
extern void CheckGLError();
static void Draw3D_FilledCircle( double posx, double posy, double rayon, static void Draw3D_FilledCircle( double posx, double posy, double rayon,
double hole_rayon, double zpos ); double hole_rayon, double zpos );
static void Draw3D_FilledSegment( double startx, double starty, static void Draw3D_FilledSegment( double startx, double starty,
...@@ -348,9 +350,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -348,9 +350,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glEndList(); glEndList();
/* Test for errors */ /* Test for errors */
GLenum err = glGetError(); CheckGLError();
if( err != GL_NO_ERROR )
DisplayError( this, wxT( "Error in GL commands" ) );
return m_gllist; return m_gllist;
} }
...@@ -786,8 +787,6 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -786,8 +787,6 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
delta_cx, delta_cy, delta_cx, delta_cy,
xc, yc; xc, yc;
int angle, delta_angle; int angle, delta_angle;
int coord[4][2];
double fcoord[8][2], f_hole_coord[8][2];
double scale; double scale;
double zpos; double zpos;
wxPoint shape_pos; wxPoint shape_pos;
...@@ -917,33 +916,18 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -917,33 +916,18 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
break; break;
case PAD_RECT: case PAD_RECT:
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
{ {
int ddx, ddy; wxPoint coord[5];
ddx = m_DeltaSize.x >> 1; wxRealPoint fcoord[8], f_hole_coord[8];
ddy = m_DeltaSize.y >> 1; BuildPadPolygon( coord, wxSize(0,0), angle );
coord[0][0] = -dx - ddy;
coord[0][1] = +dy + ddx;
coord[1][0] = -dx + ddy;
coord[1][1] = -dy - ddx;
coord[2][0] = +dx - ddy;
coord[2][1] = -dy + ddx;
coord[3][0] = +dx + ddy;
coord[3][1] = +dy - ddx;
for( ii = 0; ii < 4; ii++ ) for( ii = 0; ii < 4; ii++ )
{ {
RotatePoint( &coord[ii][0], &coord[ii][1], angle ); coord[ii].x += ux0;
coord[ii][0] += ux0; coord[ii].y += uy0;
coord[ii][1] += uy0;
ll = ii * 2; ll = ii * 2;
fcoord[ll][0] = coord[ii][0] *scale; fcoord[ll].x = coord[ii].x *scale;
fcoord[ll][1] = coord[ii][1] *scale; fcoord[ll].y = coord[ii].y *scale;
} }
for( ii = 0; ii < 7; ii += 2 ) for( ii = 0; ii < 7; ii += 2 )
...@@ -951,18 +935,17 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -951,18 +935,17 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
ll = ii + 2; ll = ii + 2;
if( ll > 7 ) if( ll > 7 )
ll -= 8; ll -= 8;
fcoord[ii + 1][0] = (fcoord[ii][0] + fcoord[ll][0]) / 2; fcoord[ii + 1].x = (fcoord[ii].x + fcoord[ll].x) / 2;
fcoord[ii + 1][1] = (fcoord[ii][1] + fcoord[ll][1]) / 2; fcoord[ii + 1].y = (fcoord[ii].y + fcoord[ll].y) / 2;
} }
for( ii = 0; ii < 8; ii++ ) for( ii = 0; ii < 8; ii++ )
{ {
f_hole_coord[ii][0] = -hole * 0.707; f_hole_coord[ii].x = -hole * 0.707;
f_hole_coord[ii][1] = hole * 0.707; f_hole_coord[ii].y = hole * 0.707;
RotatePoint( &f_hole_coord[ii][0], &f_hole_coord[ii][1], RotatePoint( &f_hole_coord[ii].x, &f_hole_coord[ii].y, angle - (ii * 450) );
angle - (ii * 450) ); f_hole_coord[ii].x += drillx;
f_hole_coord[ii][0] += drillx; f_hole_coord[ii].y += drilly;
f_hole_coord[ii][1] += drilly;
} }
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
...@@ -991,12 +974,12 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -991,12 +974,12 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
glBegin( GL_QUAD_STRIP ); glBegin( GL_QUAD_STRIP );
for( ii = 0; ii < 8; ii++ ) for( ii = 0; ii < 8; ii++ )
{ {
glVertex3f( f_hole_coord[ii][0], -f_hole_coord[ii][1], zpos ); glVertex3f( f_hole_coord[ii].x, -f_hole_coord[ii].y, zpos );
glVertex3f( fcoord[ii][0], -fcoord[ii][1], zpos ); glVertex3f( fcoord[ii].x, -fcoord[ii].y, zpos );
} }
glVertex3f( f_hole_coord[0][0], -f_hole_coord[0][1], zpos ); glVertex3f( f_hole_coord[0].x, -f_hole_coord[0].y, zpos );
glVertex3f( fcoord[0][0], -fcoord[0][1], zpos ); glVertex3f( fcoord[0].x, -fcoord[0].y, zpos );
glEnd(); glEnd();
} }
} }
......
...@@ -161,6 +161,7 @@ set(BITMAP_SRCS ...@@ -161,6 +161,7 @@ set(BITMAP_SRCS
icon_pcbnew.xpm icon_pcbnew.xpm
icon_txt.xpm icon_txt.xpm
import3d.xpm import3d.xpm
import_cmp_from_lib.xpm
import_hierarchical_label.xpm import_hierarchical_label.xpm
Import_Module.xpm Import_Module.xpm
import.xpm import.xpm
......
/* XPM */
const char *import_cmp_from_lib_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
"O c #76787C",
"$ c #979A9C",
"= c #404440",
"; c #ACB1B5",
"# c #04BA04",
"+ c #CACCCC",
"o c #F5F6F7",
". c #2E3031",
" c None",
"* c #124912",
"@ c #049304",
"& c #505355",
"X c #0C290C",
"% c #046404",
"- c #DADBDB",
": c #83888C",
/* pixels */
" .X ",
" ooO ",
" +o++. ",
" @#X$++.$ ",
" %#@X$+X.& ",
" *##@%%%%=&.=.. ",
" OX######%Oooo-.",
" $&*@@##%Ooo-; ",
" :;+:&%@&ooo+: ",
" O;+$*=-oo-;X ",
" =:$+.oooo+O ",
" &O-+oooo; ",
" X&++--o+: ",
" .=O$$$ ",
" .XX ",
" "
};
...@@ -633,37 +633,43 @@ void WinEDA_DrawFrame::UpdateStatusBar() ...@@ -633,37 +633,43 @@ void WinEDA_DrawFrame::UpdateStatusBar()
} }
/* The following sadly is an if eeschema/if pcbnew */ /* The following sadly is an if eeschema/if pcbnew */
wxString formatter; wxString absformatter;
wxString locformatter;
switch( g_UserUnit ) switch( g_UserUnit )
{ {
case INCHES: case INCHES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
{ {
formatter = wxT( "X %.3f Y %.3f" ); absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f" );
} }
else else
{ {
formatter = wxT( "X %.4f Y %.4f" ); absformatter = wxT( "X %.4f Y %.4f" );
locformatter = wxT( "dx %.4f dy %.4f" );
} }
break; break;
case MILLIMETRES: case MILLIMETRES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
{ {
formatter = wxT( "X %.2f Y %.2f" ); absformatter = wxT( "X %.2f Y %.2f" );
locformatter = wxT( "dx %.2f dy %.2f" );
} }
else else
{ {
formatter = wxT( "X %.3f Y %.3f" ); absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f" );
} }
break; break;
case UNSCALED_UNITS: case UNSCALED_UNITS:
formatter = wxT( "X %f Y %f" ); absformatter = wxT( "X %f Y %f" );
locformatter = wxT( "dx %f dy %f" );
break; break;
} }
Line.Printf( formatter, dXpos, dYpos ); Line.Printf( absformatter, dXpos, dYpos );
SetStatusText( Line, 2 ); SetStatusText( Line, 2 );
/* Display relative coordinates: */ /* Display relative coordinates: */
...@@ -678,7 +684,7 @@ void WinEDA_DrawFrame::UpdateStatusBar() ...@@ -678,7 +684,7 @@ void WinEDA_DrawFrame::UpdateStatusBar()
} }
/* We already decided the formatter above */ /* We already decided the formatter above */
Line.Printf( formatter, dXpos, dYpos ); Line.Printf( locformatter, dXpos, dYpos );
SetStatusText( Line, 3 ); SetStatusText( Line, 3 );
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* s_LibEdit_Hotkey_List list or s_Common_Hotkey_List if the same command is * s_LibEdit_Hotkey_List list or s_Common_Hotkey_List if the same command is
* added both in eeschema and libedit) * added both in eeschema and libedit)
* Add the new code in the switch in OnHotKey() function. * Add the new code in the switch in OnHotKey() function.
* when the variable ItemInEdit is true, an item is currently edited. * when the variable itemInEdit is true, an item is currently edited.
* This can be useful if the new function cannot be executed while an item is * This can be useful if the new function cannot be executed while an item is
* currently being edited * currently being edited
* ( For example, one cannot start a new wire when a component is moving.) * ( For example, one cannot start a new wire when a component is moving.)
...@@ -100,6 +100,7 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + ...@@ -100,6 +100,7 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL +
// Schematic editor // Schematic editor
static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' ); static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' );
static Ki_HotkeyInfo HkAddJunction( wxT( "add Junction" ), HK_ADD_JUNCTION, 'J' );
static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' ); static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ),
HK_ADD_NEW_COMPONENT, 'A' ); HK_ADD_NEW_COMPONENT, 'A' );
...@@ -180,6 +181,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = ...@@ -180,6 +181,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] =
&HkEditComponentFootprint, &HkEditComponentFootprint,
&HkBeginWire, &HkBeginWire,
&HkAddLabel, &HkAddLabel,
&HkAddJunction,
&HkAddNoConn, &HkAddNoConn,
NULL NULL
}; };
...@@ -244,9 +246,13 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -244,9 +246,13 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
cmd.SetEventObject( this ); cmd.SetEventObject( this );
bool ItemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags;
bool RefreshToolBar = FALSE;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
// itemInEdit == false means no item currently edited. We can ask for editing a new item
bool itemInEdit = screen->GetCurItem() && screen->GetCurItem()->m_Flags;
// notBusy == true means no item currently edited and no other command in progress
// We can change active tool and ask for editing a new item
bool notBusy = (!itemInEdit) && (screen->m_BlockLocate.m_State == STATE_NO_BLOCK);
bool RefreshToolBar = FALSE;
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
...@@ -306,7 +312,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -306,7 +312,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_UNDO: case HK_UNDO:
case HK_REDO: case HK_REDO:
if( !ItemInEdit ) if( notBusy )
{ {
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent ); wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event ); wxPostEvent( this, event );
...@@ -318,7 +324,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -318,7 +324,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_DELETE: case HK_DELETE:
if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( notBusy)
{ {
RefreshToolBar = LocateAndDeleteItem( this, DC ); RefreshToolBar = LocateAndDeleteItem( this, DC );
OnModify(); OnModify();
...@@ -328,12 +334,12 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -328,12 +334,12 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_REPEAT_LAST: case HK_REPEAT_LAST:
if( !ItemInEdit && g_ItemToRepeat && ( g_ItemToRepeat->m_Flags == 0 ) ) if( notBusy && g_ItemToRepeat && ( g_ItemToRepeat->m_Flags == 0 ) )
RepeatDrawItem( DC ); RepeatDrawItem( DC );
break; break;
case HK_FIND_ITEM: case HK_FIND_ITEM:
if( !ItemInEdit ) if( notBusy )
{ {
wxCommandEvent evt; wxCommandEvent evt;
evt.SetId( ID_FIND_ITEMS ); evt.SetId( ID_FIND_ITEMS );
...@@ -342,7 +348,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -342,7 +348,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_FIND_NEXT_ITEM: case HK_FIND_NEXT_ITEM:
if( !ItemInEdit ) if( notBusy )
{ {
wxFindDialogEvent event( wxEVT_COMMAND_FIND, GetId() ); wxFindDialogEvent event( wxEVT_COMMAND_FIND, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
...@@ -353,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -353,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_FIND_NEXT_DRC_MARKER: case HK_FIND_NEXT_DRC_MARKER:
if( !ItemInEdit ) if( notBusy )
{ {
wxFindDialogEvent event( EVT_COMMAND_FIND_DRC_MARKER, GetId() ); wxFindDialogEvent event( EVT_COMMAND_FIND_DRC_MARKER, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
...@@ -364,7 +370,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -364,7 +370,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_NEW_COMPONENT: // Add component case HK_ADD_NEW_COMPONENT: // Add component
if( !ItemInEdit ) if( !itemInEdit )
{ {
// switch to m_ID_current_state = ID_COMPONENT_BUTT; // switch to m_ID_current_state = ID_COMPONENT_BUTT;
if( m_ID_current_state != ID_COMPONENT_BUTT ) if( m_ID_current_state != ID_COMPONENT_BUTT )
...@@ -374,7 +380,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -374,7 +380,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_LABEL: case HK_ADD_LABEL:
if( !ItemInEdit ) if( notBusy )
{ {
// switch to m_ID_current_state = ID_LABEL_BUTT; // switch to m_ID_current_state = ID_LABEL_BUTT;
if( m_ID_current_state != ID_LABEL_BUTT ) if( m_ID_current_state != ID_LABEL_BUTT )
...@@ -383,11 +389,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -383,11 +389,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
break; break;
case HK_BEGIN_WIRE: case HK_ADD_JUNCTION:
if( notBusy )
{
// switch to m_ID_current_state = ID_JUNCTION_BUTT;
if( m_ID_current_state != ID_JUNCTION_BUTT )
SetToolID( ID_JUNCTION_BUTT, wxCURSOR_PENCIL, _( "Add Junction" ) );
OnLeftClick( DC, MousePos );
}
break;
/* An item is selected. If edited and not a wire, a new command is not case HK_BEGIN_WIRE:
* possible */ // An item is selected. If not a wire, a new command is not possible
if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( notBusy )
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
{ {
...@@ -409,7 +423,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -409,7 +423,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_ADD_NOCONN_FLAG: // Add a no connected flag case HK_ADD_NOCONN_FLAG: // Add a no connected flag
if( !ItemInEdit ) if( notBusy )
{ {
if( m_ID_current_state != ID_NOCONN_BUTT ) if( m_ID_current_state != ID_NOCONN_BUTT )
SetToolID( ID_NOCONN_BUTT, wxCURSOR_PENCIL, _( "Add \"NoNonnect\" Flags" ) ); SetToolID( ID_NOCONN_BUTT, wxCURSOR_PENCIL, _( "Add \"NoNonnect\" Flags" ) );
...@@ -532,7 +546,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -532,7 +546,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_DRAG: // Start drag case HK_DRAG: // Start drag
case HK_MOVE_COMPONENT_OR_ITEM: // Start move component or other schematic item case HK_MOVE_COMPONENT_OR_ITEM: // Start move component or other schematic item
case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
...@@ -627,7 +641,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -627,7 +641,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_EDIT: case HK_EDIT:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
{ {
...@@ -671,7 +685,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -671,7 +685,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_EDIT_COMPONENT_VALUE: case HK_EDIT_COMPONENT_VALUE:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
...@@ -682,7 +696,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -682,7 +696,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_EDIT_COMPONENT_FOOTPRINT: case HK_EDIT_COMPONENT_FOOTPRINT:
if( ItemInEdit ) if( itemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
...@@ -711,7 +725,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt ...@@ -711,7 +725,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
cmd.SetEventObject( this ); cmd.SetEventObject( this );
wxPoint MousePos = GetScreen()->m_MousePosition; wxPoint MousePos = GetScreen()->m_MousePosition;
bool ItemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags; bool itemInEdit = GetScreen()->GetCurItem()&& GetScreen()->GetCurItem()->m_Flags;
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
...@@ -767,7 +781,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt ...@@ -767,7 +781,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
break; break;
case HK_UNDO: case HK_UNDO:
if( !ItemInEdit ) if( !itemInEdit )
{ {
toolCmd.SetId( wxID_UNDO ); toolCmd.SetId( wxID_UNDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );
...@@ -775,7 +789,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt ...@@ -775,7 +789,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawSt
break; break;
case HK_REDO: case HK_REDO:
if( !ItemInEdit ) if( !itemInEdit )
{ {
toolCmd.SetId( wxID_REDO ); toolCmd.SetId( wxID_REDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );
......
...@@ -32,6 +32,7 @@ enum hotkey_id_commnand { ...@@ -32,6 +32,7 @@ enum hotkey_id_commnand {
HK_ADD_NEW_COMPONENT, HK_ADD_NEW_COMPONENT,
HK_BEGIN_WIRE, HK_BEGIN_WIRE,
HK_ADD_LABEL, HK_ADD_LABEL,
HK_ADD_JUNCTION,
HK_ADD_NOCONN_FLAG HK_ADD_NOCONN_FLAG
}; };
......
...@@ -113,11 +113,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar() ...@@ -113,11 +113,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString,
wxBitmap( new_component_xpm ), wxBitmap( new_component_xpm ),
_( "New component" ) ); _( "Create a new component" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString,
wxBitmap( add_component_xpm ), wxBitmap( import_cmp_from_lib_xpm ),
_( "Select component to edit" ) ); _( "Load component to edit from the current lib" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString,
wxBitmap( save_part_in_mem_xpm ), wxBitmap( save_part_in_mem_xpm ),
......
...@@ -152,6 +152,7 @@ extern const char* icon_gerbview_xpm[]; ...@@ -152,6 +152,7 @@ extern const char* icon_gerbview_xpm[];
extern const char* icon_modedit_xpm[]; extern const char* icon_modedit_xpm[];
extern const char* icon_txt_xpm[]; extern const char* icon_txt_xpm[];
extern const char* icon_w3d_xpm[]; extern const char* icon_w3d_xpm[];
extern const char* import_cmp_from_lib_xpm[];
extern const char* import_hierarchical_label_xpm[]; extern const char* import_hierarchical_label_xpm[];
extern const char* import_module_xpm[]; extern const char* import_module_xpm[];
extern const char* import_xpm[]; extern const char* import_xpm[];
......
...@@ -400,7 +400,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -400,7 +400,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
text = AddHotkeyName( _( "Module" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Module" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_MODULE ); HK_ADD_MODULE );
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text, item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text,
_( "Place a module" ), wxITEM_NORMAL ); _( "Add modules" ), wxITEM_NORMAL );
item->SetBitmap( module_xpm ); item->SetBitmap( module_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
...@@ -409,7 +409,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -409,7 +409,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
text = AddHotkeyName( _( "Track" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Track" ), s_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK ); HK_ADD_NEW_TRACK );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text, item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Place a track" ), wxITEM_NORMAL ); _( "Add tracks and vias" ), wxITEM_NORMAL );
item->SetBitmap( add_tracks_xpm ); item->SetBitmap( add_tracks_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
...@@ -417,14 +417,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -417,14 +417,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Zone */ /* Zone */
item = new wxMenuItem( placeMenu, ID_PCB_ZONES_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_ZONES_BUTT,
_( "Zone" ), _( "Zone" ),
_( "Place a filled zone" )); _( "Add filled zones on copper layers or technical layers" ));
item->SetBitmap( add_zone_xpm ); item->SetBitmap( add_zone_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Text */ /* Text */
item = new wxMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT,
_( "Text" ), _( "Text" ),
_( "Place text" ) ); _( "Add text on copper layers or graphic text" ) );
item->SetBitmap( add_text_xpm ); item->SetBitmap( add_text_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
...@@ -434,28 +434,28 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -434,28 +434,28 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Graphic Arc */ /* Graphic Arc */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_ARC_BUTT, item = new wxMenuItem( graphicsSubMenu, ID_PCB_ARC_BUTT,
_( "Arc" ), _( "Arc" ),
_( "Place a graphic arc" ) ); _( "Add graphic arc" ) );
item->SetBitmap( add_arc_xpm ); item->SetBitmap( add_arc_xpm );
graphicsSubMenu->Append( item ); graphicsSubMenu->Append( item );
/* Graphic Circle */ /* Graphic Circle */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_CIRCLE_BUTT, item = new wxMenuItem( graphicsSubMenu, ID_PCB_CIRCLE_BUTT,
_( "Circle" ), _( "Circle" ),
_( "Place a graphic circle" )); _( "Add graphic circle" ));
item->SetBitmap( add_circle_xpm ); item->SetBitmap( add_circle_xpm );
graphicsSubMenu->Append( item ); graphicsSubMenu->Append( item );
/* Dimension */ /* Dimension */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_DIMENSION_BUTT, item = new wxMenuItem( graphicsSubMenu, ID_PCB_DIMENSION_BUTT,
_( "Dimension" ), _( "Dimension" ),
_( "Place a dimension" ) ); _( "Add dimension" ) );
item->SetBitmap( add_dimension_xpm ); item->SetBitmap( add_dimension_xpm );
graphicsSubMenu->Append( item ); graphicsSubMenu->Append( item );
/* Line or Polygon */ /* Line or Polygon */
item = new wxMenuItem( graphicsSubMenu, ID_PCB_ADD_LINE_BUTT, item = new wxMenuItem( graphicsSubMenu, ID_PCB_ADD_LINE_BUTT,
_( "Line or Polygon" ), _( "Line or Polygon" ),
_( "Place a graphic line or polygon" )); _( "Add graphic line or polygon" ));
item->SetBitmap( add_dashed_line_xpm ); item->SetBitmap( add_dashed_line_xpm );
graphicsSubMenu->Append( item ); graphicsSubMenu->Append( item );
...@@ -467,15 +467,15 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -467,15 +467,15 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Layer alignment target */ /* Layer alignment target */
item = new wxMenuItem( placeMenu, ID_PCB_MIRE_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_MIRE_BUTT,
_( "Layer alignment target" ), _( "Layer Alignment Target" ),
_( "Place a layer alignment target" )); _( "Add layer alignment target" ));
item->SetBitmap( add_mires_xpm ); item->SetBitmap( add_mires_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
/* Drill & Place Offset */ /* Drill & Place Offset */
item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT,
_( "Drill and Place Offset" ), _( "Drill and Place Origin" ),
_( "Place the offset adjust for drill and place files" )); _( "Place the origin point for drill and place files" ));
item->SetBitmap( pcb_offset_xpm ); item->SetBitmap( pcb_offset_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
......
...@@ -434,7 +434,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -434,7 +434,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString,
wxBitmap( add_zone_xpm ), wxBitmap( add_zone_xpm ),
_( "Add zones" ), wxITEM_CHECK ); _( "Add filled zones" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString,
...@@ -451,7 +451,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -451,7 +451,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString,
wxBitmap( add_text_xpm ), wxBitmap( add_text_xpm ),
_( "Add text" ), wxITEM_CHECK ); _( "Add text on copper layers or graphic text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString,
...@@ -470,7 +470,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -470,7 +470,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString,
wxBitmap( pcb_offset_xpm ), wxBitmap( pcb_offset_xpm ),
_( "Offset adjust for drill and place files" ), _( "Place the origin point for drill and place files" ),
wxITEM_CHECK ); wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment