2009-11-14 22:15:22 +00:00
|
|
|
/************************************/
|
|
|
|
/* dialog_graphic_items_options.cpp */
|
|
|
|
/************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "pcbnew.h"
|
2010-02-24 15:33:03 +00:00
|
|
|
#include "wxPcbStruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "pcbnew_id.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "dialog_graphic_items_options.h"
|
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
extern int g_DrawDefaultLineThickness;
|
|
|
|
|
|
|
|
|
2010-04-23 14:46:00 +00:00
|
|
|
void WinEDA_PcbFrame::OnConfigurePcbOptions( wxCommandEvent& aEvent )
|
2010-02-24 15:33:03 +00:00
|
|
|
{
|
2010-04-23 14:46:00 +00:00
|
|
|
DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this );
|
|
|
|
|
|
|
|
dlg.ShowModal();
|
2010-02-24 15:33:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos )
|
|
|
|
{
|
|
|
|
DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this );
|
|
|
|
dlg.ShowModal();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DIALOG_GRAPHIC_ITEMS_OPTIONS constructor
|
|
|
|
*/
|
|
|
|
|
|
|
|
DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( WinEDA_BasePcbFrame* parent )
|
|
|
|
: DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( parent )
|
|
|
|
{
|
|
|
|
m_Parent = parent;
|
|
|
|
m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings();
|
|
|
|
initValues( );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
GetSizer()->SetSizeHints( this );
|
|
|
|
|
|
|
|
Centre();
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
DIALOG_GRAPHIC_ITEMS_OPTIONS::~DIALOG_GRAPHIC_ITEMS_OPTIONS( )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_GRAPHIC_ITEMS_OPTIONS::initValues()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-02-24 20:38:55 +00:00
|
|
|
SetFocus();
|
|
|
|
|
2009-11-14 22:15:22 +00:00
|
|
|
/* Drawings width */
|
|
|
|
AddUnitSymbol( *m_GraphicSegmWidthTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptPcbSegmWidth,
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_DrawSegmentWidth,
|
2009-11-14 22:15:22 +00:00
|
|
|
PCB_INTERNAL_UNIT );
|
|
|
|
/* Edges width */
|
|
|
|
AddUnitSymbol( *m_BoardEdgesWidthTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptPcbEdgesWidth,
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_EdgeSegmentWidth,
|
2009-11-14 22:15:22 +00:00
|
|
|
PCB_INTERNAL_UNIT );
|
|
|
|
|
|
|
|
/* Pcb Textes (Size & Width) */
|
|
|
|
AddUnitSymbol( *m_CopperTextWidthTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptPcbTextWidth,
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextWidth, PCB_INTERNAL_UNIT );
|
2009-11-14 22:15:22 +00:00
|
|
|
|
|
|
|
AddUnitSymbol( *m_TextSizeVTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptPcbTextVSize,
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextSize.y, PCB_INTERNAL_UNIT );
|
2009-11-14 22:15:22 +00:00
|
|
|
|
|
|
|
AddUnitSymbol( *m_TextSizeHTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptPcbTextHSize,
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextSize.x, PCB_INTERNAL_UNIT );
|
2009-11-14 22:15:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Modules: Edges width */
|
|
|
|
AddUnitSymbol( *m_EdgeModWidthTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptModuleEdgesWidth,
|
|
|
|
ModuleSegmentWidth, PCB_INTERNAL_UNIT );
|
|
|
|
|
|
|
|
/* Modules: Texts: Size & width */
|
|
|
|
AddUnitSymbol( *m_TextModWidthTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptModuleTextWidth,
|
|
|
|
ModuleTextWidth, PCB_INTERNAL_UNIT );
|
|
|
|
|
|
|
|
AddUnitSymbol( *m_TextModSizeVTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptModuleTextVSize,
|
|
|
|
ModuleTextSize.y, PCB_INTERNAL_UNIT );
|
|
|
|
|
|
|
|
AddUnitSymbol( *m_TextModSizeHTitle );
|
|
|
|
PutValueInLocalUnits( *m_OptModuleTextHSize,
|
|
|
|
ModuleTextSize.x, PCB_INTERNAL_UNIT );
|
2010-02-24 15:33:03 +00:00
|
|
|
|
|
|
|
AddUnitSymbol( *m_DefaultPenSizeTitle );
|
|
|
|
PutValueInLocalUnits( *m_DefaultPenSizeCtrl,
|
|
|
|
g_DrawDefaultLineThickness, PCB_INTERNAL_UNIT );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
void DIALOG_GRAPHIC_ITEMS_OPTIONS::OnOkClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_DrawSegmentWidth =
|
2009-11-14 22:15:22 +00:00
|
|
|
ReturnValueFromTextCtrl( *m_OptPcbSegmWidth, PCB_INTERNAL_UNIT );
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_EdgeSegmentWidth =
|
2009-11-14 22:15:22 +00:00
|
|
|
ReturnValueFromTextCtrl( *m_OptPcbEdgesWidth, PCB_INTERNAL_UNIT );
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextWidth =
|
2009-11-14 22:15:22 +00:00
|
|
|
ReturnValueFromTextCtrl( *m_OptPcbTextWidth, PCB_INTERNAL_UNIT );
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextSize.y =
|
2009-11-14 22:15:22 +00:00
|
|
|
ReturnValueFromTextCtrl( *m_OptPcbTextVSize, PCB_INTERNAL_UNIT );
|
2010-01-31 20:01:46 +00:00
|
|
|
m_BrdSettings->m_PcbTextSize.x =
|
2009-11-14 22:15:22 +00:00
|
|
|
ReturnValueFromTextCtrl( *m_OptPcbTextHSize, PCB_INTERNAL_UNIT );
|
|
|
|
|
|
|
|
ModuleSegmentWidth =
|
|
|
|
ReturnValueFromTextCtrl( *m_OptModuleEdgesWidth, PCB_INTERNAL_UNIT );
|
|
|
|
ModuleTextWidth =
|
|
|
|
ReturnValueFromTextCtrl( *m_OptModuleTextWidth, PCB_INTERNAL_UNIT );
|
|
|
|
ModuleTextSize.y =
|
|
|
|
ReturnValueFromTextCtrl( *m_OptModuleTextVSize, PCB_INTERNAL_UNIT );
|
|
|
|
ModuleTextSize.x =
|
|
|
|
ReturnValueFromTextCtrl( *m_OptModuleTextHSize, PCB_INTERNAL_UNIT );
|
2010-02-24 20:38:55 +00:00
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
g_DrawDefaultLineThickness =
|
|
|
|
ReturnValueFromTextCtrl( *m_DefaultPenSizeCtrl, PCB_INTERNAL_UNIT );
|
2010-02-24 20:38:55 +00:00
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
if( g_DrawDefaultLineThickness < 0 )
|
|
|
|
g_DrawDefaultLineThickness = 0;
|
2009-11-14 22:15:22 +00:00
|
|
|
|
2010-04-23 14:46:00 +00:00
|
|
|
EndModal( wxID_OK );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
|
|
|
*/
|
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
void DIALOG_GRAPHIC_ITEMS_OPTIONS::OnCancelClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
event.Skip();
|
2009-11-14 22:15:22 +00:00
|
|
|
}
|