2007-06-05 12:10:51 +00:00
/////////////////////////////////////////////////////////////////////////////
2008-04-17 16:25:29 +00:00
2007-08-16 08:37:32 +00:00
// Name: dialog_options.cpp
2008-04-17 16:25:29 +00:00
// Purpose:
2007-06-05 12:10:51 +00:00
// Author: jean-pierre Charras
2008-04-17 16:25:29 +00:00
// Modified by:
2007-06-05 12:10:51 +00:00
// Created: 31/01/2006 13:27:33
2008-04-17 16:25:29 +00:00
// RCS-ID:
2007-06-05 12:10:51 +00:00
// Copyright: GNU Licence
// Licence: GNU
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 31/01/2006 13:27:33
2008-04-17 16:25:29 +00:00
# if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
2007-08-16 08:37:32 +00:00
# pragma implementation "dialog_options.h"
2007-06-05 12:10:51 +00:00
# endif
# include "fctsys.h"
# include "gr_basic.h"
# include "common.h"
2009-02-04 15:25:03 +00:00
# include "id.h"
# include "class_drawpanel.h"
# include "confirm.h"
2007-06-05 12:10:51 +00:00
# include "program.h"
# include "libcmp.h"
# include "general.h"
# include "protos.h"
////@begin includes
////@end includes
# include "dialog_options.h"
////@begin XPM images
////@end XPM images
/**************************************************************************/
2009-04-29 17:09:00 +00:00
void DisplayOptionFrame ( WinEDA_SchematicFrame * parent , const wxPoint & framepos )
2007-06-05 12:10:51 +00:00
/**************************************************************************/
{
2008-04-17 16:25:29 +00:00
WinEDA_SetOptionsFrame * frame =
new WinEDA_SetOptionsFrame ( parent ) ;
frame - > ShowModal ( ) ; frame - > Destroy ( ) ;
2007-06-05 12:10:51 +00:00
}
/*!
* WinEDA_SetOptionsFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS ( WinEDA_SetOptionsFrame , wxDialog )
/*!
* WinEDA_SetOptionsFrame event table definition
*/
BEGIN_EVENT_TABLE ( WinEDA_SetOptionsFrame , wxDialog )
////@begin WinEDA_SetOptionsFrame event table entries
2008-04-30 11:52:34 +00:00
EVT_BUTTON ( wxID_OK , WinEDA_SetOptionsFrame : : OnOkClick )
2007-06-05 12:10:51 +00:00
2008-04-30 11:52:34 +00:00
EVT_BUTTON ( wxID_CANCEL , WinEDA_SetOptionsFrame : : OnCancelClick )
2007-06-05 12:10:51 +00:00
////@end WinEDA_SetOptionsFrame event table entries
END_EVENT_TABLE ( )
/*!
* WinEDA_SetOptionsFrame constructors
*/
2008-04-17 16:25:29 +00:00
WinEDA_SetOptionsFrame : : WinEDA_SetOptionsFrame ( )
2007-06-05 12:10:51 +00:00
{
}
2008-04-17 16:25:29 +00:00
2009-04-29 17:09:00 +00:00
WinEDA_SetOptionsFrame : : WinEDA_SetOptionsFrame ( WinEDA_SchematicFrame * parent ,
2008-04-17 16:25:29 +00:00
wxWindowID id ,
const wxString & caption ,
const wxPoint & pos ,
const wxSize & size ,
long style )
2007-06-05 12:10:51 +00:00
{
2008-04-17 16:25:29 +00:00
m_Parent = parent ;
Create ( parent , id , caption , pos , size , style ) ;
BASE_SCREEN * screen = m_Parent - > GetBaseScreen ( ) ;
/* Init options */
if ( screen )
{
2009-02-07 08:33:25 +00:00
switch ( ( int ) screen - > GetGrid ( ) . x )
2008-04-17 16:25:29 +00:00
{
case 50 :
m_SelGridSize - > SetSelection ( 0 ) ;
break ;
case 25 :
m_SelGridSize - > SetSelection ( 1 ) ;
break ;
case 10 :
m_SelGridSize - > SetSelection ( 2 ) ;
break ;
case 5 :
m_SelGridSize - > SetSelection ( 3 ) ;
break ;
case 2 :
m_SelGridSize - > SetSelection ( 4 ) ;
break ;
case 1 :
m_SelGridSize - > SetSelection ( 5 ) ;
break ;
default :
DisplayError ( this , wxT ( " WinEDA_SetOptionsFrame: Grid value not handle " ) ) ;
break ;
}
}
/* Adjust the current selections and options: */
m_ShowGridOpt - > SetValue ( m_Parent - > m_Draw_Grid ) ;
m_AutoPANOpt - > SetValue ( m_Parent - > DrawPanel - > m_AutoPAN_Enable ) ;
2009-04-29 17:09:00 +00:00
m_SelShowPins - > SetSelection ( m_Parent - > m_ShowAllPins ) ;
2008-04-17 16:25:29 +00:00
m_Selunits - > SetSelection ( g_UnitMetric ? 0 : 1 ) ;
m_SelDirWires - > SetSelection ( g_HVLines ? 0 : 1 ) ;
m_Show_Page_Limits - > SetSelection ( g_ShowPageLimits ? 0 : 1 ) ;
wxString msg ;
msg = ReturnStringFromValue ( g_UnitMetric , g_RepeatStep . x , m_Parent - > m_InternalUnits ) ;
m_DeltaStepCtrl_X - > SetValue ( msg ) ;
wxString title = _ ( " Delta Step X " ) + ReturnUnitSymbol ( g_UnitMetric ) ;
2007-06-05 12:10:51 +00:00
m_DeltaStepXTitle - > SetLabel ( title ) ;
2008-04-17 16:25:29 +00:00
msg = ReturnStringFromValue ( g_UnitMetric , g_RepeatStep . y , m_Parent - > m_InternalUnits ) ;
m_DeltaStepCtrl_Y - > SetValue ( msg ) ;
title = _ ( " Delta Step Y " ) + ReturnUnitSymbol ( g_UnitMetric ) ;
2007-06-05 12:10:51 +00:00
m_DeltaStepYTitle - > SetLabel ( title ) ;
2008-04-17 16:25:29 +00:00
m_DeltaLabelCtrl - > SetValue ( g_RepeatDeltaLabel ) ;
2007-06-05 12:10:51 +00:00
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* WinEDA_SetOptionsFrame creator
*/
2008-04-17 16:25:29 +00:00
bool WinEDA_SetOptionsFrame : : Create ( wxWindow * parent ,
wxWindowID id ,
const wxString & caption ,
const wxPoint & pos ,
const wxSize & size ,
long style )
2007-06-05 12:10:51 +00:00
{
////@begin WinEDA_SetOptionsFrame member initialisation
m_DrawOptionsSizer = NULL ;
m_ShowGridOpt = NULL ;
m_SelGridSize = NULL ;
m_SelShowPins = NULL ;
2008-04-30 11:52:34 +00:00
m_AutoPANOpt = NULL ;
m_Selunits = NULL ;
2007-06-05 12:10:51 +00:00
m_LabelSizeCtrlSizer = NULL ;
2008-04-30 11:52:34 +00:00
m_SelDirWires = NULL ;
2007-06-05 12:10:51 +00:00
m_Show_Page_Limits = NULL ;
2008-04-30 11:52:34 +00:00
m_btClose = NULL ;
m_DeltaStepXTitle = NULL ;
m_DeltaStepCtrl_X = NULL ;
m_DeltaStepYTitle = NULL ;
m_DeltaStepCtrl_Y = NULL ;
m_DeltaIncTitle = NULL ;
m_DeltaLabelCtrl = NULL ;
2007-06-05 12:10:51 +00:00
////@end WinEDA_SetOptionsFrame member initialisation
////@begin WinEDA_SetOptionsFrame creation
2008-04-30 11:52:34 +00:00
SetExtraStyle ( wxWS_EX_BLOCK_EVENTS ) ;
2007-06-05 12:10:51 +00:00
wxDialog : : Create ( parent , id , caption , pos , size , style ) ;
CreateControls ( ) ;
2008-04-30 11:52:34 +00:00
if ( GetSizer ( ) )
2007-06-05 12:10:51 +00:00
{
2008-04-30 11:52:34 +00:00
GetSizer ( ) - > SetSizeHints ( this ) ;
2007-06-05 12:10:51 +00:00
}
Centre ( ) ;
////@end WinEDA_SetOptionsFrame creation
return true ;
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* Control creation for WinEDA_SetOptionsFrame
*/
void WinEDA_SetOptionsFrame : : CreateControls ( )
2008-04-17 16:25:29 +00:00
{
2007-06-05 12:10:51 +00:00
////@begin WinEDA_SetOptionsFrame content construction
2009-04-29 17:09:00 +00:00
// Generated by DialogBlocks, 27/04/2009 09:01:10 (unregistered)
2007-06-05 12:10:51 +00:00
WinEDA_SetOptionsFrame * itemDialog1 = this ;
2008-04-30 11:52:34 +00:00
wxBoxSizer * itemBoxSizer2 = new wxBoxSizer ( wxHORIZONTAL ) ;
itemDialog1 - > SetSizer ( itemBoxSizer2 ) ;
wxBoxSizer * itemBoxSizer3 = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer2 - > Add ( itemBoxSizer3 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
wxStaticBox * itemStaticBoxSizer4Static = new wxStaticBox ( itemDialog1 , wxID_ANY , _ ( " Draw Options: " ) ) ;
m_DrawOptionsSizer = new wxStaticBoxSizer ( itemStaticBoxSizer4Static , wxVERTICAL ) ;
itemBoxSizer3 - > Add ( m_DrawOptionsSizer , 0 , wxGROW | wxALL , 5 ) ;
m_ShowGridOpt = new wxCheckBox ( itemDialog1 , ID_CHECKBOX1 , _ ( " Show grid " ) , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_ShowGridOpt - > SetValue ( false ) ;
m_DrawOptionsSizer - > Add ( m_ShowGridOpt , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
wxArrayString m_SelGridSizeStrings ;
m_SelGridSizeStrings . Add ( _ ( " Normal (50 mils) " ) ) ;
m_SelGridSizeStrings . Add ( _ ( " Small (25 mils) " ) ) ;
m_SelGridSizeStrings . Add ( _ ( " Very small (10 mils) " ) ) ;
m_SelGridSizeStrings . Add ( _ ( " Special (5 mils) " ) ) ;
m_SelGridSizeStrings . Add ( _ ( " Special (2 mils) " ) ) ;
m_SelGridSizeStrings . Add ( _ ( " Special (1 mil) " ) ) ;
m_SelGridSize = new wxRadioBox ( itemDialog1 , ID_RADIOBOX , _ ( " Grid Size " ) , wxDefaultPosition , wxDefaultSize , m_SelGridSizeStrings , 1 , wxRA_SPECIFY_COLS ) ;
m_SelGridSize - > SetSelection ( 0 ) ;
itemBoxSizer3 - > Add ( m_SelGridSize , 0 , wxGROW | wxALL , 5 ) ;
wxArrayString m_SelShowPinsStrings ;
m_SelShowPinsStrings . Add ( _ ( " Normal " ) ) ;
m_SelShowPinsStrings . Add ( _ ( " Show alls " ) ) ;
m_SelShowPins = new wxRadioBox ( itemDialog1 , ID_RADIOBOX1 , _ ( " Show pins " ) , wxDefaultPosition , wxDefaultSize , m_SelShowPinsStrings , 1 , wxRA_SPECIFY_COLS ) ;
m_SelShowPins - > SetSelection ( 0 ) ;
itemBoxSizer3 - > Add ( m_SelShowPins , 0 , wxGROW | wxALL , 5 ) ;
wxBoxSizer * itemBoxSizer8 = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer2 - > Add ( itemBoxSizer8 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
m_AutoPANOpt = new wxCheckBox ( itemDialog1 , ID_CHECKBOX , _ ( " Auto PAN " ) , wxDefaultPosition , wxDefaultSize , wxCHK_2STATE ) ;
m_AutoPANOpt - > SetValue ( false ) ;
itemBoxSizer8 - > Add ( m_AutoPANOpt , 0 , wxGROW | wxALL , 5 ) ;
wxArrayString m_SelunitsStrings ;
m_SelunitsStrings . Add ( _ ( " millimeter " ) ) ;
m_SelunitsStrings . Add ( _ ( " inches " ) ) ;
m_Selunits = new wxRadioBox ( itemDialog1 , ID_RADIOBOX2 , _ ( " Units " ) , wxDefaultPosition , wxDefaultSize , m_SelunitsStrings , 1 , wxRA_SPECIFY_COLS ) ;
m_Selunits - > SetSelection ( 0 ) ;
itemBoxSizer8 - > Add ( m_Selunits , 0 , wxGROW | wxALL , 5 ) ;
m_LabelSizeCtrlSizer = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer8 - > Add ( m_LabelSizeCtrlSizer , 0 , wxGROW | wxALL , 5 ) ;
wxArrayString m_SelDirWiresStrings ;
m_SelDirWiresStrings . Add ( _ ( " Horiz/Vertical " ) ) ;
m_SelDirWiresStrings . Add ( _ ( " Any " ) ) ;
m_SelDirWires = new wxRadioBox ( itemDialog1 , ID_RADIOBOX3 , _ ( " Wires - Bus orient " ) , wxDefaultPosition , wxDefaultSize , m_SelDirWiresStrings , 1 , wxRA_SPECIFY_COLS ) ;
m_SelDirWires - > SetSelection ( 0 ) ;
itemBoxSizer8 - > Add ( m_SelDirWires , 0 , wxGROW | wxALL , 5 ) ;
wxArrayString m_Show_Page_LimitsStrings ;
m_Show_Page_LimitsStrings . Add ( _ ( " Yes " ) ) ;
m_Show_Page_LimitsStrings . Add ( _ ( " No " ) ) ;
m_Show_Page_Limits = new wxRadioBox ( itemDialog1 , ID_RADIOBOX4 , _ ( " Show page limits " ) , wxDefaultPosition , wxDefaultSize , m_Show_Page_LimitsStrings , 1 , wxRA_SPECIFY_COLS ) ;
m_Show_Page_Limits - > SetSelection ( 0 ) ;
itemBoxSizer8 - > Add ( m_Show_Page_Limits , 0 , wxGROW | wxALL , 5 ) ;
wxBoxSizer * itemBoxSizer14 = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer2 - > Add ( itemBoxSizer14 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
wxButton * itemButton15 = new wxButton ( itemDialog1 , wxID_OK , _ ( " &OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemButton15 - > SetDefault ( ) ;
itemBoxSizer14 - > Add ( itemButton15 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
m_btClose = new wxButton ( itemDialog1 , wxID_CANCEL , _ ( " &Cancel " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer14 - > Add ( m_btClose , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
itemBoxSizer14 - > Add ( 5 , 5 , 0 , wxGROW | wxALL , 5 ) ;
wxStaticBox * itemStaticBoxSizer18Static = new wxStaticBox ( itemDialog1 , wxID_ANY , _ ( " Auto increment params " ) ) ;
wxStaticBoxSizer * itemStaticBoxSizer18 = new wxStaticBoxSizer ( itemStaticBoxSizer18Static , wxVERTICAL ) ;
itemBoxSizer14 - > Add ( itemStaticBoxSizer18 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
m_DeltaStepXTitle = new wxStaticText ( itemDialog1 , wxID_STATIC , _ ( " Delta Step X " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaStepXTitle , 0 , wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE , 5 ) ;
m_DeltaStepCtrl_X = new wxTextCtrl ( itemDialog1 , ID_TEXTCTRL , _T ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaStepCtrl_X , 0 , wxGROW | wxALL , 5 ) ;
m_DeltaStepYTitle = new wxStaticText ( itemDialog1 , wxID_STATIC , _ ( " Delta Step Y " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaStepYTitle , 0 , wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE , 5 ) ;
m_DeltaStepCtrl_Y = new wxTextCtrl ( itemDialog1 , ID_TEXTCTRL1 , _T ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaStepCtrl_Y , 0 , wxGROW | wxALL , 5 ) ;
m_DeltaIncTitle = new wxStaticText ( itemDialog1 , wxID_STATIC , _ ( " Delta Label: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaIncTitle , 0 , wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE , 5 ) ;
m_DeltaLabelCtrl = new wxSpinCtrl ( itemDialog1 , ID_SPINCTRL , _T ( " 0 " ) , wxDefaultPosition , wxDefaultSize , wxSP_ARROW_KEYS , - 16 , 16 , 0 ) ;
itemStaticBoxSizer18 - > Add ( m_DeltaLabelCtrl , 0 , wxGROW | wxALL , 5 ) ;
2008-04-17 16:25:29 +00:00
////@end WinEDA_SetOptionsFrame content construction
2008-04-30 11:52:34 +00:00
m_btClose - > SetFocus ( ) ;
2008-04-17 16:25:29 +00:00
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl ( this , _ (
" Default Line Width " ) ,
2009-06-02 07:26:49 +00:00
g_DrawDefaultLineThickness ,
2008-04-17 16:25:29 +00:00
g_UnitMetric , m_DrawOptionsSizer ,
EESCHEMA_INTERNAL_UNIT ) ;
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl ( this , _ (
" Default Label Size " ) ,
g_DefaultTextLabelSize ,
g_UnitMetric , m_LabelSizeCtrlSizer ,
EESCHEMA_INTERNAL_UNIT ) ;
2007-06-05 12:10:51 +00:00
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* Should we show tooltips ?
*/
bool WinEDA_SetOptionsFrame : : ShowToolTips ( )
{
return true ;
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_SetOptionsFrame : : GetBitmapResource ( const wxString & name )
{
// Bitmap retrieval
////@begin WinEDA_SetOptionsFrame bitmap retrieval
2008-04-30 11:52:34 +00:00
wxUnusedVar ( name ) ;
2007-06-05 12:10:51 +00:00
return wxNullBitmap ;
////@end WinEDA_SetOptionsFrame bitmap retrieval
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* Get icon resources
*/
wxIcon WinEDA_SetOptionsFrame : : GetIconResource ( const wxString & name )
{
// Icon retrieval
////@begin WinEDA_SetOptionsFrame icon retrieval
2008-04-30 11:52:34 +00:00
wxUnusedVar ( name ) ;
2007-06-05 12:10:51 +00:00
return wxNullIcon ;
////@end WinEDA_SetOptionsFrame icon retrieval
}
2008-04-17 16:25:29 +00:00
2007-06-05 12:10:51 +00:00
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void WinEDA_SetOptionsFrame : : OnOkClick ( wxCommandEvent & event )
{
2008-04-17 16:25:29 +00:00
Accept ( event ) ;
2007-06-05 12:10:51 +00:00
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
// Before editing this code, remove the block markers.
event . Skip ( ) ;
2008-04-17 16:25:29 +00:00
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
2007-06-05 12:10:51 +00:00
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_SetOptionsFrame : : OnCancelClick ( wxCommandEvent & event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
// Before editing this code, remove the block markers.
event . Skip ( ) ;
2008-04-17 16:25:29 +00:00
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
2007-06-05 12:10:51 +00:00
}
/**************************************************************************/
2008-04-17 16:25:29 +00:00
void WinEDA_SetOptionsFrame : : Accept ( wxCommandEvent & event )
2007-06-05 12:10:51 +00:00
/**************************************************************************/
{
2009-02-07 08:33:25 +00:00
wxRealPoint grid ;
2008-04-17 16:25:29 +00:00
wxString msg ;
2009-06-02 07:26:49 +00:00
g_DrawDefaultLineThickness = m_DefaultDrawLineWidthCtrl - > GetValue ( ) ;
if ( g_DrawDefaultLineThickness < 0 )
g_DrawDefaultLineThickness = 0 ;
if ( g_DrawDefaultLineThickness > 100 )
g_DrawDefaultLineThickness = 100 ;
2008-04-17 16:25:29 +00:00
g_DefaultTextLabelSize = m_DefaultLabelSizeCtrl - > GetValue ( ) ;
if ( g_DefaultTextLabelSize < 0 )
g_DefaultTextLabelSize = 0 ;
if ( g_DefaultTextLabelSize > 1000 )
g_DefaultTextLabelSize = 1000 ;
msg = m_DeltaStepCtrl_X - > GetValue ( ) ;
g_RepeatStep . x =
ReturnValueFromString ( g_UnitMetric , msg , m_Parent - > m_InternalUnits ) ;
msg = m_DeltaStepCtrl_Y - > GetValue ( ) ;
g_RepeatStep . y =
ReturnValueFromString ( g_UnitMetric , msg , m_Parent - > m_InternalUnits ) ;
g_RepeatDeltaLabel = m_DeltaLabelCtrl - > GetValue ( ) ;
if ( m_Show_Page_Limits - > GetSelection ( ) = = 0 )
g_ShowPageLimits = TRUE ;
else
g_ShowPageLimits = FALSE ;
if ( m_SelDirWires - > GetSelection ( ) = = 0 )
2009-05-01 18:06:03 +00:00
g_HVLines = true ;
2008-04-17 16:25:29 +00:00
else
2009-05-01 18:06:03 +00:00
g_HVLines = false ;
2008-04-17 16:25:29 +00:00
if ( m_Selunits - > GetSelection ( ) = = 0 )
g_UnitMetric = 1 ;
else
g_UnitMetric = 0 ;
if ( m_SelShowPins - > GetSelection ( ) = = 0 )
2009-04-29 17:09:00 +00:00
m_Parent - > m_ShowAllPins = false ;
2008-04-17 16:25:29 +00:00
else
2009-04-29 17:09:00 +00:00
m_Parent - > m_ShowAllPins = true ;
2008-04-17 16:25:29 +00:00
2009-04-05 20:49:15 +00:00
m_Parent - > m_Draw_Grid = m_ShowGridOpt - > GetValue ( ) ;
2008-04-17 16:25:29 +00:00
m_Parent - > DrawPanel - > m_AutoPAN_Enable = m_AutoPANOpt - > GetValue ( ) ;
m_Parent - > m_Draw_Grid = m_ShowGridOpt - > GetValue ( ) ;
switch ( m_SelGridSize - > GetSelection ( ) )
{
default :
break ;
2007-06-05 12:10:51 +00:00
2008-04-17 16:25:29 +00:00
case 0 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 50 , 50 ) ;
2008-04-17 16:25:29 +00:00
break ;
case 1 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 25 , 25 ) ;
2008-04-17 16:25:29 +00:00
break ;
case 2 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 10 , 10 ) ;
2008-04-17 16:25:29 +00:00
break ;
2008-10-30 10:55:46 +00:00
case 3 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 5 , 5 ) ;
2008-10-30 10:55:46 +00:00
break ;
case 4 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 2 , 2 ) ;
2008-10-30 10:55:46 +00:00
break ;
case 5 :
2009-02-07 08:33:25 +00:00
grid = wxRealPoint ( 1 , 1 ) ;
2008-10-30 10:55:46 +00:00
break ;
2008-04-17 16:25:29 +00:00
}
if ( m_Parent - > GetBaseScreen ( ) )
{
2008-10-30 10:55:46 +00:00
m_Parent - > GetBaseScreen ( ) - > SetGrid ( grid ) ;
2008-04-17 16:25:29 +00:00
m_Parent - > GetBaseScreen ( ) - > SetRefreshReq ( ) ;
}
}