Commit e29d89c7 authored by charras's avatar charras

minor changes and cleanup

parent e574a1b0
...@@ -5,10 +5,11 @@ COMMON = ../include/colors.h ...@@ -5,10 +5,11 @@ COMMON = ../include/colors.h
OBJECTS= \ OBJECTS= \
confirm.o \ about_kicad.o\
base_struct.o\ base_struct.o\
copy_to_clipboard.o\
basicframe.o\ basicframe.o\
confirm.o \
copy_to_clipboard.o\
class_drawpickedstruct.o\ class_drawpickedstruct.o\
common_plot_functions.o\ common_plot_functions.o\
common_plotPS_functions.o\ common_plotPS_functions.o\
...@@ -16,7 +17,7 @@ OBJECTS= \ ...@@ -16,7 +17,7 @@ OBJECTS= \
dlist.o \ dlist.o \
hotkeys_basic.o\ hotkeys_basic.o\
drawtxt.o \ drawtxt.o \
about_kicad.o\ drawpanel.o\
wxwineda.o \ wxwineda.o \
string.o \ string.o \
gr_basic.o\ gr_basic.o\
......
...@@ -25,7 +25,6 @@ OBJECTS = $(TARGET).o \ ...@@ -25,7 +25,6 @@ OBJECTS = $(TARGET).o \
class_cotation.o\ class_cotation.o\
class_mire.o\ class_mire.o\
displayframe.o\ displayframe.o\
drawpanel.o \
init.o\ init.o\
readschematicnetlist.o\ readschematicnetlist.o\
loadcmp.o\ loadcmp.o\
...@@ -60,9 +59,6 @@ displayframe.o: displayframe.cpp ...@@ -60,9 +59,6 @@ displayframe.o: displayframe.cpp
listboxes.o: listboxes.cpp listboxes.o: listboxes.cpp
drawpanel.o: ../share/drawpanel.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawframe.o: ../share/drawframe.cpp drawframe.o: ../share/drawframe.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
......
...@@ -35,7 +35,6 @@ OBJECTS = eeschema.o\ ...@@ -35,7 +35,6 @@ OBJECTS = eeschema.o\
drawframe.o\ drawframe.o\
schframe.o\ schframe.o\
viewlib_frame.o\ viewlib_frame.o\
drawpanel.o\
wxprint.o\ wxprint.o\
lib_export.o \ lib_export.o \
busentry.o \ busentry.o \
...@@ -149,9 +148,6 @@ zoom.o: ../share/zoom.cpp $(DEPEND) ...@@ -149,9 +148,6 @@ zoom.o: ../share/zoom.cpp $(DEPEND)
treeprj.o: ../share/treeprj.cpp $(DEPEND) treeprj.o: ../share/treeprj.cpp $(DEPEND)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawpanel.o: ../share/drawpanel.cpp $(DEPEND)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
mdiframe.o: ../share/mdiframe.cpp $(DEPEND) mdiframe.o: ../share/mdiframe.cpp $(DEPEND)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
......
...@@ -28,7 +28,6 @@ OBJECTS= \ ...@@ -28,7 +28,6 @@ OBJECTS= \
class_drc_item.o \ class_drc_item.o \
class_board_connected_item.o\ class_board_connected_item.o\
drawframe.o\ drawframe.o\
drawpanel.o\
set_color.o \ set_color.o \
gerbview_config.o \ gerbview_config.o \
class_marker.o \ class_marker.o \
...@@ -59,9 +58,6 @@ OBJECTS= \ ...@@ -59,9 +58,6 @@ OBJECTS= \
setpage.o: ../share/setpage.cpp setpage.o: ../share/setpage.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawpanel.o: ../share/drawpanel.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawframe.o: ../share/drawframe.cpp drawframe.o: ../share/drawframe.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
......
...@@ -718,9 +718,9 @@ public: ...@@ -718,9 +718,9 @@ public:
/* Micro waves functions */ /* Micro waves functions */
void Edit_Gap( wxDC* DC, MODULE* Module ); void Edit_Gap( wxDC* DC, MODULE* Module );
MODULE* Create_MuWaveBasicShape( wxDC* DC, const wxString& name, int pad_count ); MODULE* Create_MuWaveBasicShape( const wxString& name, int pad_count );
MODULE* Create_MuWaveComponent( wxDC* DC, int shape_type ); MODULE* Create_MuWaveComponent( int shape_type );
MODULE* Create_MuWavePolygonShape( wxDC* DC ); MODULE* Create_MuWavePolygonShape( );
void Begin_Self( wxDC* DC ); void Begin_Self( wxDC* DC );
MODULE* Genere_Self( wxDC* DC ); MODULE* Genere_Self( wxDC* DC );
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -172,7 +172,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC ) ...@@ -172,7 +172,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
MODULE* Module; MODULE* Module;
D_PAD* PtPad; D_PAD* PtPad;
int ii, ll, lextbrin; int ii, ll, lextbrin;
float fcoeff; double fcoeff;
bool abort = FALSE; bool abort = FALSE;
wxString msg; wxString msg;
...@@ -502,7 +502,7 @@ static EDGE_MODULE* gen_arc( EDGE_MODULE* PtSegm, int cX, int cY, int angle ) ...@@ -502,7 +502,7 @@ static EDGE_MODULE* gen_arc( EDGE_MODULE* PtSegm, int cX, int cY, int angle )
*/ */
{ {
int ii, nb_seg; int ii, nb_seg;
float alpha, beta, fsin, fcos; double alpha, beta, fsin, fcos;
int x0, xr0, y0, yr0; int x0, xr0, y0, yr0;
EDGE_MODULE* newedge; EDGE_MODULE* newedge;
...@@ -517,7 +517,7 @@ static EDGE_MODULE* gen_arc( EDGE_MODULE* PtSegm, int cX, int cY, int angle ) ...@@ -517,7 +517,7 @@ static EDGE_MODULE* gen_arc( EDGE_MODULE* PtSegm, int cX, int cY, int angle )
nb_seg = ( abs( angle ) ) / 225; if( nb_seg == 0 ) nb_seg = ( abs( angle ) ) / 225; if( nb_seg == 0 )
nb_seg = 1; nb_seg = 1;
alpha = ( (float) angle * 3.14159 / 1800 ) / nb_seg; alpha = ( (double) angle * 3.14159 / 1800 ) / nb_seg;
for( ii = 1; ii <= nb_seg; ii++ ) for( ii = 1; ii <= nb_seg; ii++ )
{ {
......
...@@ -61,7 +61,6 @@ OBJECTS= $(TARGET).o classpcb.o\ ...@@ -61,7 +61,6 @@ OBJECTS= $(TARGET).o classpcb.o\
class_zone.o\ class_zone.o\
class_zone_setting.o\ class_zone_setting.o\
drawframe.o\ drawframe.o\
drawpanel.o\
track.o \ track.o \
set_color.o \ set_color.o \
set_grid.o \ set_grid.o \
...@@ -134,15 +133,9 @@ OBJECTS= $(TARGET).o classpcb.o\ ...@@ -134,15 +133,9 @@ OBJECTS= $(TARGET).o classpcb.o\
gpcb_exchange.o gpcb_exchange.o
PolyLine.o: ../polygon/PolyLine.cpp ../polygon/PolyLine.h
$(CXX) -c $(EDACPPFLAGS) -o $@ ../polygon/$*.cpp
setpage.o: ../share/setpage.cpp setpage.o: ../share/setpage.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawpanel.o: ../share/drawpanel.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawframe.o: ../share/drawframe.cpp drawframe.o: ../share/drawframe.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
......
...@@ -2,40 +2,37 @@ ...@@ -2,40 +2,37 @@
/* Gestion des composants specifiques aux microndes */ /* Gestion des composants specifiques aux microndes */
/****************************************************/ /****************************************************/
/* Fichier MUONDE.CPP */ /* File MUONDE.CPP */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" //#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "trigo.h" #include "trigo.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "autorout.h" //#include "autorout.h"
#include "drag.h" //#include "drag.h"
#include <string.h> //#include <string.h>
#include "protos.h" #include "protos.h"
/* fonctions importees */
/* Fonctions locales */ /* Fonctions locales */
//static void Exit_Muonde(WinEDA_DrawFrame * frame, wxDC *DC); //static void Exit_Muonde(WinEDA_DrawFrame * frame, wxDC *DC);
/* Variables locales : */ /* Variables locales : */
#define COEFF_COUNT 6 #define COEFF_COUNT 6
double* PolyEdges; static double* PolyEdges;
int PolyEdgesCount; static int PolyEdgesCount;
double ShapeScaleX, ShapeScaleY; static double ShapeScaleX, ShapeScaleY;
wxSize ShapeSize; static wxSize ShapeSize;
int PolyShapeType; static int PolyShapeType;
#include "gen_self.h" #include "gen_self.h"
/***************************************************************************/ /***************************************************************************/
MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC, MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( const wxString& name, int pad_count )
const wxString& name, int pad_count )
/***************************************************************************/ /***************************************************************************/
/* Create a footprint with pad_count pads for micro wave applications /* Create a footprint with pad_count pads for micro wave applications
...@@ -47,7 +44,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC, ...@@ -47,7 +44,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC,
int pad_num = 1; int pad_num = 1;
wxString Line; wxString Line;
Module = Create_1_Module( DC, name ); Module = Create_1_Module( NULL, name );
if( Module == NULL ) if( Module == NULL )
return NULL; return NULL;
...@@ -75,9 +72,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC, ...@@ -75,9 +72,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC,
pad->SetPadName( Line ); pad->SetPadName( Line );
pad_num++; pad_num++;
} }
if( DC )
Module->Draw( DrawPanel, DC, GR_OR );
return Module; return Module;
} }
...@@ -112,7 +106,7 @@ static void Exit_Muonde( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -112,7 +106,7 @@ static void Exit_Muonde( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************************************/ /***************************************************************************/
MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type )
/***************************************************************************/ /***************************************************************************/
/* Create a module "GAP" or "STUB" /* Create a module "GAP" or "STUB"
...@@ -124,14 +118,14 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -124,14 +118,14 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
{ {
int gap_size, oX, ii; int gap_size, oX, ii;
float fcoeff; float fcoeff;
D_PAD* pt_pad; D_PAD* pad;
MODULE* Module; MODULE* Module;
wxString msg, cmp_name; wxString msg, cmp_name;
int pad_count = 2; int pad_count = 2;
int angle = 0; int angle = 0;
bool abort; bool abort;
/* Entree de la longueur desiree du gap*/ /* Enter the size of the gap or stub*/
gap_size = g_DesignSettings.m_CurrentTrackWidth; // Valeur raisonnable gap_size = g_DesignSettings.m_CurrentTrackWidth; // Valeur raisonnable
switch( shape_type ) switch( shape_type )
...@@ -164,15 +158,14 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -164,15 +158,14 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
fcoeff = 10000.0 / 25.4; fcoeff = 10000.0 / 25.4;
value.Printf( wxT( "%2.4f" ), gap_size / fcoeff ); value.Printf( wxT( "%2.4f" ), gap_size / fcoeff );
msg += _( " (mm):" ); msg += _( " (mm):" );
abort = Get_Message( msg, _("Create microwave module"), value, this );
} }
else else
{ {
fcoeff = 10000.0; fcoeff = 10000.0;
value.Printf( wxT( "%2.3f" ), gap_size / fcoeff ); value.Printf( wxT( "%2.3f" ), gap_size / fcoeff );
msg += _( " (inch):" ); msg += _( " (inch):" );
abort = Get_Message( msg, _("Create microwave module"), value, this );
} }
abort = Get_Message( msg, _("Create microwave module"), value, this );
double fval; double fval;
if( !value.ToDouble( &fval ) ) if( !value.ToDouble( &fval ) )
...@@ -204,32 +197,32 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -204,32 +197,32 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
return NULL; return NULL;
} }
Module = Create_MuWaveBasicShape( NULL, cmp_name, pad_count ); Module = Create_MuWaveBasicShape( cmp_name, pad_count );
pt_pad = Module->m_Pads; pad = Module->m_Pads;
switch( shape_type ) switch( shape_type )
{ {
case 0: //Gap : case 0: //Gap :
oX = pt_pad->m_Pos0.x = -(gap_size + pt_pad->m_Size.x) / 2; oX = pad->m_Pos0.x = -(gap_size + pad->m_Size.x) / 2;
pt_pad->m_Pos.x += pt_pad->m_Pos0.x; pad->m_Pos.x += pad->m_Pos0.x;
pt_pad = (D_PAD*) pt_pad->Next(); pad = pad->Next();
pt_pad->m_Pos0.x = oX + gap_size + pt_pad->m_Size.x; pad->m_Pos0.x = oX + gap_size + pad->m_Size.x;
pt_pad->m_Pos.x += pt_pad->m_Pos0.x; pad->m_Pos.x += pad->m_Pos0.x;
break; break;
case 1: //Stub : case 1: //Stub :
pt_pad->SetPadName( wxT( "1" ) ); pad->SetPadName( wxT( "1" ) );
pt_pad = (D_PAD*) pt_pad->Next(); pad = pad->Next();
pt_pad->m_Pos0.y = -(gap_size + pt_pad->m_Size.y) / 2; pad->m_Pos0.y = -(gap_size + pad->m_Size.y) / 2;
pt_pad->m_Size.y = gap_size; pad->m_Size.y = gap_size;
pt_pad->m_Pos.y += pt_pad->m_Pos0.y; pad->m_Pos.y += pad->m_Pos0.y;
break; break;
case 2: //Arc Stub : case 2: //Arc Stub created by a polygonal approach:
{ {
EDGE_MODULE* edge; int* ptr, theta; EDGE_MODULE* edge; int* ptr, theta;
ii = angle / 50; ii = angle / 50; // Note : angles are in 0.1 degrees
edge = new EDGE_MODULE( Module ); edge = new EDGE_MODULE( Module );
Module->m_Drawings.PushFront( edge ); Module->m_Drawings.PushFront( edge );
...@@ -239,7 +232,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -239,7 +232,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
edge->m_PolyCount = ii + 3; edge->m_PolyCount = ii + 3;
edge->m_PolyList = (int*) MyMalloc( edge->m_PolyCount * 2 * sizeof(int) ); edge->m_PolyList = (int*) MyMalloc( edge->m_PolyCount * 2 * sizeof(int) );
ptr = edge->m_PolyList; ptr = edge->m_PolyList;
edge->m_Start0.y = -pt_pad->m_Size.y / 2; edge->m_Start0.y = -pad->m_Size.y / 2;
*ptr = 0; ptr++; *ptr = 0; ptr++;
*ptr = 0; ptr++; *ptr = 0; ptr++;
...@@ -255,6 +248,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -255,6 +248,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
theta = angle / 2; theta = angle / 2;
} }
// Close the polygon:
*ptr = edge->m_PolyList[0]; ptr++; *ptr = edge->m_PolyList[0]; ptr++;
*ptr = edge->m_PolyList[1]; *ptr = edge->m_PolyList[1];
break; break;
...@@ -265,8 +259,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -265,8 +259,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, GR_OR );
DrawPanel->MouseToCursorSchema();
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
return Module; return Module;
...@@ -506,7 +498,7 @@ void WinEDA_SetParamShapeFrame::ReadDataShapeDescr( wxCommandEvent& event ) ...@@ -506,7 +498,7 @@ void WinEDA_SetParamShapeFrame::ReadDataShapeDescr( wxCommandEvent& event )
/*************************************************************/ /*************************************************************/
MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC ) MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( )
/*************************************************************/ /*************************************************************/
{ {
D_PAD* pad1, * pad2; D_PAD* pad1, * pad2;
...@@ -548,7 +540,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC ) ...@@ -548,7 +540,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC )
cmp_name = wxT( "POLY" ); cmp_name = wxT( "POLY" );
Module = Create_MuWaveBasicShape( NULL, cmp_name, pad_count ); Module = Create_MuWaveBasicShape( cmp_name, pad_count );
pad1 = Module->m_Pads; pad1 = Module->m_Pads;
pad1->m_Pos0.x = -ShapeSize.x / 2; pad1->m_Pos0.x = -ShapeSize.x / 2;
...@@ -637,7 +629,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC ) ...@@ -637,7 +629,6 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC )
PolyEdges = NULL; PolyEdges = NULL;
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, GR_OR );
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
return Module; return Module;
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
...@@ -82,6 +80,7 @@ wxClientDC dc(DrawPanel); ...@@ -82,6 +80,7 @@ wxClientDC dc(DrawPanel);
void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos) void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos)
/***************************************************************************/ /***************************************************************************/
{ {
MODULE* module = NULL;
switch ( m_ID_current_state ) switch ( m_ID_current_state )
{ {
case ID_PCB_MUWAVE_TOOL_SELF_CMD: case ID_PCB_MUWAVE_TOOL_SELF_CMD:
...@@ -89,19 +88,19 @@ void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos) ...@@ -89,19 +88,19 @@ void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos)
break; break;
case ID_PCB_MUWAVE_TOOL_GAP_CMD: case ID_PCB_MUWAVE_TOOL_GAP_CMD:
Create_MuWaveComponent(DC, 0); module = Create_MuWaveComponent( 0);
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_CMD: case ID_PCB_MUWAVE_TOOL_STUB_CMD:
Create_MuWaveComponent(DC, 1); module = Create_MuWaveComponent( 1);
break; break;
case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD: case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD:
Create_MuWaveComponent(DC, 2); module = Create_MuWaveComponent( 2);
break; break;
case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD: case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD:
Create_MuWavePolygonShape(DC); module = Create_MuWavePolygonShape();
break; break;
default : default :
...@@ -110,5 +109,11 @@ void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos) ...@@ -110,5 +109,11 @@ void WinEDA_PcbFrame::MuWaveCommand(wxDC * DC, const wxPoint& MousePos)
SetToolID(0, wxCURSOR_ARROW,wxEmptyString); SetToolID(0, wxCURSOR_ARROW,wxEmptyString);
break; break;
} }
if ( module )
{
StartMove_Module( module, DC );
}
DrawPanel->MouseToCursorSchema();
} }
...@@ -230,21 +230,20 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, ...@@ -230,21 +230,20 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
wxSize GridSize( 500, 500 ); wxSize GridSize( 500, 500 );
wxConfig * config = NULL;
if( m_Parent && m_Parent->m_EDA_Config ) if( m_Parent && m_Parent->m_EDA_Config )
{ {
long SizeX, SizeY; long SizeX, SizeY;
config = m_Parent->m_EDA_Config;
if( m_Parent->m_EDA_Config->Read( wxT( "PcbEditGrid_X" ), &SizeX ) if( config->Read( wxT( "PcbEditGrid_X" ), &SizeX )
&& m_Parent->m_EDA_Config->Read( wxT( "PcbEditGrid_Y" ), &SizeY ) ) && config->Read( wxT( "PcbEditGrid_Y" ), &SizeY ) )
{ {
GridSize.x = SizeX; GridSize.x = SizeX;
GridSize.y = SizeY; GridSize.y = SizeY;
} }
m_Parent->m_EDA_Config->Read( wxT( "PcbMagPadOpt" ), config->Read( wxT( "PcbMagPadOpt" ), &g_MagneticPadOption );
&g_MagneticPadOption ); config->Read( wxT( "PcbMagTrackOpt" ), &g_MagneticTrackOption );
m_Parent->m_EDA_Config->Read( wxT( "PcbMagTrackOpt" ),
&g_MagneticTrackOption );
} }
GetScreen()->SetGrid( GridSize ); GetScreen()->SetGrid( GridSize );
...@@ -254,6 +253,13 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, ...@@ -254,6 +253,13 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
ReCreateVToolbar(); ReCreateVToolbar();
if( config )
{
long display_microwave_tools = 0;
config->Read( wxT( "ShowMicrowaveTools" ), &display_microwave_tools );
if ( display_microwave_tools )
ReCreateAuxVToolbar();
}
ReCreateOptToolbar(); ReCreateOptToolbar();
} }
...@@ -325,17 +331,15 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -325,17 +331,15 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
SetBaseScreen( ActiveScreen = ScreenPcb ); SetBaseScreen( ActiveScreen = ScreenPcb );
SaveSettings(); SaveSettings();
if( m_Parent && m_Parent->m_EDA_Config ) if( m_Parent && m_Parent->m_EDA_Config )
{ {
wxConfig * config = m_Parent->m_EDA_Config;
wxSize GridSize = GetScreen()->GetGrid(); wxSize GridSize = GetScreen()->GetGrid();
m_Parent->m_EDA_Config->Write( wxT( "PcbEditGrid_X" ), config->Write( wxT( "PcbEditGrid_X" ), (long) GridSize.x );
(long) GridSize.x ); config->Write( wxT( "PcbEditGrid_Y" ), (long) GridSize.y );
m_Parent->m_EDA_Config->Write( wxT( "PcbEditGrid_Y" ), config->Write( wxT( "PcbMagPadOpt" ), (long) g_MagneticPadOption );
(long) GridSize.y ); config->Write( wxT( "PcbMagTrackOpt" ), (long) g_MagneticTrackOption );
m_Parent->m_EDA_Config->Write( wxT( "PcbMagPadOpt" ), config->Write( wxT( "ShowMicrowaveTools" ), (long) m_AuxVToolBar ? 1 : 0 );
(long) g_MagneticPadOption );
m_Parent->m_EDA_Config->Write( wxT( "PcbMagTrackOpt" ),
(long) g_MagneticTrackOption );
} }
Destroy(); Destroy();
} }
...@@ -472,6 +476,7 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -472,6 +476,7 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayOpt.ContrastModeDisplay ? DisplayOpt.ContrastModeDisplay ?
_( "Normal Contrast Mode Display" ) : _( "Normal Contrast Mode Display" ) :
_( "Hight Contrast Mode Display" ) ); _( "Hight Contrast Mode Display" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, m_AuxVToolBar ? true : false );
} }
if( m_AuxiliaryToolBar ) if( m_AuxiliaryToolBar )
......
...@@ -395,7 +395,7 @@ void WinEDA_PcbFrame::ReCreateOptToolbar() ...@@ -395,7 +395,7 @@ void WinEDA_PcbFrame::ReCreateOptToolbar()
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
wxEmptyString, wxEmptyString,
wxBitmap( mw_toolbar_xpm ), wxBitmap( mw_toolbar_xpm ),
_( "Display auxiliary vertical toolbar (tools for micro wave applications)\n This is a very experimental feature (under development)" ), _( "Display/remove auxiliary vertical toolbar (tools for micro wave applications)\n This is a experimental feature (under development)" ),
wxITEM_CHECK ); wxITEM_CHECK );
#endif #endif
...@@ -539,7 +539,6 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar() ...@@ -539,7 +539,6 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar()
m_AuxVToolBar->Realize(); m_AuxVToolBar->Realize();
D(printf("ReCreateAuxVToolbar\n");)
SetToolbars(); SetToolbars();
} }
......
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