Commit bbb126db authored by jean-pierre charras's avatar jean-pierre charras

Board and footprint editors: Auto update 3D display after a footprint or board change.

parents facbe280 67fd5ae3
......@@ -57,6 +57,7 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
m_HToolBar = NULL;
m_VToolBar = NULL;
m_InternalUnits = 10000; // Internal units = 1/10000 inch
m_reloadRequest = false;
// Give it an icon
SetIcon( wxICON( icon_w3d ) );
......@@ -343,6 +344,8 @@ error: unknown command" ) );
void WinEDA3D_DrawFrame::NewDisplay()
{
m_reloadRequest = false;
m_Canvas->ClearLists();
m_Canvas->CreateDrawGL_List();
......@@ -356,10 +359,9 @@ void WinEDA3D_DrawFrame::OnActivate( wxActivateEvent& event )
{
// Reload data if 3D frame shows a footprint,
// because it can be changed since last frame activation
if( m_Parent->m_Ident == MODULE_EDITOR_FRAME )
{
// NewDisplay();
}
if( m_reloadRequest )
NewDisplay();
event.Skip(); // required under wxMAC
}
......
......@@ -185,23 +185,25 @@ class WinEDA3D_DrawFrame : public wxFrame
{
public:
WinEDA_BasePcbFrame* m_Parent;
private:
wxString m_FrameName; // name used for writing and reading setup
// It is "Frame3D"
Pcb3D_GLCanvas* m_Canvas;
WinEDA_Toolbar* m_HToolBar;
WinEDA_Toolbar* m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
wxAuiManager m_auimgr;
~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
private:
wxString m_FrameName; // name used for writing and reading setup
// It is "Frame3D"
bool m_reloadRequest;
public:
WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
~WinEDA3D_DrawFrame()
{
m_auimgr.UnInit();
};
void Exit3DFrame( wxCommandEvent& event );
void OnCloseWindow( wxCloseEvent& Event );
......@@ -211,6 +213,15 @@ public:
void SetToolbars();
void GetSettings();
void SaveSettings();
/** function ReloadRequest
* must be called when reloading data from Pcbnew is needed
* mainly after edition of the board or footprint beeing displayed.
* mainly for the mudule editor.
*/
void ReloadRequest( )
{
m_reloadRequest = true;
}
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
......
......@@ -4,6 +4,14 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-may-01, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
Board and footprint editors:
Auto update 3D display after footprint or board edition.
(board or footprint is reloaded only when the 3D frame is reactivated, so
no extra time is needed during edition)
2010-apr-29, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
......
......@@ -218,9 +218,11 @@ public:
/** Function OnModify()
* Virtual
* Must be called after a schematic change
* Must be called after a change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
* do not forget to call this basic OnModify function to update info
* in derived OnModify functions
*/
virtual void OnModify( );
......
......@@ -274,6 +274,14 @@ public:
void ReCreateMenuBar();
WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );
/** Virtual Function OnModify()
* Must be called after a board change
* in order to set the "modify" flag of the current screen
* and prepare, if needed the refresh of the 3D frame showing the footprint
* do not forget to call the basic OnModify function to update auxiliary info
*/
virtual void OnModify( );
/**
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
......@@ -1069,6 +1077,14 @@ public:
void GeneralControle( wxDC* DC, wxPoint Mouse );
void LoadModuleFromBoard( wxCommandEvent& event );
/** Virtual Function OnModify()
* Must be called after a footprint change
* in order to set the "modify" flag of the current screen
* and prepare, if needed the refresh of the 3D frame showing the footprint
* do not forget to call the basic OnModify function to update auxiliary info
*/
virtual void OnModify( );
/** function ToPrinter
* Install the print dialog
*/
......
......@@ -54,7 +54,8 @@ set(PCBNEW_SRCS
dialog_export_3Dfiles_base.cpp
dialog_freeroute_exchange.cpp
dialog_freeroute_exchange_base.cpp
# dialog_gendrill.cpp
dialog_gendrill.cpp
dialog_gendrill_base.cpp
dialog_general_options.cpp
dialog_general_options_BoardEditor_base.cpp
dialog_global_edit_tracks_and_vias.cpp
......
......@@ -423,6 +423,8 @@ void WinEDA_BasePcbFrame::SaveSettings()
* Must be called after a schematic change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
* do not forget to call this basic OnModify function to update info
* in derived OnModify functions
*/
void WinEDA_BasePcbFrame::OnModify( )
{
......
......@@ -45,10 +45,10 @@ DIALOG_EXPORT_3DFILE_BASE::DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindow
m_rbSelectUnits->SetSelection( 0 );
bLowerSizer->Add( m_rbSelectUnits, 1, wxALL|wxEXPAND, 5 );
wxString m_rb3DFilesOptionChoices[] = { _("Copy 3D Shapes Files in Subdir"), _("Use Absolute Path in Wrml File ") };
wxString m_rb3DFilesOptionChoices[] = { _("Copy 3D Shapes Files in Subdir"), _("Use Absolute Path in Vrml File ") };
int m_rb3DFilesOptionNChoices = sizeof( m_rb3DFilesOptionChoices ) / sizeof( wxString );
m_rb3DFilesOption = new wxRadioBox( this, wxID_ANY, _("3D Shapes Files Option:"), wxDefaultPosition, wxDefaultSize, m_rb3DFilesOptionNChoices, m_rb3DFilesOptionChoices, 1, wxRA_SPECIFY_COLS );
m_rb3DFilesOption->SetSelection( 0 );
m_rb3DFilesOption->SetSelection( 1 );
bLowerSizer->Add( m_rb3DFilesOption, 1, wxALL|wxEXPAND, 5 );
bSizer1->Add( bLowerSizer, 1, wxEXPAND, 5 );
......
......@@ -365,7 +365,7 @@
<property name="proportion">1</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Copy 3D Shapes Files in Subdir&quot; &quot;Use Absolute Path in Wrml File &quot;</property>
<property name="choices">&quot;Copy 3D Shapes Files in Subdir&quot; &quot;Use Absolute Path in Vrml File &quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
......@@ -379,7 +379,7 @@
<property name="name">m_rb3DFilesOption</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">0</property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 13/01/2008 17:26:dialog_gendrill
// RCS-ID:
// Copyright: License GNU
// Licence:
// Created: 2010 apr 30
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 13/01/2008 17:26:dialog_gendrill
#ifndef _DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_
#include "dialog_gendrill_base.h"
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_WINEDA_DRILLFRAME 10000
#define ID_SEL_DRILL_UNITS 10002
#define ID_SEL_ZEROS_FMT 10001
#define ID_SEL_PRECISION 10003
#define ID_SEL_DRILL_SHEET 10004
#define ID_SEL_DRILL_REPORT 10010
#define ID_TEXTCTRL2 10007
#define ID_TEXTCTRL 10006
#define ID_CHECKBOX2 10011
#define ID_CHECKBOX3 10012
#define SYMBOL_WINEDA_DRILLFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_WINEDA_DRILLFRAME_TITLE _("Drill Files Generation")
#define SYMBOL_WINEDA_DRILLFRAME_IDNAME ID_WINEDA_DRILLFRAME
#define SYMBOL_WINEDA_DRILLFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_DRILLFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* WinEDA_DrillFrame class declaration
*/
class DIALOG_GENDRILL: public DIALOG_GENDRILL_BASE
{
class WinEDA_DrillFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_DrillFrame )
DECLARE_EVENT_TABLE()
private:
WinEDA_PcbFrame* m_Parent;
int m_PadsHoleCount;
int m_ThroughViasCount;
int m_MicroViasCount;
int m_BlindOrBuriedViasCount;
public:
/// Constructors
WinEDA_DrillFrame();
WinEDA_DrillFrame( WinEDA_PcbFrame* parent,
wxWindowID id = SYMBOL_WINEDA_DRILLFRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_DRILLFRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_DRILLFRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_DRILLFRAME_SIZE,
long style = SYMBOL_WINEDA_DRILLFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_DRILLFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_DRILLFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_DRILLFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_DRILLFRAME_SIZE, long style = SYMBOL_WINEDA_DRILLFRAME_STYLE );
/// Destructor
~WinEDA_DrillFrame();
DIALOG_GENDRILL( WinEDA_PcbFrame* parent );
~DIALOG_GENDRILL();
private:
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_DrillFrame event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_WINEDA_DRILLFRAME
void OnCloseWindow( wxCloseEvent& event );
void initDialog();
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_DRILL_UNITS
void OnSelDrillUnitsSelected( wxCommandEvent& event );
......@@ -102,50 +40,6 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_DrillFrame event handler declarations
////@begin WinEDA_DrillFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_DrillFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_DrillFrame member variables
wxBoxSizer* m_LeftBoxSizer;
wxRadioBox* m_Choice_Unit;
wxRadioBox* m_Choice_Zeros_Format;
wxRadioBox* m_Choice_Precision;
wxRadioBox* m_Choice_Drill_Offset;
wxRadioBox* m_Choice_Drill_Map;
wxRadioBox* m_Choice_Drill_Report;
wxTextCtrl* m_PenSpeed;
wxTextCtrl* m_PenNum;
wxCheckBox* m_Check_Mirror;
wxCheckBox* m_Check_Minimal;
wxStaticBox* m_DefaultViasDrillSizer;
wxStaticText* m_ViaDrillValue;
wxStaticBox* m_MicroViasDrillSizer;
wxStaticText* m_MicroViaDrillValue;
wxStaticText* m_PadsCountInfoMsg;
wxStaticText* m_ThroughViasInfoMsg;
wxStaticText* m_MicroViasInfoMsg;
wxStaticText* m_BuriedViasInfoMsg;
wxButton* m_OkButton;
wxButton* m_CancelButton;
////@end WinEDA_DrillFrame member variables
private:
WinEDA_PcbFrame* m_Parent;
int m_PadsHoleCount;
int m_ThroughViasCount;
int m_MicroViasCount;
int m_BlindOrBuriedViasCount;
private:
void InitDisplayParams(void);
......@@ -162,5 +56,4 @@ private:
int Gen_Liste_Tools( std::vector<DRILL_TOOL> & buffer, bool print_header );
};
#endif
// _DIALOG_GENDRILL_H_
#endif // _DIALOG_GENDRILL_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_gendrill_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_LeftBoxSizer;
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
wxString m_Choice_UnitChoices[] = { _("Millimeters"), _("Inches") };
int m_Choice_UnitNChoices = sizeof( m_Choice_UnitChoices ) / sizeof( wxString );
m_Choice_Unit = new wxRadioBox( this, wxID_ANY, _("Drill Units:"), wxDefaultPosition, wxDefaultSize, m_Choice_UnitNChoices, m_Choice_UnitChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Unit->SetSelection( 1 );
m_LeftBoxSizer->Add( m_Choice_Unit, 0, wxALL|wxEXPAND, 5 );
wxString m_Choice_Zeros_FormatChoices[] = { _("Decimal format"), _("Suppress leading zeros"), _("Suppress trailing zeros"), _("Keep zeros") };
int m_Choice_Zeros_FormatNChoices = sizeof( m_Choice_Zeros_FormatChoices ) / sizeof( wxString );
m_Choice_Zeros_Format = new wxRadioBox( this, wxID_ANY, _("Zeros Format"), wxDefaultPosition, wxDefaultSize, m_Choice_Zeros_FormatNChoices, m_Choice_Zeros_FormatChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Zeros_Format->SetSelection( 0 );
m_Choice_Zeros_Format->SetToolTip( _("Choose EXCELLON numbers notation") );
m_LeftBoxSizer->Add( m_Choice_Zeros_Format, 0, wxALL|wxEXPAND, 5 );
wxString m_Choice_PrecisionChoices[] = { _("2:3"), _("2:4") };
int m_Choice_PrecisionNChoices = sizeof( m_Choice_PrecisionChoices ) / sizeof( wxString );
m_Choice_Precision = new wxRadioBox( this, wxID_ANY, _("Precision"), wxDefaultPosition, wxDefaultSize, m_Choice_PrecisionNChoices, m_Choice_PrecisionChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Precision->SetSelection( 1 );
m_Choice_Precision->SetToolTip( _("Choose EXCELLON numbers precision") );
m_LeftBoxSizer->Add( m_Choice_Precision, 0, wxALL|wxEXPAND, 5 );
wxString m_Choice_Drill_OffsetChoices[] = { _("Absolute"), _("Auxiliary axis") };
int m_Choice_Drill_OffsetNChoices = sizeof( m_Choice_Drill_OffsetChoices ) / sizeof( wxString );
m_Choice_Drill_Offset = new wxRadioBox( this, wxID_ANY, _("Drill Origin:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetNChoices, m_Choice_Drill_OffsetChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Offset->SetSelection( 0 );
m_Choice_Drill_Offset->SetToolTip( _("Choose the coordinate origin: absolute or relative to the auxiliray axis") );
m_LeftBoxSizer->Add( m_Choice_Drill_Offset, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( m_LeftBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bMiddleBoxSizer;
bMiddleBoxSizer = new wxBoxSizer( wxVERTICAL );
wxString m_Choice_Drill_MapChoices[] = { _("None"), _("Drill map (HPGL)"), _("Drill map (PostScript)"), _("Drill map (Gerber)"), _("Drill map (DXF)") };
int m_Choice_Drill_MapNChoices = sizeof( m_Choice_Drill_MapChoices ) / sizeof( wxString );
m_Choice_Drill_Map = new wxRadioBox( this, wxID_ANY, _("Drill Sheet:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_MapNChoices, m_Choice_Drill_MapChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Map->SetSelection( 0 );
m_Choice_Drill_Map->SetToolTip( _("Creates a drill map in PSr HPGL or others formats") );
bMiddleBoxSizer->Add( m_Choice_Drill_Map, 0, wxALL|wxEXPAND, 5 );
wxString m_Choice_Drill_ReportChoices[] = { _("None"), _("Drill report") };
int m_Choice_Drill_ReportNChoices = sizeof( m_Choice_Drill_ReportChoices ) / sizeof( wxString );
m_Choice_Drill_Report = new wxRadioBox( this, wxID_ANY, _("Drill Report:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_ReportNChoices, m_Choice_Drill_ReportChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Report->SetSelection( 0 );
m_Choice_Drill_Report->SetToolTip( _("Creates a plain text report") );
bMiddleBoxSizer->Add( m_Choice_Drill_Report, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbHPGOptionsSizer;
sbHPGOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL plotter Options:") ), wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
sbHPGOptionsSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PenSpeed = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbHPGOptionsSizer->Add( m_PenSpeed, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
sbHPGOptionsSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PenNum = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbHPGOptionsSizer->Add( m_PenNum, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bMiddleBoxSizer->Add( sbHPGOptionsSizer, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbOptSizer;
sbOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
m_Check_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror y axis"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Mirror, 0, wxALL, 5 );
m_Check_Minimal = new wxCheckBox( this, wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Minimal, 0, wxALL, 5 );
bMiddleBoxSizer->Add( sbOptSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bMiddleBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightBoxSizer;
bRightBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerInfo;
sbSizerInfo = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Info:") ), wxVERTICAL );
m_DefaultViasDrillSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Vias Drill:") ), wxVERTICAL );
m_ViaDrillValue = new wxStaticText( this, wxID_ANY, _("Via Drill Value"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaDrillValue->Wrap( -1 );
m_DefaultViasDrillSizer->Add( m_ViaDrillValue, 0, wxALL, 5 );
sbSizerInfo->Add( m_DefaultViasDrillSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_MicroViasDrillSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Micro Vias Drill:") ), wxVERTICAL );
m_MicroViaDrillValue = new wxStaticText( this, wxID_ANY, _("Micro Via Drill Value"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaDrillValue->Wrap( -1 );
m_MicroViasDrillSizer->Add( m_MicroViaDrillValue, 0, wxALL, 5 );
sbSizerInfo->Add( m_MicroViasDrillSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
wxStaticBoxSizer* sbSizerHoles;
sbSizerHoles = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Holes Count:") ), wxVERTICAL );
m_PadsCountInfoMsg = new wxStaticText( this, wxID_ANY, _("Pads:"), wxDefaultPosition, wxDefaultSize, 0 );
m_PadsCountInfoMsg->Wrap( -1 );
sbSizerHoles->Add( m_PadsCountInfoMsg, 0, wxALL, 5 );
m_ThroughViasInfoMsg = new wxStaticText( this, wxID_ANY, _("Through Vias:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ThroughViasInfoMsg->Wrap( -1 );
sbSizerHoles->Add( m_ThroughViasInfoMsg, 0, wxALL, 5 );
m_MicroViasInfoMsg = new wxStaticText( this, wxID_ANY, _("Micro Vias:"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViasInfoMsg->Wrap( -1 );
sbSizerHoles->Add( m_MicroViasInfoMsg, 0, wxALL, 5 );
m_BuriedViasInfoMsg = new wxStaticText( this, wxID_ANY, _("Buried Vias:"), wxDefaultPosition, wxDefaultSize, 0 );
m_BuriedViasInfoMsg->Wrap( -1 );
sbSizerHoles->Add( m_BuriedViasInfoMsg, 0, wxALL, 5 );
sbSizerInfo->Add( sbSizerHoles, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
bRightBoxSizer->Add( sbSizerInfo, 0, wxEXPAND|wxTOP, 5 );
bRightBoxSizer->Add( 10, 10, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
m_OkButton = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_OkButton->SetDefault();
bRightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_CancelButton = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bRightBoxSizer->Add( m_CancelButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bMainSizer->Add( bRightBoxSizer, 1, wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_Choice_Unit->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this );
m_Choice_Zeros_Format->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this );
m_OkButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOkClick ), NULL, this );
m_CancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this );
}
DIALOG_GENDRILL_BASE::~DIALOG_GENDRILL_BASE()
{
// Disconnect Events
m_Choice_Unit->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this );
m_Choice_Zeros_Format->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this );
m_OkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOkClick ), NULL, this );
m_CancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_gendrill_base__
#define __dialog_gendrill_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/statbox.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GENDRILL_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GENDRILL_BASE : public wxDialog
{
private:
protected:
wxRadioBox* m_Choice_Unit;
wxRadioBox* m_Choice_Zeros_Format;
wxRadioBox* m_Choice_Precision;
wxRadioBox* m_Choice_Drill_Offset;
wxRadioBox* m_Choice_Drill_Map;
wxRadioBox* m_Choice_Drill_Report;
wxStaticText* m_staticText1;
wxTextCtrl* m_PenSpeed;
wxStaticText* m_staticText2;
wxTextCtrl* m_PenNum;
wxCheckBox* m_Check_Mirror;
wxCheckBox* m_Check_Minimal;
wxStaticBoxSizer* m_DefaultViasDrillSizer;
wxStaticText* m_ViaDrillValue;
wxStaticBoxSizer* m_MicroViasDrillSizer;
wxStaticText* m_MicroViaDrillValue;
wxStaticText* m_PadsCountInfoMsg;
wxStaticText* m_ThroughViasInfoMsg;
wxStaticText* m_MicroViasInfoMsg;
wxStaticText* m_BuriedViasInfoMsg;
wxButton* m_OkButton;
wxButton* m_CancelButton;
// Virtual event handlers, overide them in your derived class
virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSelZerosFmtSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Drill Files Generation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 447,412 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GENDRILL_BASE();
};
#endif //__dialog_gendrill_base__
......@@ -50,7 +50,7 @@ void Dialog_GeneralOptions::init()
m_ShowModuleRatsnest->SetValue( g_Show_Module_Ratsnest );
m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible(RATSNEST_VISIBLE) );
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
m_Track_45_Only_Ctrl->SetValue( Track_45_Only );
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_AutoPANOpt->SetValue( m_Parent->DrawPanel->m_AutoPAN_Enable );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
......@@ -92,7 +92,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
Track_45_Only = m_Track_45_Only_Ctrl->GetValue();
g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
......
......@@ -736,7 +736,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel,
}
}
if( Track_45_Only )
if( g_Track_45_Only_Allowed )
{
if( g_TwoSegmentTrackBuild )
{
......
......@@ -12,6 +12,7 @@
#include "wxPcbStruct.h"
#include "protos.h"
#include "pcbnew_id.h"
#include "3d_viewer.h"
#define BACKUP_FILE_EXT wxT( "000" )
......@@ -274,6 +275,9 @@ this file again." ) );
/* reset the auto save timer */
g_SaveTime = time( NULL );
// Refresh the 3D view, if any
if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay();
#if 0 && defined(DEBUG)
// note this freezes up pcbnew when run under the kicad project
......
......@@ -22,6 +22,8 @@
#include "gendrill.h"
#include "dialog_gendrill.h" // Dialog box for drill file generation
#include "build_version.h"
const wxString DrillFileExtension( wxT( "drl" ) );
......@@ -40,7 +42,7 @@ const wxString DrillFileWildcard( _( "Drill files (*.drl)|*.drl" ) );
*
* The drill maps can be created in HPGL or PS format
*
* dialog_gendrill.cpp is the file (included in this file) which handles
* dialog_gendrill.cpp is the filewhich handles
* the Dialog box for drill file generation
*/
......@@ -74,12 +76,10 @@ static std::vector<HOLE_INFO> s_HoleListBuffer;
#define UnitDrillInchKey wxT( "DrillUnit" )
#define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" )
#include "dialog_gendrill.cpp" // Dialog box for drill file generation
/* some param values initialization before display dialog window
*/
void WinEDA_DrillFrame::InitDisplayParams( void )
void DIALOG_GENDRILL::InitDisplayParams( void )
{
wxString msg;
......@@ -123,7 +123,6 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
m_BlindOrBuriedViasCount++;
}
m_MicroViasDrillSizer->Enable( m_MicroViasCount );
m_MicroViaDrillValue->Enable( m_MicroViasCount );
// Pads holes round:
......@@ -162,7 +161,7 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
}
void WinEDA_DrillFrame::SetParams( void )
void DIALOG_GENDRILL::SetParams( void )
{
wxString msg;
long ltmp;
......@@ -221,14 +220,14 @@ void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event )
Config->Read( DrillOriginIsAuxAxisKey, &DrillOriginIsAuxAxis );
}
WinEDA_DrillFrame* frame = new WinEDA_DrillFrame( this );
DIALOG_GENDRILL* frame = new DIALOG_GENDRILL( this );
frame->ShowModal();
frame->Destroy();
}
/* Save drill options: */
void WinEDA_DrillFrame::UpdateConfig()
void DIALOG_GENDRILL::UpdateConfig()
{
SetParams();
......@@ -256,7 +255,7 @@ void WinEDA_DrillFrame::UpdateConfig()
* And one file per layer pair, which have one or more holes, excluding
* through holes, already in the first file.
*/
void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
void DIALOG_GENDRILL::GenDrillFiles( wxCommandEvent& event )
{
wxFileName fn;
wxString layer_extend; /* added to the Board FileName to
......@@ -383,7 +382,7 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
}
void WinEDA_DrillFrame::UpdatePrecisionOptions( wxCommandEvent& event )
void DIALOG_GENDRILL::UpdatePrecisionOptions( wxCommandEvent& event )
{
if( m_Choice_Unit->GetSelection()==1 )
{
......@@ -410,7 +409,7 @@ void WinEDA_DrillFrame::UpdatePrecisionOptions( wxCommandEvent& event )
* @param aHoleListBuffer = hole descriptor list
* @param aToolListBuffer = Drill tools list
*/
int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( FILE* excellon_dest,
int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* excellon_dest,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer )
{
......@@ -652,7 +651,7 @@ void Gen_Line_EXCELLON( char* line, float x, float y )
* ICI,OFF
* ATC,ON
*/
void WinEDA_DrillFrame::Write_Excellon_Header( FILE* aFile )
void DIALOG_GENDRILL::Write_Excellon_Header( FILE* aFile )
{
char Line[256];
......@@ -733,7 +732,7 @@ void Write_End_Of_File_Drill( FILE* aFile )
/* Generate the drill plan (Drill map) format HPGL or POSTSCRIPT
*/
void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
void DIALOG_GENDRILL::GenDrillMap( const wxString aFileName,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& buffer,
int format )
......@@ -766,7 +765,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
break;
default:
DisplayError( this, wxT( "WinEDA_DrillFrame::GenDrillMap() error" ) );
DisplayError( this, wxT( "DIALOG_GENDRILL::GenDrillMap() error" ) );
return;
}
......@@ -806,7 +805,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
/*
* Create a list of drill values and drill count
*/
void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName )
void DIALOG_GENDRILL::GenDrillReport( const wxString aFileName )
{
wxFileName fn;
wxString msg;
......
......@@ -802,4 +802,5 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform )
}
module->Set_Rectangle_Encadrement();
OnModify();
}
......@@ -531,3 +531,16 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
SetToolbars();
UpdateStatusBar();
}
/** Virtual Function OnModify()
* Must be called after a change
* in order to set the "modify" flag of the current screen
* and prepare, if needed the refresh of the 3D frame showing the footprint
* do not forget to call the basic OnModify function to update auxiliary info
*/
void WinEDA_ModuleEditFrame::OnModify( )
{
WinEDA_BasePcbFrame::OnModify( );
if( m_Draw3DFrame )
m_Draw3DFrame->ReloadRequest( );
}
......@@ -678,3 +678,17 @@ void WinEDA_PcbFrame::SetLastNetListRead( const wxString& aLastNetListRead )
m_lastNetListRead = relativeFileName.GetFullPath();
}
}
/** Virtual Function OnModify()
* Must be called after a change
* in order to set the "modify" flag of the current screen
* and prepare, if needed the refresh of the 3D frame showing the footprint
* do not forget to call the basic OnModify function to update auxiliary info
*/
void WinEDA_PcbFrame::OnModify( )
{
WinEDA_BasePcbFrame::OnModify( );
if( m_Draw3DFrame )
m_Draw3DFrame->ReloadRequest( );
}
......@@ -43,8 +43,8 @@ bool g_Drag_Pistes_On;
bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = true;
bool Track_45_Only;
bool Segments_45_Only;
bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks
bool Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments
bool g_TwoSegmentTrackBuild = true;
bool g_HighLight_Status;
......
......@@ -60,7 +60,7 @@ extern bool g_Raccord_45_Auto;
extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames
extern bool Track_45_Only;
extern bool g_Track_45_Only_Allowed;
extern bool Segments_45_Only;
extern wxString g_Shapes3DExtBuffer;
extern wxString g_DocModulesFileName;
......
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