Commit 336d1b23 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix Bug #1211468

Pl_Editor: fix copyright in files. Enhancement when creating new items.
parent 31461a9b
...@@ -19,15 +19,17 @@ class WS_DRAW_ITEM_TEXT; // Forward declaration ...@@ -19,15 +19,17 @@ class WS_DRAW_ITEM_TEXT; // Forward declaration
#define USE_ITALIC (1<<1) // has meaning for texts #define USE_ITALIC (1<<1) // has meaning for texts
#define USE_ALT_COLOR (1<<2) #define USE_ALT_COLOR (1<<2)
#define SELECTED_STATE (1<<3) // When set, use the hight light color to draw item #define SELECTED_STATE (1<<3) // When set, use the hight light color to draw item
#define LOCATE_STARTPOINT (1<<4) // Used in locate function:set by locate function #define NEW_ITEM (1<<4) // Set for new items which can be deleted
// by an abort command
#define LOCATE_STARTPOINT (1<<5) // Used in locate function:set by locate function
// if the start point is located // if the start point is located
#define LOCATE_ENDPOINT (1<<5) // Used in locate function:set by locate function #define LOCATE_ENDPOINT (1<<6) // Used in locate function:set by locate function
// if the end point is located // if the end point is located
#define PAGE1OPTION (3<<6) // flag to manage items drawn or not drawn only #define PAGE1OPTION (3<<7) // flag to manage items drawn or not drawn only
// on page 1: NONE = item on all pages // on page 1: NONE = item on all pages
#define PAGE1OPTION_NONE (0<<6) // NONE = item on all pages #define PAGE1OPTION_NONE (0<<7) // NONE = item on all pages
#define PAGE1OPTION_PAGE1ONLY (1<<6) // = item only on page 1 #define PAGE1OPTION_PAGE1ONLY (1<<7) // = item only on page 1
#define PAGE1OPTION_NOTONPAGE1 (2<<6) // = item on all pages but page 1 #define PAGE1OPTION_NOTONPAGE1 (2<<7) // = item on all pages but page 1
// A coordinate is relative to a page corner. // A coordinate is relative to a page corner.
// Any of the 4 corners can be a reference. // Any of the 4 corners can be a reference.
......
/** /**
* @file class_gbr_layout.cpp * @file class_pl_editor_layout.cpp
* @brief PL_EDITOR_LAYOUT class functions. * @brief PL_EDITOR_LAYOUT class functions.
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <limits.h> #include <limits.h>
#include <algorithm> #include <algorithm>
......
/** /**
* @file class_pl_editor_layout.h * @file class_pl_editor_layout.h
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef CLASS_PL_EDITOR_LAYOUT_H #ifndef CLASS_PL_EDITOR_LAYOUT_H
#define CLASS_PL_EDITOR_LAYOUT_H #define CLASS_PL_EDITOR_LAYOUT_H
......
/** /**
* @file class_pl_editor_screen.cpp * @file class_pl_editor_screen.cpp
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
......
/** /**
* @file class_pl_editor_layout.h * @file class_pl_editor_screen.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef CLASS_PL_EDITOR_SCREEN_H_ #ifndef CLASS_PL_EDITOR_SCREEN_H_
......
/**
* @file pagelayout_editor/controle.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013-2013 Jean-Pierre Charras jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 2013-2013 KiCad Developers, see change_log.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +26,6 @@ ...@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file pagelayout_editor/controle.cpp
*/
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
......
/**
* @file design_tree_frame.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +26,6 @@ ...@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file design_tree_frame.cpp
*/
#include <wx/imaglist.h> #include <wx/imaglist.h>
#include <wx/wupdlock.h> #include <wx/wupdlock.h>
#include <fctsys.h> #include <fctsys.h>
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
/**
* @file dialog_new_dataitem.cpp
* @brief a dialog called on creating a new plage layout data item.
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,11 +27,6 @@ ...@@ -22,11 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file dialog_new_dataitem.cpp
* @brief a dialog called on creating a new plage layout data item.
*/
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
......
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
* @file dialogs_for_printing.cpp * @file dialogs_for_printing.cpp
*/ */
/* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr /*
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
...@@ -2,6 +2,29 @@ ...@@ -2,6 +2,29 @@
* @file pagelayout_editor/events_called_functions.cpp * @file pagelayout_editor/events_called_functions.cpp
* @brief page layout editor command event functions. * @brief page layout editor command event functions.
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <wx/treectrl.h> #include <wx/treectrl.h>
...@@ -38,7 +61,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) ...@@ -38,7 +61,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_MENU( wxID_SAVEAS, PL_EDITOR_FRAME::Files_io ) EVT_MENU( wxID_SAVEAS, PL_EDITOR_FRAME::Files_io )
EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io ) EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
EVT_MENU( ID_LOAD_DEFAULT_PAGE_LAYOUT, PL_EDITOR_FRAME::Files_io ) EVT_MENU( ID_LOAD_DEFAULT_PAGE_LAYOUT, PL_EDITOR_FRAME::Files_io )
EVT_MENU( ID_OPEN_POLYGON_DESCR_FILE, PL_EDITOR_FRAME::Files_io ) EVT_MENU( ID_APPEND_DESCR_FILE, PL_EDITOR_FRAME::Files_io )
EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter ) EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter )
...@@ -67,7 +90,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) ...@@ -67,7 +90,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( wxID_PREVIEW, PL_EDITOR_FRAME::ToPrinter ) EVT_TOOL( wxID_PREVIEW, PL_EDITOR_FRAME::ToPrinter )
EVT_TOOL( ID_SHEET_SET, PL_EDITOR_FRAME::Process_Special_Functions ) EVT_TOOL( ID_SHEET_SET, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode ) EVT_TOOL( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode )
EVT_TOOL( ID_SHOW_LPEDITOR_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode ) EVT_TOOL( ID_SHOW_PL_EDITOR_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode )
EVT_CHOICE( ID_SELECT_COORDINATE_ORIGIN, PL_EDITOR_FRAME::OnSelectCoordOriginCorner) EVT_CHOICE( ID_SELECT_COORDINATE_ORIGIN, PL_EDITOR_FRAME::OnSelectCoordOriginCorner)
EVT_CHOICE( ID_SELECT_PAGE_NUMBER, PL_EDITOR_FRAME::Process_Special_Functions) EVT_CHOICE( ID_SELECT_PAGE_NUMBER, PL_EDITOR_FRAME::Process_Special_Functions)
...@@ -78,7 +101,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) ...@@ -78,7 +101,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
PL_EDITOR_FRAME::Process_Special_Functions ) PL_EDITOR_FRAME::Process_Special_Functions )
EVT_UPDATE_UI( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode ) EVT_UPDATE_UI( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode )
EVT_UPDATE_UI( ID_SHOW_LPEDITOR_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode ) EVT_UPDATE_UI( ID_SHOW_PL_EDITOR_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -157,7 +180,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -157,7 +180,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree(); RebuildDesignTree();
item = NULL; item = NULL;
} }
m_canvas->Refresh(); else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint position = item->GetStartPosUi();
SetCrossHairPosition( position, false );
position = GetCrossHairPosition();
if( m_canvas->IsPointOnDisplay( position ) )
m_canvas->MoveCursorToCrossHair();
else
RedrawScreen( position, true );
item->SetFlags( NEW_ITEM );
MoveItem( item );
}
break; break;
case ID_POPUP_ITEM_ADD_RECT: case ID_POPUP_ITEM_ADD_RECT:
...@@ -171,7 +209,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -171,7 +209,22 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree(); RebuildDesignTree();
item = NULL; item = NULL;
} }
m_canvas->Refresh(); else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint position = item->GetStartPosUi();
SetCrossHairPosition( position, false );
position = GetCrossHairPosition();
if( m_canvas->IsPointOnDisplay( position ) )
m_canvas->MoveCursorToCrossHair();
else
RedrawScreen( position, true );
item->SetFlags( NEW_ITEM );
MoveItem( item );
}
break; break;
case ID_POPUP_ITEM_ADD_TEXT: case ID_POPUP_ITEM_ADD_TEXT:
...@@ -185,11 +238,16 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -185,11 +238,16 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
RebuildDesignTree(); RebuildDesignTree();
item = NULL; item = NULL;
} }
m_canvas->Refresh(); else
{
// Put the new text in move mode:
item->SetFlags( NEW_ITEM | LOCATE_STARTPOINT );
MoveItem( item );
}
break; break;
case ID_POPUP_ITEM_ADD_POLY: case ID_POPUP_ITEM_APPEND_PAGE_LAYOUT:
cmd.SetId( ID_OPEN_POLYGON_DESCR_FILE ); cmd.SetId( ID_APPEND_DESCR_FILE );
wxPostEvent( this, cmd ); wxPostEvent( this, cmd );
break; break;
...@@ -240,6 +298,11 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -240,6 +298,11 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
/*
* Function moveItem: called when the mouse cursor is moving
* moves the item currently selected (or the start point or the end point)
* to the cursor position
*/
DPOINT initialPosition; // The initial position of the item to move, in mm DPOINT initialPosition; // The initial position of the item to move, in mm
wxPoint initialPositionUi; // The initial position of the item to move, in Ui wxPoint initialPositionUi; // The initial position of the item to move, in Ui
wxPoint initialCursorPosition; // The initial position of the cursor wxPoint initialCursorPosition; // The initial position of the cursor
...@@ -265,27 +328,43 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio ...@@ -265,27 +328,43 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio
aPanel->Refresh(); aPanel->Refresh();
} }
/*
* Function abortMoveItem: called when an item is currently moving,
* and when the user aborts the move command.
* Restores the initial position of the item
*/
static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{ {
PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen(); PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen();
WORKSHEET_DATAITEM *item = screen->GetCurItem(); WORKSHEET_DATAITEM *item = screen->GetCurItem();
if( (item->GetFlags() & LOCATE_STARTPOINT) )
if( (item->GetFlags() & NEW_ITEM ) )
{ {
item->MoveStartPointTo( initialPosition ); PL_EDITOR_FRAME* plframe = (PL_EDITOR_FRAME*) aPanel->GetParent();
plframe->RemoveLastCommandInUndoList();
WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
pglayout.Remove( item );
plframe->RebuildDesignTree();
} }
else if( (item->GetFlags() & LOCATE_ENDPOINT) ) else
{ {
item->MoveEndPointTo( initialPosition ); if( (item->GetFlags() & LOCATE_STARTPOINT) )
{
item->MoveStartPointTo( initialPosition );
}
else if( (item->GetFlags() & LOCATE_ENDPOINT) )
{
item->MoveEndPointTo( initialPosition );
}
else
item->MoveTo( initialPosition );
} }
else
item->MoveTo( initialPosition );
aPanel->SetMouseCapture( NULL, NULL ); aPanel->SetMouseCapture( NULL, NULL );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
aPanel->Refresh(); aPanel->Refresh();
} }
void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem ) void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) ); wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) );
...@@ -328,6 +407,8 @@ void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem ) ...@@ -328,6 +407,8 @@ void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem )
DPOINT currStartPos = aItem->GetStartPos(); DPOINT currStartPos = aItem->GetStartPos();
DPOINT currEndPos = aItem->GetEndPos(); DPOINT currEndPos = aItem->GetEndPos();
aItem->ClearFlags( NEW_ITEM );
// Save the curren layout before changes // Save the curren layout before changes
if( (aItem->GetFlags() & LOCATE_STARTPOINT) ) if( (aItem->GetFlags() & LOCATE_STARTPOINT) )
{ {
...@@ -363,7 +444,7 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event ) ...@@ -363,7 +444,7 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event ) void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event )
{ {
WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_LPEDITOR_MODE); WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_PL_EDITOR_MODE);
m_canvas->Refresh(); m_canvas->Refresh();
} }
...@@ -446,20 +527,13 @@ void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event ) ...@@ -446,20 +527,13 @@ void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event )
{ {
} }
extern void AddNewItemsCommand( wxMenu* aMainMenu );
void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event ) void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event )
{ {
m_treePagelayout->SelectCell( event.GetItem() ); m_treePagelayout->SelectCell( event.GetItem() );
wxMenu popMenu; wxMenu popMenu;
AddNewItemsCommand( &popMenu );
AddMenuItem( &popMenu, ID_POPUP_ITEM_ADD_LINE, _( "Add line" ),
KiBitmap( add_dashed_line_xpm ) );
AddMenuItem( &popMenu, ID_POPUP_ITEM_ADD_RECT, _( "Add rect" ),
KiBitmap( add_rectangle_xpm ) );
AddMenuItem( &popMenu, ID_POPUP_ITEM_ADD_TEXT, _( "Add text" ),
KiBitmap( add_text_xpm ) );
AddMenuItem( &popMenu, ID_POPUP_ITEM_ADD_POLY, _( "Import poly descr file" ),
KiBitmap( add_polygon_xpm ) );
popMenu.AppendSeparator(); popMenu.AppendSeparator();
AddMenuItem( &popMenu, ID_POPUP_DESIGN_TREE_ITEM_DELETE, _( "Delete" ), AddMenuItem( &popMenu, ID_POPUP_DESIGN_TREE_ITEM_DELETE, _( "Delete" ),
......
/** /**
* @file gerbview/files.cpp * @file pl_editor/files.cpp
*/ */
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2013 CERN
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -112,9 +112,9 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) ...@@ -112,9 +112,9 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
OnNewPageLayout(); OnNewPageLayout();
break; break;
case ID_OPEN_POLYGON_DESCR_FILE: case ID_APPEND_DESCR_FILE:
{ {
wxFileDialog openFileDialog(this, _("Open polygon descr file"), wxFileDialog openFileDialog(this, _("Append Page Layout Descr File"),
wxEmptyString, wxEmptyString,
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN); wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN);
......
/** /**
* @file gerbview/hotkeys.cpp * @file pagelayout_editor/hotkeys.cpp
*/ */
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
...@@ -2,6 +2,30 @@ ...@@ -2,6 +2,30 @@
* @file pagelayout_editor/hotkeys.h * @file pagelayout_editor/hotkeys.h
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PL_EDITOR_KOTKEYS_H_ #ifndef PL_EDITOR_KOTKEYS_H_
#define PL_EDITOR_KOTKEYS_H_ #define PL_EDITOR_KOTKEYS_H_
......
/**
* @file invoke_pl_editor.h
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
* *
......
/**
* @file pagelayout_editor/menubar.cpp
* @brief (Re)Create the main menubar for Pl_Editor
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +27,6 @@ ...@@ -22,10 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file pl_editor/menubar.cpp
* @brief (Re)Create the main menubar for Pl_Editor
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -40,6 +39,19 @@ ...@@ -40,6 +39,19 @@
#include <class_worksheet_dataitem.h> #include <class_worksheet_dataitem.h>
#include <hotkeys.h> #include <hotkeys.h>
// Helper function to add menuitems relative to items creation
void AddNewItemsCommand( wxMenu* aMainMenu )
{
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_LINE, _( "Add Line" ),
KiBitmap( add_dashed_line_xpm ) );
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_RECT, _( "Add Rectangle" ),
KiBitmap( add_rectangle_xpm ) );
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_TEXT, _( "Add Text" ),
KiBitmap( add_text_xpm ) );
AddMenuItem( aMainMenu, ID_POPUP_ITEM_APPEND_PAGE_LAYOUT,
_( "Append Page Layout Descr File" ),
KiBitmap( import_xpm ) );
}
/* Prepare the right-click pullup menu. /* Prepare the right-click pullup menu.
* The menu already has a list of zoom commands. * The menu already has a list of zoom commands.
...@@ -102,15 +114,7 @@ bool PL_EDITOR_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu ) ...@@ -102,15 +114,7 @@ bool PL_EDITOR_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu )
if( ! busy ) if( ! busy )
{ {
AddMenuItem( aPopMenu, ID_POPUP_ITEM_ADD_LINE, _( "Add line" ), AddNewItemsCommand( aPopMenu );
KiBitmap( add_dashed_line_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_ITEM_ADD_RECT, _( "Add rect" ),
KiBitmap( add_rectangle_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_ITEM_ADD_TEXT, _( "Add text" ),
KiBitmap( add_text_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_ITEM_ADD_POLY, _( "Import poly descr file" ),
KiBitmap( add_polygon_xpm ) );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
......
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>. * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
/**
* @file pl_editor_config.cpp
* @brief page layout editor configuration.
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,11 +27,6 @@ ...@@ -22,11 +27,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file pl_editor_config.cpp
* @brief page layout editor configuration.
*/
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
......
/**
* @file pl_editor_frame.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +26,6 @@ ...@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file pl_editor_frame.cpp
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
......
/**
* @file pl_editor_frame.h
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -23,10 +26,6 @@ ...@@ -23,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file pl_editor_frame.h
*/
#ifndef _PL_EDITOR_FRAME_H #ifndef _PL_EDITOR_FRAME_H
#define _PL_EDITOR_FRAME_H #define _PL_EDITOR_FRAME_H
......
/**
* @file pl_editor_id.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _PL_EDITOR_ID_H_ #ifndef _PL_EDITOR_ID_H_
#define _PL_EDITOR_ID_H_ #define _PL_EDITOR_ID_H_
...@@ -22,12 +50,12 @@ enum pl_editor_ids ...@@ -22,12 +50,12 @@ enum pl_editor_ids
ID_DESIGN_TREE_FRAME, ID_DESIGN_TREE_FRAME,
ID_SHOW_REAL_MODE, ID_SHOW_REAL_MODE,
ID_SHOW_LPEDITOR_MODE, ID_SHOW_PL_EDITOR_MODE,
ID_SELECT_COORDINATE_ORIGIN, ID_SELECT_COORDINATE_ORIGIN,
ID_LOAD_DEFAULT_PAGE_LAYOUT, ID_LOAD_DEFAULT_PAGE_LAYOUT,
ID_SELECT_PAGE_NUMBER, ID_SELECT_PAGE_NUMBER,
ID_OPEN_POLYGON_DESCR_FILE, ID_APPEND_DESCR_FILE,
ID_POPUP_START_RANGE, ID_POPUP_START_RANGE,
ID_POPUP_ITEM_DELETE, ID_POPUP_ITEM_DELETE,
...@@ -35,7 +63,7 @@ enum pl_editor_ids ...@@ -35,7 +63,7 @@ enum pl_editor_ids
ID_POPUP_ITEM_ADD_LINE, ID_POPUP_ITEM_ADD_LINE,
ID_POPUP_ITEM_ADD_RECT, ID_POPUP_ITEM_ADD_RECT,
ID_POPUP_ITEM_ADD_TEXT, ID_POPUP_ITEM_ADD_TEXT,
ID_POPUP_ITEM_ADD_POLY, ID_POPUP_ITEM_APPEND_PAGE_LAYOUT,
ID_POPUP_ITEM_MOVE, ID_POPUP_ITEM_MOVE,
ID_POPUP_ITEM_PLACE, ID_POPUP_ITEM_PLACE,
ID_POPUP_ITEM_MOVE_START_POINT, ID_POPUP_ITEM_MOVE_START_POINT,
......
/** /**
* @file pl_editor_undo_redo.cpp * @file pl_editor_undo_redo.cpp
* @brief page layout editor: undo and redo functions * @brief page layout editor: undo and redo functions
*/ */
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
/**
* @file properties_frame.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +26,6 @@ ...@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file properties_frame.cpp
*/
#include <fctsys.h> #include <fctsys.h>
#include <wxstruct.h> #include <wxstruct.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
......
/**
* @file properties_frame.h
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -22,10 +26,6 @@ ...@@ -22,10 +26,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file properties_frame.h
*/
#ifndef _PROPERTIES_FRAME_H #ifndef _PROPERTIES_FRAME_H
#define _PROPERTIES_FRAME_H #define _PROPERTIES_FRAME_H
......
/** /**
* @file toolbars_gerber.cpp * @file toolbars_pl_editor.cpp
* @brief Build tool bars * @brief Build tool bars
*/ */
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -90,12 +90,14 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void ) ...@@ -90,12 +90,14 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void )
// Display mode switch // Display mode switch
m_mainToolBar->AddSeparator(); m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_SHOW_REAL_MODE, wxEmptyString, KiBitmap( pagelayout_normal_view_mode_xpm ), m_mainToolBar->AddTool( ID_SHOW_REAL_MODE, wxEmptyString,
KiBitmap( pagelayout_normal_view_mode_xpm ),
_( "Show title block like it will be displayed in applications\n" _( "Show title block like it will be displayed in applications\n"
"texts with format are replaced by the full text"), "texts with format are replaced by the full text"),
wxITEM_CHECK ); wxITEM_CHECK );
m_mainToolBar->AddTool( ID_SHOW_LPEDITOR_MODE, wxEmptyString, KiBitmap( pagelayout_special_view_mode_xpm ), m_mainToolBar->AddTool( ID_SHOW_PL_EDITOR_MODE,
_( "how title block in edit mode: texts are shown as is\n" wxEmptyString, KiBitmap( pagelayout_special_view_mode_xpm ),
_( "Show title block in edit mode: texts are shown as is:\n"
"texts with format are displayed with no change"), "texts with format are displayed with no change"),
wxITEM_CHECK ); wxITEM_CHECK );
......
...@@ -250,6 +250,7 @@ void DIALOG_COPPER_ZONE::initDialog() ...@@ -250,6 +250,7 @@ void DIALOG_COPPER_ZONE::initDialog()
int layerCount = board->GetCopperLayerCount(); int layerCount = board->GetCopperLayerCount();
wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL ); m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
for( LAYER_NUM ii = FIRST_LAYER; ii < layerCount; ++ii ) for( LAYER_NUM ii = FIRST_LAYER; ii < layerCount; ++ii )
{ {
LAYER_NUM layerNumber = LAYER_N_BACK; LAYER_NUM layerNumber = LAYER_N_BACK;
...@@ -268,9 +269,19 @@ void DIALOG_COPPER_ZONE::initDialog() ...@@ -268,9 +269,19 @@ void DIALOG_COPPER_ZONE::initDialog()
if( m_settings.m_CurrentZone_Layer == layerNumber ) if( m_settings.m_CurrentZone_Layer == layerNumber )
m_LayerSelectionCtrl->Select( itemIndex ); m_LayerSelectionCtrl->Select( itemIndex );
wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
ctrlWidth = std::max( ctrlWidth, tsize.x );
} }
m_LayerSelectionCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE); // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
// unfortunately this option does not work well both on
// wxWidgets 2.8 ( column witdth too small), and
// wxWidgets 2.9 ( column witdth too large)
ctrlWidth += LAYER_BITMAP_SIZE_X + 16; // Add bitmap width + margin between bitmap and text
m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
ctrlWidth += 4; // add small margin between text and window borders
m_LayerSelectionCtrl->SetMinSize( wxSize(ctrlWidth, -1));
wxString netNameDoNotShowFilter = wxT( "N-*" ); wxString netNameDoNotShowFilter = wxT( "N-*" );
if( m_Config ) if( m_Config )
......
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