Commit bbd8cdd9 authored by charras's avatar charras

minor enhancements, fixes an code cleanup (removed unused global variables)

parent ec6a84d0
...@@ -116,7 +116,9 @@ void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event ) ...@@ -116,7 +116,9 @@ void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event )
fn = g_RootSheet->m_AssociatedScreen->m_FileName; fn = g_RootSheet->m_AssociatedScreen->m_FileName;
if( fn.GetFullName() != wxT( "noname.sch" ) ) wxString default_name = NAMELESS_PROJECT;
default_name += wxT( ".sch" );
if( fn.GetFullName() != default_name )
{ {
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() ); wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
......
...@@ -109,7 +109,8 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, ...@@ -109,7 +109,8 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName,
screen->m_CurrentSheetDesc = &g_Sheet_A4; screen->m_CurrentSheetDesc = &g_Sheet_A4;
screen->SetZoom( 32 ); screen->SetZoom( 32 );
screen->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); screen->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
screen->m_Title = wxT( "noname.sch" ); screen->m_Title = NAMELESS_PROJECT;
screen->m_Title += wxT( ".sch" );
GetScreen()->m_FileName = screen->m_Title; GetScreen()->m_FileName = screen->m_Title;
screen->m_Company.Empty(); screen->m_Company.Empty();
screen->m_Commentaire1.Empty(); screen->m_Commentaire1.Empty();
......
...@@ -155,7 +155,8 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -155,7 +155,8 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
m_TextFieldSize = DEFAULT_SIZE_TEXT; m_TextFieldSize = DEFAULT_SIZE_TEXT;
m_LibeditFrame = NULL; // Component editor frame. m_LibeditFrame = NULL; // Component editor frame.
m_ViewlibFrame = NULL; // Frame for browsing component libraries m_ViewlibFrame = NULL; // Frame for browsing component libraries
m_DefaultSchematicFileName = wxT( "noname.sch" ); m_DefaultSchematicFileName = NAMELESS_PROJECT;
m_DefaultSchematicFileName += wxT( ".sch" );
m_ShowAllPins = false; m_ShowAllPins = false;
m_previewPosition = wxDefaultPosition; m_previewPosition = wxDefaultPosition;
m_previewSize = wxDefaultSize; m_previewSize = wxDefaultSize;
......
...@@ -29,6 +29,9 @@ class WinEDA_DrawPanel; ...@@ -29,6 +29,9 @@ class WinEDA_DrawPanel;
* flag for block commands * flag for block commands
*/ */
// default name for nameless projects
#define NAMELESS_PROJECT wxT("noname")
#define NB_ITEMS 11 #define NB_ITEMS 11
/* Pseudo key codes for command panning */ /* Pseudo key codes for command panning */
......
No preview for this file type
This diff is collapsed.
...@@ -99,7 +99,7 @@ bool WinEDA_App::OnInit() ...@@ -99,7 +99,7 @@ bool WinEDA_App::OnInit()
GetSettings(reopenLastUsedDirectory); GetSettings(reopenLastUsedDirectory);
/* Make nameless project translatable */ /* Make nameless project translatable */
wxFileName namelessProject( wxGetCwd(), _( "noname" ), ProjectFileExtension ); wxFileName namelessProject( wxGetCwd(), NAMELESS_PROJECT, ProjectFileExtension );
frame = new WinEDA_MainFrame( NULL, wxT( "KiCad" ), frame = new WinEDA_MainFrame( NULL, wxT( "KiCad" ),
wxPoint( 30, 20 ), wxSize( 600, 400 ) ); wxPoint( 30, 20 ), wxSize( 600, 400 ) );
......
...@@ -100,7 +100,9 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event ) ...@@ -100,7 +100,9 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
/* Check if project file exists and if it is not noname.pro */ /* Check if project file exists and if it is not noname.pro */
wxString filename = m_ProjectFileName.GetFullName(); wxString filename = m_ProjectFileName.GetFullName();
if( !m_ProjectFileName.FileExists() && !filename.IsSameAs(wxT("noname.pro"))) wxString nameless_prj = NAMELESS_PROJECT;
nameless_prj += wxT(".pro");
if( !m_ProjectFileName.FileExists() && !filename.IsSameAs(nameless_prj))
{ {
DisplayError( this, _( "Kicad project file <" ) + DisplayError( this, _( "Kicad project file <" ) +
m_ProjectFileName.GetFullPath() + _( "> not found" ) ); m_ProjectFileName.GetFullPath() + _( "> not found" ) );
......
...@@ -518,7 +518,9 @@ void TREE_PROJECT_FRAME::NewFile( TreeFileType type ) ...@@ -518,7 +518,9 @@ void TREE_PROJECT_FRAME::NewFile( TreeFileType type )
dir = wxGetCwd() + wxFileName().GetPathSeparator() + treeData->GetDir(); dir = wxGetCwd() + wxFileName().GetPathSeparator() + treeData->GetDir();
// Ask for the new file name // Ask for the new file name
wxFileDialog dlg( this, title, dir, _( "noname." ) + mask, wxString nameless_prj = NAMELESS_PROJECT;
nameless_prj += wxT(".") + mask;
wxFileDialog dlg( this, title, dir, nameless_prj,
wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
...@@ -863,7 +865,7 @@ void TREE_PROJECT_FRAME::ReCreateTreePrj() ...@@ -863,7 +865,7 @@ void TREE_PROJECT_FRAME::ReCreateTreePrj()
{ {
fn.Clear(); fn.Clear();
fn.SetPath( ::wxGetCwd() ); fn.SetPath( ::wxGetCwd() );
fn.SetName( wxT( "noname" ) ); fn.SetName( NAMELESS_PROJECT );
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
} }
else else
......
...@@ -59,7 +59,8 @@ set(PCBNEW_SRCS ...@@ -59,7 +59,8 @@ set(PCBNEW_SRCS
dialog_global_edit_tracks_and_vias.cpp dialog_global_edit_tracks_and_vias.cpp
dialog_global_edit_tracks_and_vias_base.cpp dialog_global_edit_tracks_and_vias_base.cpp
dialog_global_pads_edition_base.cpp dialog_global_pads_edition_base.cpp
# dialog_graphic_items_options.cpp dialog_graphic_items_options.cpp
dialog_graphic_items_options_base.cpp
dialog_graphic_item_properties.cpp dialog_graphic_item_properties.cpp
dialog_graphic_item_properties_base.cpp dialog_graphic_item_properties_base.cpp
# dialog_initpcb.cpp # dialog_initpcb.cpp
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#define WIDTH_MAX_VALUE 500 #define WIDTH_MAX_VALUE 500
#define WIDTH_MIN_VALUE 1 #define WIDTH_MIN_VALUE 1
extern int g_DrawDefaultLineThickness;
// Local variables: // Local variables:
static PRINT_PARAMETERS s_Parameters; static PRINT_PARAMETERS s_Parameters;
static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
...@@ -88,10 +90,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) ...@@ -88,10 +90,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
m_ImageXSize_mm = 270; m_ImageXSize_mm = 270;
if( m_Config ) if( m_Config )
{ {
m_Config->Read( OPTKEY_PLOT_LINEWIDTH_VALUE, &s_Parameters.m_PenDefaultSize );
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White ); m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White );
} }
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); AddUnitSymbol( *m_TextPenWidth, g_UnitMetric );
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize,
...@@ -159,6 +161,7 @@ void DIALOG_SVG_PRINT::SetPenWidth() ...@@ -159,6 +161,7 @@ void DIALOG_SVG_PRINT::SetPenWidth()
s_Parameters.m_PenDefaultSize = WIDTH_MIN_VALUE; s_Parameters.m_PenDefaultSize = WIDTH_MIN_VALUE;
} }
g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize,
m_Parent->m_InternalUnits ) ); m_Parent->m_InternalUnits ) );
...@@ -303,7 +306,6 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) ...@@ -303,7 +306,6 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection(); s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
if( m_Config ) if( m_Config )
{ {
m_Config->Write( OPTKEY_PLOT_LINEWIDTH_VALUE, s_Parameters.m_PenDefaultSize );
m_Config->Write( PLOTSVGMODECOLOR_KEY, s_Parameters.m_Print_Black_and_White ); m_Config->Write( PLOTSVGMODECOLOR_KEY, s_Parameters.m_Print_Black_and_White );
wxString layerKey; wxString layerKey;
for( int layer = 0; layer<NB_LAYERS; ++layer ) for( int layer = 0; layer<NB_LAYERS; ++layer )
......
...@@ -103,35 +103,6 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) ...@@ -103,35 +103,6 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
} }
#include "dialog_graphic_items_options.cpp"
void WinEDA_PcbFrame::InstallPcbOptionsFrame( int id )
{
switch( id )
{
case ID_PCB_DRAWINGS_WIDTHS_SETUP:
{
WinEDA_GraphicItemsOptionsDialog dlg( this );
dlg.ShowModal();
}
break;
default:
wxMessageBox( wxT( "InstallPcbOptionsFrame() id error" ) );
break;
}
}
void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos )
{
WinEDA_GraphicItemsOptionsDialog dlg( this );
dlg.ShowModal();
}
/* Must be called on a click on the left toolbar (options toolbar /* Must be called on a click on the left toolbar (options toolbar
* Update variables according to tools states * Update variables according to tools states
*/ */
......
...@@ -257,60 +257,6 @@ ...@@ -257,60 +257,6 @@
<property name="name">bMiddleLeftSizer</property> <property name="name">bMiddleLeftSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;1&quot; &quot;2&quot; &quot;4&quot; &quot;6&quot; &quot;8&quot; &quot;10&quot; &quot;12&quot; &quot;14&quot; &quot;16&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_LAYER_NUMBER</property>
<property name="label">Layers:</property>
<property name="majorDimension">3</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_LayerNumber</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip">Active copper layers count selection</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
......
...@@ -31,55 +31,53 @@ ...@@ -31,55 +31,53 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DialogGeneralOptionsBoardEditor_base : public wxDialog class DialogGeneralOptionsBoardEditor_base : public wxDialog
{ {
private: private:
protected: protected:
enum enum
{ {
wxID_POLAR_CTRL = 1000, wxID_POLAR_CTRL = 1000,
wxID_UNITS, wxID_UNITS,
wxID_CURSOR_SHAPE, wxID_CURSOR_SHAPE,
// wxID_LAYER_NUMBER, wxID_DRC_ONOFF,
wxID_DRC_ONOFF, wxID_GENERAL_RATSNEST,
wxID_GENERAL_RATSNEST, wxID_RATSNEST_MODULE,
wxID_RATSNEST_MODULE, wxID_TRACK_AUTODEL,
wxID_TRACK_AUTODEL, wxID_TRACKS45,
wxID_TRACKS45, wxID_SEGMENTS45,
wxID_SEGMENTS45, wxID_AUTOPAN,
wxID_AUTOPAN, wxID_MAGNETIC_TRACKS,
wxID_MAGNETIC_TRACKS, };
};
wxRadioBox* m_PolarDisplay;
wxRadioBox* m_PolarDisplay; wxRadioBox* m_UnitsSelection;
wxRadioBox* m_UnitsSelection; wxRadioBox* m_CursorShape;
wxRadioBox* m_CursorShape; wxStaticText* m_staticTextmaxlinks;
//wxRadioBox* m_LayerNumber; wxSpinCtrl* m_MaxShowLinks;
wxStaticText* m_staticTextmaxlinks; wxStaticText* m_staticTextautosave;
wxSpinCtrl* m_MaxShowLinks; wxSpinCtrl* m_SaveTime;
wxStaticText* m_staticTextautosave; wxCheckBox* m_DrcOn;
wxSpinCtrl* m_SaveTime; wxCheckBox* m_ShowGlobalRatsnest;
wxCheckBox* m_DrcOn; wxCheckBox* m_ShowModuleRatsnest;
wxCheckBox* m_ShowGlobalRatsnest; wxCheckBox* m_TrackAutodel;
wxCheckBox* m_ShowModuleRatsnest; wxCheckBox* m_Track_45_Only_Ctrl;
wxCheckBox* m_TrackAutodel; wxCheckBox* m_Segments_45_Only_Ctrl;
wxCheckBox* m_Track_45_Only_Ctrl; wxCheckBox* m_AutoPANOpt;
wxCheckBox* m_Segments_45_Only_Ctrl; wxCheckBox* m_Track_DoubleSegm_Ctrl;
wxCheckBox* m_AutoPANOpt; wxRadioBox* m_MagneticPadOptCtrl;
wxCheckBox* m_Track_DoubleSegm_Ctrl; wxRadioBox* m_MagneticTrackOptCtrl;
wxRadioBox* m_MagneticPadOptCtrl; wxButton* m_buttonOK;
wxRadioBox* m_MagneticTrackOptCtrl; wxButton* m_buttonCANCEL;
wxButton* m_buttonOK;
wxButton* m_buttonCANCEL; // Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
// Virtual event handlers, overide them in your derived class virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DialogGeneralOptionsBoardEditor_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 585,280 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
public: ~DialogGeneralOptionsBoardEditor_base();
DialogGeneralOptionsBoardEditor_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 585,280 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DialogGeneralOptionsBoardEditor_base();
}; };
#endif //__dialog_general_options_BoardEditor_base__ #endif //__dialog_general_options_BoardEditor_base__
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_graphic_items_options.h // Name: dialog_graphic_items_options.h
// Purpose: //////////////////////////////////////////////////////////////////////////////*
// Author: jean-pierre Charras /*
// Modified by: * This program source code file is part of KICAD, a free EDA CAD application.
// Created: 25/02/2006 09:53:27 *
// RCS-ID: * Copyright (C) 1992-2010 <Jean-Pierre Charras> jean-pierre.charras@gipsa-lab.inpg.fr
// Copyright: License GNU * Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
// Licence: *
///////////////////////////////////////////////////////////////////////////// * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
// Generated by DialogBlocks (unregistered), 25/02/2006 09:53:27 * 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 _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_ #ifndef _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_
#define _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_ #define _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_
/*! #include "dialog_graphic_items_options_base.h"
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_TEXTCTRL_SEGW 10001
#define ID_TEXTCTRL_EDGES 10002
#define ID_TEXTCTRL_TEXTW 10003
#define ID_TEXTCTRL_TEXTV 10004
#define ID_TEXTCTRL_TEXTH 10005
#define ID_TEXTCTRL_EDGEMOD_W 10006
#define ID_TEXTCTRL_TXTMOD_W 10007
#define ID_TEXTCTRL_TXTMOD_V 10008
#define ID_TEXTCTRL_TXTMOD_H 10009
#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_TITLE _("Texts and Drawings")
#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*! /*!
* WinEDA_GraphicItemsOptionsDialog class declaration * DIALOG_GRAPHIC_ITEMS_OPTIONS class declaration
*/ */
class WinEDA_GraphicItemsOptionsDialog: public wxDialog class DIALOG_GRAPHIC_ITEMS_OPTIONS: public DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE
{ {
DECLARE_EVENT_TABLE()
public: public:
BOARD_DESIGN_SETTINGS* m_BrdSettings; BOARD_DESIGN_SETTINGS* m_BrdSettings;
WinEDA_BasePcbFrame * m_Parent;
/// Constructors public:
WinEDA_GraphicItemsOptionsDialog( WinEDA_BasePcbFrame* parent, wxWindowID id = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_IDNAME, const wxString& caption = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_TITLE, const wxPoint& pos = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_POSITION, const wxSize& size = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_SIZE, long style = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_STYLE ); DIALOG_GRAPHIC_ITEMS_OPTIONS( WinEDA_BasePcbFrame* parent );
~DIALOG_GRAPHIC_ITEMS_OPTIONS( );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_IDNAME, const wxString& caption = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_TITLE, const wxPoint& pos = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_POSITION, const wxSize& size = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_SIZE, long style = SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_GraphicItemsOptionsDialog event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK private:
void initValues( );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_GraphicItemsOptionsDialog event handler declarations
////@begin WinEDA_GraphicItemsOptionsDialog member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_GraphicItemsOptionsDialog member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void AcceptOptions(wxCommandEvent& event);
void SetDisplayValue();
////@begin WinEDA_GraphicItemsOptionsDialog member variables
wxStaticText* m_GraphicSegmWidthTitle;
wxTextCtrl* m_OptPcbSegmWidth;
wxStaticText* m_BoardEdgesWidthTitle;
wxTextCtrl* m_OptPcbEdgesWidth;
wxStaticText* m_CopperTextWidthTitle;
wxTextCtrl* m_OptPcbTextWidth;
wxStaticText* m_TextSizeVTitle;
wxTextCtrl* m_OptPcbTextVSize;
wxStaticText* m_TextSizeHTitle;
wxTextCtrl* m_OptPcbTextHSize;
wxStaticText* m_EdgeModWidthTitle;
wxTextCtrl* m_OptModuleEdgesWidth;
wxStaticText* m_TextModWidthTitle;
wxTextCtrl* m_OptModuleTextWidth;
wxStaticText* m_TextModSizeVTitle;
wxTextCtrl* m_OptModuleTextVSize;
wxStaticText* m_TextModSizeHTitle;
wxTextCtrl* m_OptModuleTextHSize;
////@end WinEDA_GraphicItemsOptionsDialog member variables
WinEDA_BasePcbFrame * m_Parent;
}; };
#endif #endif
......
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_graphic_items_options_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_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* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizerLeft;
sbSizerLeft = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Graphics:") ), wxVERTICAL );
m_GraphicSegmWidthTitle = new wxStaticText( this, wxID_ANY, _("Graphic segm Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_GraphicSegmWidthTitle->Wrap( -1 );
sbSizerLeft->Add( m_GraphicSegmWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptPcbSegmWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_OptPcbSegmWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_BoardEdgesWidthTitle = new wxStaticText( this, wxID_ANY, _("Board Edges Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_BoardEdgesWidthTitle->Wrap( -1 );
sbSizerLeft->Add( m_BoardEdgesWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptPcbEdgesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_OptPcbEdgesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_CopperTextWidthTitle = new wxStaticText( this, wxID_ANY, _("Copper Text Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_CopperTextWidthTitle->Wrap( -1 );
sbSizerLeft->Add( m_CopperTextWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptPcbTextWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_OptPcbTextWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TextSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text Size V"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeVTitle->Wrap( -1 );
sbSizerLeft->Add( m_TextSizeVTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptPcbTextVSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_OptPcbTextVSize, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TextSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text Size H"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeHTitle->Wrap( -1 );
sbSizerLeft->Add( m_TextSizeHTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptPcbTextHSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_OptPcbTextHSize, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerUpper->Add( sbSizerLeft, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizerMiddle;
sbSizerMiddle = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Modules:") ), wxVERTICAL );
m_EdgeModWidthTitle = new wxStaticText( this, wxID_ANY, _("Edges Module Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_EdgeModWidthTitle->Wrap( -1 );
sbSizerMiddle->Add( m_EdgeModWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptModuleEdgesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerMiddle->Add( m_OptModuleEdgesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("Text Module Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextModWidthTitle->Wrap( -1 );
sbSizerMiddle->Add( m_TextModWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptModuleTextWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerMiddle->Add( m_OptModuleTextWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text Module Size V"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextModSizeVTitle->Wrap( -1 );
sbSizerMiddle->Add( m_TextModSizeVTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptModuleTextVSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerMiddle->Add( m_OptModuleTextVSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text Module Size H"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextModSizeHTitle->Wrap( -1 );
sbSizerMiddle->Add( m_TextModSizeHTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptModuleTextHSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerMiddle->Add( m_OptModuleTextHSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizerUpper->Add( sbSizerMiddle, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizerRight;
sbSizerRight = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General:") ), wxVERTICAL );
m_DefaultPenSizeTitle = new wxStaticText( this, wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_DefaultPenSizeTitle->Wrap( -1 );
m_DefaultPenSizeTitle->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
sbSizerRight->Add( m_DefaultPenSizeTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DefaultPenSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerRight->Add( m_DefaultPenSizeCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerUpper->Add( sbSizerRight, 1, wxEXPAND|wxALL, 5 );
bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizerMain->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxEXPAND|wxTOP|wxBOTTOM, 5 );
this->SetSizer( bSizerMain );
this->Layout();
// Connect Events
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnOkClick ), NULL, this );
}
DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::~DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE()
{
// Disconnect Events
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnOkClick ), 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_graphic_items_options_base__
#define __dialog_graphic_items_options_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_GraphicSegmWidthTitle;
wxTextCtrl* m_OptPcbSegmWidth;
wxStaticText* m_BoardEdgesWidthTitle;
wxTextCtrl* m_OptPcbEdgesWidth;
wxStaticText* m_CopperTextWidthTitle;
wxTextCtrl* m_OptPcbTextWidth;
wxStaticText* m_TextSizeVTitle;
wxTextCtrl* m_OptPcbTextVSize;
wxStaticText* m_TextSizeHTitle;
wxTextCtrl* m_OptPcbTextHSize;
wxStaticText* m_EdgeModWidthTitle;
wxTextCtrl* m_OptModuleEdgesWidth;
wxStaticText* m_TextModWidthTitle;
wxTextCtrl* m_OptModuleTextWidth;
wxStaticText* m_TextModSizeVTitle;
wxTextCtrl* m_OptModuleTextVSize;
wxStaticText* m_TextModSizeHTitle;
wxTextCtrl* m_OptModuleTextHSize;
wxStaticText* m_DefaultPenSizeTitle;
wxTextCtrl* m_DefaultPenSizeCtrl;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Texts and Drawings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 459,315 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE();
};
#endif //__dialog_graphic_items_options_base__
...@@ -171,8 +171,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -171,8 +171,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bButtonsSizer->Add( m_PlotNoViaOnMaskOpt, 0, wxALL, 5 ); bButtonsSizer->Add( m_PlotNoViaOnMaskOpt, 0, wxALL, 5 );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Line width"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText6 = new wxStaticText( this, wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 ); m_staticText6->Wrap( -1 );
m_staticText6->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
bButtonsSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bButtonsSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LinesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_LinesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
......
...@@ -1368,7 +1368,7 @@ ...@@ -1368,7 +1368,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Line width</property> <property name="label">Default pen size:</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_staticText6</property> <property name="name">m_staticText6</property>
...@@ -1377,7 +1377,7 @@ ...@@ -1377,7 +1377,7 @@
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip">Pen size used to draw items that have no pen size specified.&#x0A;Used mainly to draw items in sketch mode.</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
......
...@@ -102,11 +102,12 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( ) ...@@ -102,11 +102,12 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( )
int scale_Select = 3; // default selected scale = ScaleList[3] = 1 int scale_Select = 3; // default selected scale = ScaleList[3] = 1
if( m_Config ) if( m_Config )
{ {
m_Config->Read( OPTKEY_PLOT_LINEWIDTH_VALUE, &s_Parameters.m_PenDefaultSize );
m_Config->Read( OPTKEY_PRINT_MODULE_SCALE, &scale_Select ); m_Config->Read( OPTKEY_PRINT_MODULE_SCALE, &scale_Select );
m_Config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1); m_Config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1);
} }
extern int g_DrawDefaultLineThickness;
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
m_ScaleOption->SetSelection( scale_Select ); m_ScaleOption->SetSelection( scale_Select );
if( s_Parameters.m_Print_Black_and_White ) if( s_Parameters.m_Print_Black_and_White )
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#define WIDTH_MAX_VALUE 1000 #define WIDTH_MAX_VALUE 1000
#define WIDTH_MIN_VALUE 1 #define WIDTH_MIN_VALUE 1
extern int g_DrawDefaultLineThickness;
// Local variables
static long s_SelectedLayers; static long s_SelectedLayers;
static double s_ScaleList[] = static double s_ScaleList[] =
{ 0, 0.5, 0.7, 0.999, 1.0, 1.4, 2.0, 3.0, 4.0 }; { 0, 0.5, 0.7, 0.999, 1.0, 1.4, 2.0, 3.0, 4.0 };
...@@ -33,7 +37,6 @@ static double s_ScaleList[] = ...@@ -33,7 +37,6 @@ static double s_ScaleList[] =
// static print data and page setup data, to remember settings during the session // static print data and page setup data, to remember settings during the session
static wxPrintData* g_PrintData; static wxPrintData* g_PrintData;
// Variables locales
static PRINT_PARAMETERS s_Parameters; static PRINT_PARAMETERS s_Parameters;
...@@ -190,7 +193,6 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) ...@@ -190,7 +193,6 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
if( m_Config ) if( m_Config )
{ {
m_Config->Read( OPTKEY_PLOT_LINEWIDTH_VALUE, &s_Parameters.m_PenDefaultSize );
m_Config->Read( OPTKEY_PRINT_X_FINESCALE_ADJ, &s_Parameters.m_XScaleAdjust ); m_Config->Read( OPTKEY_PRINT_X_FINESCALE_ADJ, &s_Parameters.m_XScaleAdjust );
m_Config->Read( OPTKEY_PRINT_Y_FINESCALE_ADJ, &s_Parameters.m_YScaleAdjust ); m_Config->Read( OPTKEY_PRINT_Y_FINESCALE_ADJ, &s_Parameters.m_YScaleAdjust );
m_Config->Read( OPTKEY_PRINT_SCALE, &scale_idx ); m_Config->Read( OPTKEY_PRINT_SCALE, &scale_idx );
...@@ -241,6 +243,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) ...@@ -241,6 +243,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
else else
m_ModeColorOption->SetSelection( 0 ); m_ModeColorOption->SetSelection( 0 );
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); AddUnitSymbol( *m_TextPenWidth, g_UnitMetric );
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) );
...@@ -321,7 +324,6 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) ...@@ -321,7 +324,6 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event )
if( m_Config ) if( m_Config )
{ {
m_Config->Write( OPTKEY_PLOT_LINEWIDTH_VALUE, s_Parameters.m_PenDefaultSize );
m_Config->Write( OPTKEY_PRINT_X_FINESCALE_ADJ, s_Parameters.m_XScaleAdjust ); m_Config->Write( OPTKEY_PRINT_X_FINESCALE_ADJ, s_Parameters.m_XScaleAdjust );
m_Config->Write( OPTKEY_PRINT_Y_FINESCALE_ADJ, s_Parameters.m_YScaleAdjust ); m_Config->Write( OPTKEY_PRINT_Y_FINESCALE_ADJ, s_Parameters.m_YScaleAdjust );
m_Config->Write( OPTKEY_PRINT_SCALE, m_ScaleOption->GetSelection() ); m_Config->Write( OPTKEY_PRINT_SCALE, m_ScaleOption->GetSelection() );
...@@ -404,6 +406,8 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth() ...@@ -404,6 +406,8 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth()
s_Parameters.m_PenDefaultSize = WIDTH_MIN_VALUE; s_Parameters.m_PenDefaultSize = WIDTH_MIN_VALUE;
} }
g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) );
} }
......
...@@ -75,7 +75,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare ...@@ -75,7 +75,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
wxStaticBoxSizer* sbOptionsSizer; wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default Pen Size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPenWidth->Wrap( -1 ); m_TextPenWidth->Wrap( -1 );
m_TextPenWidth->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); m_TextPenWidth->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
...@@ -135,6 +135,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare ...@@ -135,6 +135,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonQuit->SetDefault();
bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
......
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Default Pen Size:</property> <property name="label">Default pen size:</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_TextPenWidth</property> <property name="name">m_TextPenWidth</property>
......
...@@ -48,9 +48,10 @@ ...@@ -48,9 +48,10 @@
#include "class_pcb_layer_widget.h" #include "class_pcb_layer_widget.h"
#include "hotkeys.h" #include "hotkeys.h"
extern int g_DrawDefaultLineThickness;
// Keys used in read/write config // Keys used in read/write config
#define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth" )
#define PCB_SHOW_FULL_RATSNET_OPT wxT( "PcbFulRatsnest" ) #define PCB_SHOW_FULL_RATSNET_OPT wxT( "PcbFulRatsnest" )
#define PCB_MAGNETIC_PADS_OPT wxT( "PcbMagPadOpt" ) #define PCB_MAGNETIC_PADS_OPT wxT( "PcbMagPadOpt" )
#define PCB_MAGNETIC_TRACKS_OPT wxT( "PcbMagTrackOpt" ) #define PCB_MAGNETIC_TRACKS_OPT wxT( "PcbMagTrackOpt" )
...@@ -494,6 +495,7 @@ void WinEDA_PcbFrame::LoadSettings() ...@@ -494,6 +495,7 @@ void WinEDA_PcbFrame::LoadSettings()
WinEDA_BasePcbFrame::LoadSettings(); WinEDA_BasePcbFrame::LoadSettings();
long tmp; long tmp;
config->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &g_DrawDefaultLineThickness );
config->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp ); config->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp );
GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp); GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp);
config->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption ); config->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption );
...@@ -514,6 +516,7 @@ void WinEDA_PcbFrame::SaveSettings() ...@@ -514,6 +516,7 @@ void WinEDA_PcbFrame::SaveSettings()
wxRealPoint GridSize = GetScreen()->GetGridSize(); wxRealPoint GridSize = GetScreen()->GetGridSize();
config->Write( OPTKEY_DEFAULT_LINEWIDTH_VALUE, g_DrawDefaultLineThickness );
long tmp = GetBoard()->IsElementVisible(RATSNEST_VISIBLE); long tmp = GetBoard()->IsElementVisible(RATSNEST_VISIBLE);
config->Write( PCB_SHOW_FULL_RATSNET_OPT, tmp ); config->Write( PCB_SHOW_FULL_RATSNET_OPT, tmp );
config->Write( PCB_MAGNETIC_PADS_OPT, (long) g_MagneticPadOption ); config->Write( PCB_MAGNETIC_PADS_OPT, (long) g_MagneticPadOption );
......
...@@ -31,10 +31,13 @@ ...@@ -31,10 +31,13 @@
// Colors for layers and items // Colors for layers and items
COLORS_DESIGN_SETTINGS g_ColorsSettings; COLORS_DESIGN_SETTINGS g_ColorsSettings;
int g_DrawDefaultLineThickness = 60; /* Default line thickness in PCBNEW units used to
* draw/plot items having a
* default thickness line value (Frame references)
* (i.e. = 0 ). 0 = single pixel line width */
bool Drc_On = true; bool Drc_On = true;
bool g_AutoDeleteOldTrack = true; bool g_AutoDeleteOldTrack = true;
bool g_No_Via_Route;
bool g_Drag_Pistes_On; bool g_Drag_Pistes_On;
bool g_Show_Module_Ratsnest; bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true; bool g_Show_Pads_Module_in_Move = true;
...@@ -45,7 +48,6 @@ bool g_TwoSegmentTrackBuild = true; ...@@ -45,7 +48,6 @@ bool g_TwoSegmentTrackBuild = true;
bool g_HighLight_Status; bool g_HighLight_Status;
extern PARAM_CFG_BASE* ParamCfgList[]; extern PARAM_CFG_BASE* ParamCfgList[];
int Angle_Rot_Module;
int ModuleSegmentWidth; int ModuleSegmentWidth;
int ModuleTextWidth; int ModuleTextWidth;
int Route_Layer_TOP; int Route_Layer_TOP;
...@@ -77,7 +79,7 @@ IMPLEMENT_APP( WinEDA_App ) ...@@ -77,7 +79,7 @@ IMPLEMENT_APP( WinEDA_App )
void WinEDA_App::MacOpenFile(const wxString &fileName) { void WinEDA_App::MacOpenFile(const wxString &fileName) {
wxFileName filename = fileName; wxFileName filename = fileName;
WinEDA_PcbFrame * frame = ((WinEDA_PcbFrame*) GetTopWindow()); WinEDA_PcbFrame * frame = ((WinEDA_PcbFrame*) GetTopWindow());
if(!filename.FileExists()) if(!filename.FileExists())
return; return;
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
/* variables */ /* variables */
extern bool Drc_On; extern bool Drc_On;
extern bool g_AutoDeleteOldTrack; extern bool g_AutoDeleteOldTrack;
extern bool g_No_Via_Route;
extern bool g_Drag_Pistes_On; extern bool g_Drag_Pistes_On;
extern bool g_Show_Module_Ratsnest; extern bool g_Show_Module_Ratsnest;
extern bool g_Show_Pads_Module_in_Move; extern bool g_Show_Pads_Module_in_Move;
...@@ -67,7 +66,6 @@ extern wxString g_Shapes3DExtBuffer; ...@@ -67,7 +66,6 @@ extern wxString g_Shapes3DExtBuffer;
extern wxString g_DocModulesFileName; extern wxString g_DocModulesFileName;
/* Variables used in footprint handling */ /* Variables used in footprint handling */
extern int Angle_Rot_Module;
extern wxSize ModuleTextSize; /* Default footprint texts size */ extern wxSize ModuleTextSize; /* Default footprint texts size */
extern int ModuleTextWidth; extern int ModuleTextWidth;
extern int ModuleSegmentWidth; extern int ModuleSegmentWidth;
......
...@@ -55,6 +55,8 @@ static bool s_PlotOriginIsAuxAxis = FALSE; ...@@ -55,6 +55,8 @@ static bool s_PlotOriginIsAuxAxis = FALSE;
/* The group of plot options - sadly global XXX */ /* The group of plot options - sadly global XXX */
PCB_Plot_Options g_pcb_plot_options; PCB_Plot_Options g_pcb_plot_options;
extern int g_DrawDefaultLineThickness;
/*******************************/ /*******************************/
/* Dialog box for plot control */ /* Dialog box for plot control */
...@@ -140,12 +142,12 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -140,12 +142,12 @@ void DIALOG_PLOT::Init_Dialog()
BOARD* board = m_Parent->GetBoard(); BOARD* board = m_Parent->GetBoard();
m_Config->Read( OPTKEY_OUTPUT_FORMAT, &g_pcb_plot_options.PlotFormat ); m_Config->Read( OPTKEY_OUTPUT_FORMAT, &g_pcb_plot_options.PlotFormat );
m_Config->Read( OPTKEY_PLOT_LINEWIDTH_VALUE, &g_pcb_plot_options.PlotLine_Width );
m_Config->Read( OPTKEY_EDGELAYER_GERBER, &g_pcb_plot_options.Exclude_Edges_Pcb ); m_Config->Read( OPTKEY_EDGELAYER_GERBER, &g_pcb_plot_options.Exclude_Edges_Pcb );
m_Config->Read( OPTKEY_XFINESCALE_ADJ, &m_XScaleAdjust ); m_Config->Read( OPTKEY_XFINESCALE_ADJ, &m_XScaleAdjust );
m_Config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust ); m_Config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust );
m_PlotFormatOpt->SetSelection( g_pcb_plot_options.PlotFormat ); m_PlotFormatOpt->SetSelection( g_pcb_plot_options.PlotFormat );
g_pcb_plot_options.PlotLine_Width = g_DrawDefaultLineThickness;
// Set units and value for HPGL pen speed. // Set units and value for HPGL pen speed.
...@@ -455,6 +457,8 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event ) ...@@ -455,6 +457,8 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event )
msg = m_LinesWidth->GetValue(); msg = m_LinesWidth->GetValue();
tmp = ReturnValueFromString( g_UnitMetric, msg, PCB_INTERNAL_UNIT ); tmp = ReturnValueFromString( g_UnitMetric, msg, PCB_INTERNAL_UNIT );
g_pcb_plot_options.PlotLine_Width = tmp; g_pcb_plot_options.PlotLine_Width = tmp;
g_DrawDefaultLineThickness = g_pcb_plot_options.PlotLine_Width;
msg = m_FineAdjustXscaleOpt->GetValue(); msg = m_FineAdjustXscaleOpt->GetValue();
msg.ToDouble( &m_XScaleAdjust ); msg.ToDouble( &m_XScaleAdjust );
...@@ -472,8 +476,6 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event ) ...@@ -472,8 +476,6 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event )
int formatNdx = m_PlotFormatOpt->GetSelection(); int formatNdx = m_PlotFormatOpt->GetSelection();
m_Config->Write( OPTKEY_OUTPUT_FORMAT, formatNdx ); m_Config->Write( OPTKEY_OUTPUT_FORMAT, formatNdx );
m_Config->Write( OPTKEY_PLOT_LINEWIDTH_VALUE,
g_pcb_plot_options.PlotLine_Width );
wxString layerKey; wxString layerKey;
for( int layer = 0; layer<NB_LAYERS; ++layer ) for( int layer = 0; layer<NB_LAYERS; ++layer )
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
/* Shared Config keys for plot and print */ /* Shared Config keys for plot and print */
#define OPTKEY_PLOT_LINEWIDTH_VALUE wxT( "PlotLineWidth" )
#define OPTKEY_LAYERBASE wxT( "PlotLayer_%d" ) #define OPTKEY_LAYERBASE wxT( "PlotLayer_%d" )
#define OPTKEY_PRINT_X_FINESCALE_ADJ wxT( "PrintXFineScaleAdj" ) #define OPTKEY_PRINT_X_FINESCALE_ADJ wxT( "PrintXFineScaleAdj" )
#define OPTKEY_PRINT_Y_FINESCALE_ADJ wxT( "PrintYFineScaleAdj" ) #define OPTKEY_PRINT_Y_FINESCALE_ADJ wxT( "PrintYFineScaleAdj" )
......
...@@ -695,7 +695,7 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, ...@@ -695,7 +695,7 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe,
} }
/** Test the other layer. **/ /** Test the other layer. **/
if( (two_sides) && !g_No_Via_Route ) if( two_sides )
{ {
olddir = GetDir( r, c, side ); olddir = GetDir( r, c, side );
if( olddir == FROM_OTHERSIDE ) if( olddir == FROM_OTHERSIDE )
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
extern int g_DrawDefaultLineThickness; // Default line thickness, used to draw Frame references
// Local functions: // Local functions:
/* Trace the pads of a module in sketch mode. /* Trace the pads of a module in sketch mode.
* Used to display pads when when the module visibility is set to not visible * Used to display pads when when the module visibility is set to not visible
...@@ -73,7 +76,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -73,7 +76,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->DrawBackGround( DC ); DrawPanel->DrawBackGround( DC );
TraceWorkSheet( DC, GetScreen(), 0 ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
GetBoard()->Draw( DrawPanel, DC, GR_OR ); GetBoard()->Draw( DrawPanel, DC, GR_OR );
......
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