Commit 9f049640 authored by dickelbeck's avatar dickelbeck

whitespace consistency

parent 2a40051a
...@@ -51,97 +51,98 @@ le toolbar d'options ...@@ -51,97 +51,98 @@ le toolbar d'options
int id = event.GetId(); int id = event.GetId();
wxClientDC dc(DrawPanel); wxClientDC dc(DrawPanel);
DrawPanel->CursorOff(&dc); DrawPanel->CursorOff(&dc);
DrawPanel->PrepareGraphicContext(&dc); DrawPanel->PrepareGraphicContext(&dc);
switch ( id )
{ switch ( id )
case ID_TB_OPTIONS_DRC_OFF: {
Drc_On = m_OptionsToolBar->GetToolState(id) ? FALSE : TRUE; case ID_TB_OPTIONS_DRC_OFF:
break; Drc_On = m_OptionsToolBar->GetToolState(id) ? FALSE : TRUE;
break;
case ID_TB_OPTIONS_SHOW_GRID:
m_Draw_Grid = g_ShowGrid = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_SHOW_GRID:
DrawPanel->ReDraw(&dc, TRUE); m_Draw_Grid = g_ShowGrid = m_OptionsToolBar->GetToolState(id);
break; DrawPanel->ReDraw(&dc, TRUE);
break;
case ID_TB_OPTIONS_SHOW_RATSNEST:
g_Show_Ratsnest = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_SHOW_RATSNEST:
Ratsnest_On_Off(&dc); g_Show_Ratsnest = m_OptionsToolBar->GetToolState(id);
break; Ratsnest_On_Off(&dc);
break;
case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST:
g_Show_Module_Ratsnest = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST:
break; g_Show_Module_Ratsnest = m_OptionsToolBar->GetToolState(id);
break;
case ID_TB_OPTIONS_SELECT_UNIT_MM:
g_UnitMetric = MILLIMETRE; case ID_TB_OPTIONS_SELECT_UNIT_MM:
case ID_TB_OPTIONS_SELECT_UNIT_INCH: g_UnitMetric = MILLIMETRE;
if ( id == ID_TB_OPTIONS_SELECT_UNIT_INCH ) case ID_TB_OPTIONS_SELECT_UNIT_INCH:
g_UnitMetric = INCHES; if ( id == ID_TB_OPTIONS_SELECT_UNIT_INCH )
m_SelTrackWidthBox_Changed = TRUE; g_UnitMetric = INCHES;
Affiche_Status_Box(); /* Reaffichage des coord curseur */ m_SelTrackWidthBox_Changed = TRUE;
ReCreateAuxiliaryToolbar(); Affiche_Status_Box(); /* Reaffichage des coord curseur */
DisplayUnitsMsg(); ReCreateAuxiliaryToolbar();
break; DisplayUnitsMsg();
break;
case ID_TB_OPTIONS_SHOW_POLAR_COORD:
Affiche_Message(wxEmptyString); case ID_TB_OPTIONS_SHOW_POLAR_COORD:
DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState(id); Affiche_Message(wxEmptyString);
Affiche_Status_Box(); /* Reaffichage des coord curseur */ DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState(id);
break; Affiche_Status_Box(); /* Reaffichage des coord curseur */
break;
case ID_TB_OPTIONS_SELECT_CURSOR:
g_CursorShape = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_SELECT_CURSOR:
break; g_CursorShape = m_OptionsToolBar->GetToolState(id);
break;
case ID_TB_OPTIONS_AUTO_DEL_TRACK:
g_AutoDeleteOldTrack = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_AUTO_DEL_TRACK:
break; g_AutoDeleteOldTrack = m_OptionsToolBar->GetToolState(id);
break;
case ID_TB_OPTIONS_SHOW_ZONES:
DisplayOpt.DisplayZones = m_OptionsToolBar->GetToolState(id); case ID_TB_OPTIONS_SHOW_ZONES:
DrawPanel->ReDraw(&dc, TRUE); DisplayOpt.DisplayZones = m_OptionsToolBar->GetToolState(id);
break; DrawPanel->ReDraw(&dc, TRUE);
break;
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
m_DisplayPadFill = DisplayOpt.DisplayPadFill = case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
! m_OptionsToolBar->GetToolState(id); m_DisplayPadFill = DisplayOpt.DisplayPadFill =
DrawPanel->ReDraw(&dc, TRUE); ! m_OptionsToolBar->GetToolState(id);
break; DrawPanel->ReDraw(&dc, TRUE);
break;
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
! m_OptionsToolBar->GetToolState(id); m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill =
DrawPanel->ReDraw(&dc, TRUE); ! m_OptionsToolBar->GetToolState(id);
break; DrawPanel->ReDraw(&dc, TRUE);
break;
case ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE:
DisplayOpt.ContrastModeDisplay = case ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE:
m_OptionsToolBar->GetToolState(id); DisplayOpt.ContrastModeDisplay =
DrawPanel->ReDraw(&dc, TRUE); m_OptionsToolBar->GetToolState(id);
break; DrawPanel->ReDraw(&dc, TRUE);
break;
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1:
if ( m_OptionsToolBar->GetToolState(id) ) // show aux V toolbar (Microwave tool) case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1:
ReCreateAuxVToolbar(); if ( m_OptionsToolBar->GetToolState(id) ) // show aux V toolbar (Microwave tool)
else ReCreateAuxVToolbar();
{ else
delete m_AuxVToolBar; {
m_AuxVToolBar = NULL; delete m_AuxVToolBar;
} m_AuxVToolBar = NULL;
{ }
wxSizeEvent SizeEv(GetSize()); {
OnSize(SizeEv); wxSizeEvent SizeEv(GetSize());
} OnSize(SizeEv);
break; }
break;
default:
DisplayError(this, wxT("WinEDA_PcbFrame::OnSelectOptionToolbar error")); default:
break; DisplayError(this, wxT("WinEDA_PcbFrame::OnSelectOptionToolbar error"));
} break;
}
SetToolbars();
DrawPanel->CursorOn(&dc); SetToolbars();
DrawPanel->CursorOn(&dc);
} }
...@@ -177,30 +178,30 @@ WinEDA_PcbGeneralOptionsFrame::WinEDA_PcbGeneralOptionsFrame( ) ...@@ -177,30 +178,30 @@ WinEDA_PcbGeneralOptionsFrame::WinEDA_PcbGeneralOptionsFrame( )
WinEDA_PcbGeneralOptionsFrame::WinEDA_PcbGeneralOptionsFrame( WinEDA_PcbFrame* parent, wxDC * DC, WinEDA_PcbGeneralOptionsFrame::WinEDA_PcbGeneralOptionsFrame( WinEDA_PcbFrame* parent, wxDC * DC,
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
m_Parent = parent; m_Parent = parent;
m_DC = DC; m_DC = DC;
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
/* Set display options */ /* Set display options */
m_PolarDisplay->SetSelection(DisplayOpt.DisplayPolarCood ? 1 : 0); m_PolarDisplay->SetSelection(DisplayOpt.DisplayPolarCood ? 1 : 0);
m_BoxUnits->SetSelection( g_UnitMetric ? 1 : 0); m_BoxUnits->SetSelection( g_UnitMetric ? 1 : 0);
m_CursorShape->SetSelection( g_CursorShape ? 1 : 0); m_CursorShape->SetSelection( g_CursorShape ? 1 : 0);
wxString timevalue; wxString timevalue;
timevalue << g_TimeOut / 60; timevalue << g_TimeOut / 60;
m_SaveTime->SetValue(timevalue); m_SaveTime->SetValue(timevalue);
m_LayerNumber->SetValue(g_DesignSettings.m_CopperLayerCount); m_LayerNumber->SetValue(g_DesignSettings.m_CopperLayerCount);
m_MaxShowLinks->SetValue(g_MaxLinksShowed); m_MaxShowLinks->SetValue(g_MaxLinksShowed);
m_DrcOn->SetValue(Drc_On ); m_DrcOn->SetValue(Drc_On );
m_ShowModuleRatsnest->SetValue(g_Show_Module_Ratsnest); m_ShowModuleRatsnest->SetValue(g_Show_Module_Ratsnest);
m_ShowGlobalRatsnest->SetValue(g_Show_Ratsnest); m_ShowGlobalRatsnest->SetValue(g_Show_Ratsnest);
m_TrackAutodel->SetValue(g_AutoDeleteOldTrack); m_TrackAutodel->SetValue(g_AutoDeleteOldTrack);
m_Track_45_Only_Ctrl->SetValue(Track_45_Only); m_Track_45_Only_Ctrl->SetValue(Track_45_Only);
m_Segments_45_Only_Ctrl->SetValue(Segments_45_Only); m_Segments_45_Only_Ctrl->SetValue(Segments_45_Only);
m_AutoPANOpt->SetValue(m_Parent->DrawPanel-> m_AutoPAN_Enable); m_AutoPANOpt->SetValue(m_Parent->DrawPanel-> m_AutoPAN_Enable);
m_Segments_45_Only_Ctrl->SetValue(Segments_45_Only); m_Segments_45_Only_Ctrl->SetValue(Segments_45_Only);
m_Track_DoubleSegm_Ctrl->SetValue(g_TwoSegmentTrackBuild); m_Track_DoubleSegm_Ctrl->SetValue(g_TwoSegmentTrackBuild);
} }
...@@ -237,7 +238,7 @@ bool WinEDA_PcbGeneralOptionsFrame::Create( wxWindow* parent, wxWindowID id, con ...@@ -237,7 +238,7 @@ bool WinEDA_PcbGeneralOptionsFrame::Create( wxWindow* parent, wxWindowID id, con
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
Centre(); Centre();
////@end WinEDA_PcbGeneralOptionsFrame creation ////@end WinEDA_PcbGeneralOptionsFrame creation
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
return true; return true;
} }
...@@ -270,7 +271,7 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls() ...@@ -270,7 +271,7 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls()
_("millimeters") _("millimeters")
}; };
m_BoxUnits = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Units"), wxDefaultPosition, m_BoxUnits = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Units"), wxDefaultPosition,
wxDefaultSize, 2, m_BoxUnitsStrings, 1,wxRA_SPECIFY_COLS ); wxDefaultSize, 2, m_BoxUnitsStrings, 1,wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_BoxUnits, 0, wxALIGN_LEFT|wxALL, 5); itemBoxSizer3->Add(m_BoxUnits, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_CursorShapeStrings[] = { wxString m_CursorShapeStrings[] = {
...@@ -278,7 +279,7 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls() ...@@ -278,7 +279,7 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls()
_("Big") _("Big")
}; };
m_CursorShape = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Cursor"), wxDefaultPosition, wxDefaultSize, 2, m_CursorShape = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Cursor"), wxDefaultPosition, wxDefaultSize, 2,
m_CursorShapeStrings, 1, wxRA_SPECIFY_COLS ); m_CursorShapeStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_CursorShape, 0, wxALIGN_LEFT|wxALL, 5); itemBoxSizer3->Add(m_CursorShape, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
...@@ -425,7 +426,7 @@ void WinEDA_PcbGeneralOptionsFrame::OnCancelClick( wxCommandEvent& event ) ...@@ -425,7 +426,7 @@ void WinEDA_PcbGeneralOptionsFrame::OnCancelClick( wxCommandEvent& event )
void WinEDA_PcbGeneralOptionsFrame::OnOkClick( wxCommandEvent& event ) void WinEDA_PcbGeneralOptionsFrame::OnOkClick( wxCommandEvent& event )
{ {
AcceptPcbOptions(event); AcceptPcbOptions(event);
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_PcbGeneralOptionsFrame. ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_PcbGeneralOptionsFrame.
// Before editing this code, remove the block markers. // Before editing this code, remove the block markers.
event.Skip(); event.Skip();
...@@ -440,41 +441,41 @@ void WinEDA_PcbGeneralOptionsFrame::AcceptPcbOptions(wxCommandEvent& event) ...@@ -440,41 +441,41 @@ void WinEDA_PcbGeneralOptionsFrame::AcceptPcbOptions(wxCommandEvent& event)
{ {
int ii; int ii;
DisplayOpt.DisplayPolarCood = DisplayOpt.DisplayPolarCood =
(m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE; (m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE;
ii = g_UnitMetric; ii = g_UnitMetric;
g_UnitMetric = (m_BoxUnits->GetSelection() == 0) ? 0 : 1; g_UnitMetric = (m_BoxUnits->GetSelection() == 0) ? 0 : 1;
if ( ii != g_UnitMetric ) m_Parent->ReCreateAuxiliaryToolbar(); if ( ii != g_UnitMetric ) m_Parent->ReCreateAuxiliaryToolbar();
g_CursorShape = m_CursorShape->GetSelection(); g_CursorShape = m_CursorShape->GetSelection();
g_TimeOut = 60 * m_SaveTime->GetValue(); g_TimeOut = 60 * m_SaveTime->GetValue();
/* Mise a jour de la combobox d'affichage de la couche active */ /* Mise a jour de la combobox d'affichage de la couche active */
g_DesignSettings.m_CopperLayerCount = m_LayerNumber->GetValue(); g_DesignSettings.m_CopperLayerCount = m_LayerNumber->GetValue();
m_Parent->ReCreateLayerBox(NULL); m_Parent->ReCreateLayerBox(NULL);
g_MaxLinksShowed = m_MaxShowLinks->GetValue(); g_MaxLinksShowed = m_MaxShowLinks->GetValue();
Drc_On = m_DrcOn->GetValue(); Drc_On = m_DrcOn->GetValue();
if ( g_Show_Ratsnest != m_ShowGlobalRatsnest->GetValue() ) if ( g_Show_Ratsnest != m_ShowGlobalRatsnest->GetValue() )
{ {
g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue(); g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue();
m_Parent->Ratsnest_On_Off(m_DC); m_Parent->Ratsnest_On_Off(m_DC);
} }
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue(); g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue(); Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
Track_45_Only = m_Track_45_Only_Ctrl->GetValue(); Track_45_Only = m_Track_45_Only_Ctrl->GetValue();
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue(); m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue(); g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
EndModal(1); EndModal(1);
} }
enum id_optpcb enum id_optpcb
{ {
ID_ACCEPT_OPT = 1000, ID_ACCEPT_OPT = 1000,
ID_CANCEL_OPT ID_CANCEL_OPT
}; };
#include "dialog_track_options.cpp" #include "dialog_track_options.cpp"
...@@ -483,44 +484,44 @@ enum id_optpcb ...@@ -483,44 +484,44 @@ enum id_optpcb
/*****************************************************************/ /*****************************************************************/
void WinEDA_PcbFrame::InstallPcbOptionsFrame(const wxPoint & pos, void WinEDA_PcbFrame::InstallPcbOptionsFrame(const wxPoint & pos,
wxDC * DC, int id) wxDC * DC, int id)
/*****************************************************************/ /*****************************************************************/
{ {
switch ( id ) switch ( id )
{ {
case ID_PCB_TRACK_SIZE_SETUP: case ID_PCB_TRACK_SIZE_SETUP:
{ {
WinEDA_PcbTracksDialog * OptionsFrame = WinEDA_PcbTracksDialog * OptionsFrame =
new WinEDA_PcbTracksDialog(this); new WinEDA_PcbTracksDialog(this);
OptionsFrame->ShowModal(); OptionsFrame->Destroy(); OptionsFrame->ShowModal(); OptionsFrame->Destroy();
} }
break; break;
case ID_PCB_DRAWINGS_WIDTHS_SETUP: case ID_PCB_DRAWINGS_WIDTHS_SETUP:
{ {
WinEDA_GraphicItemsOptionsDialog * OptionsFrame = WinEDA_GraphicItemsOptionsDialog * OptionsFrame =
new WinEDA_GraphicItemsOptionsDialog(this); new WinEDA_GraphicItemsOptionsDialog(this);
OptionsFrame->ShowModal(); OptionsFrame->Destroy(); OptionsFrame->ShowModal(); OptionsFrame->Destroy();
} }
break; break;
case ID_PCB_LOOK_SETUP: case ID_PCB_LOOK_SETUP:
{ {
WinEDA_DisplayOptionsDialog * OptionsFrame = WinEDA_DisplayOptionsDialog * OptionsFrame =
new WinEDA_DisplayOptionsDialog(this); new WinEDA_DisplayOptionsDialog(this);
OptionsFrame->ShowModal(); OptionsFrame->Destroy(); OptionsFrame->ShowModal(); OptionsFrame->Destroy();
} }
break; break;
case ID_OPTIONS_SETUP: case ID_OPTIONS_SETUP:
{ {
WinEDA_PcbGeneralOptionsFrame * OptionsFrame = WinEDA_PcbGeneralOptionsFrame * OptionsFrame =
new WinEDA_PcbGeneralOptionsFrame(this, DC); new WinEDA_PcbGeneralOptionsFrame(this, DC);
OptionsFrame->ShowModal(); OptionsFrame->Destroy(); OptionsFrame->ShowModal(); OptionsFrame->Destroy();
} }
break; break;
} }
} }
...@@ -529,8 +530,6 @@ void WinEDA_ModuleEditFrame::InstallOptionsFrame(const wxPoint & pos) ...@@ -529,8 +530,6 @@ void WinEDA_ModuleEditFrame::InstallOptionsFrame(const wxPoint & pos)
/*******************************************************************/ /*******************************************************************/
{ {
WinEDA_GraphicItemsOptionsDialog OptionsFrame (this); WinEDA_GraphicItemsOptionsDialog OptionsFrame (this);
OptionsFrame.ShowModal(); OptionsFrame.ShowModal();
} }
/***************************************************/ /***************************************************/
/* PCBNEW - Gestion des Recherches (fonction Find) */ /* PCBNEW - Gestion des Recherches (fonction Find) */
/***************************************************/ /***************************************************/
/* Fichier find.cpp */ /* Fichier find.cpp */
/* /*
Affichage et modifications des parametres de travail de PcbNew Affichage et modifications des parametres de travail de PcbNew
...@@ -33,8 +33,8 @@ static int s_ItemCount, s_MarkerCount; ...@@ -33,8 +33,8 @@ static int s_ItemCount, s_MarkerCount;
void WinEDA_PcbFrame::InstallFindFrame(const wxPoint & pos, wxDC * DC) void WinEDA_PcbFrame::InstallFindFrame(const wxPoint & pos, wxDC * DC)
/*********************************************************************/ /*********************************************************************/
{ {
WinEDA_PcbFindFrame * frame = new WinEDA_PcbFindFrame(this, DC, pos); WinEDA_PcbFindFrame * frame = new WinEDA_PcbFindFrame(this, DC, pos);
frame->ShowModal(); frame->Destroy(); frame->ShowModal(); frame->Destroy();
} }
...@@ -50,97 +50,97 @@ bool succes = FALSE; ...@@ -50,97 +50,97 @@ bool succes = FALSE;
bool FindMarker = FALSE; bool FindMarker = FALSE;
MODULE * Module; MODULE * Module;
int StartCount; int StartCount;
switch ( event.GetId() ) switch ( event.GetId() )
{ {
case ID_FIND_ITEM: case ID_FIND_ITEM:
s_ItemCount = 0; s_ItemCount = 0;
break; break;
case ID_FIND_MARKER: s_MarkerCount = 0; case ID_FIND_MARKER: s_MarkerCount = 0;
case ID_FIND_NEXT_MARKER: case ID_FIND_NEXT_MARKER:
FindMarker = TRUE; FindMarker = TRUE;
break; break;
} }
s_OldStringFound = m_NewText->GetValue(); s_OldStringFound = m_NewText->GetValue();
m_Parent->DrawPanel->GetViewStart(&screen->m_StartVisu.x, &screen->m_StartVisu.y); m_Parent->DrawPanel->GetViewStart(&screen->m_StartVisu.x, &screen->m_StartVisu.y);
StartCount = 0; StartCount = 0;
if( FindMarker ) if( FindMarker )
{ {
MARQUEUR * Marker = (MARQUEUR *) m_Parent->m_Pcb->m_Drawings; MARQUEUR * Marker = (MARQUEUR *) m_Parent->m_Pcb->m_Drawings;
for( ; Marker != NULL; Marker = (MARQUEUR *)Marker->Pnext) for( ; Marker != NULL; Marker = (MARQUEUR *)Marker->Pnext)
{ {
if( Marker->m_StructType != TYPEMARQUEUR ) continue; if( Marker->m_StructType != TYPEMARQUEUR ) continue;
StartCount++; StartCount++;
if ( StartCount > s_MarkerCount ) if ( StartCount > s_MarkerCount )
{ {
succes = TRUE; succes = TRUE;
locate_pos = Marker->m_Pos; locate_pos = Marker->m_Pos;
s_MarkerCount++; s_MarkerCount++;
break; break;
} }
} }
} }
else for ( Module = m_Parent->m_Pcb->m_Modules; Module != NULL; Module = (MODULE*)Module->Pnext) else for ( Module = m_Parent->m_Pcb->m_Modules; Module != NULL; Module = (MODULE*)Module->Pnext)
{ {
if( WildCompareString( s_OldStringFound, Module->m_Reference->m_Text.GetData(), FALSE ) ) if( WildCompareString( s_OldStringFound, Module->m_Reference->m_Text.GetData(), FALSE ) )
{ {
StartCount++; StartCount++;
if ( StartCount > s_ItemCount ) if ( StartCount > s_ItemCount )
{ {
succes = TRUE; succes = TRUE;
locate_pos = Module->m_Pos; locate_pos = Module->m_Pos;
s_ItemCount++; s_ItemCount++;
break; break;
} }
} }
if( WildCompareString( s_OldStringFound, Module->m_Value->m_Text.GetData(), FALSE ) ) if( WildCompareString( s_OldStringFound, Module->m_Value->m_Text.GetData(), FALSE ) )
{ {
StartCount++; StartCount++;
if ( StartCount > s_ItemCount ) if ( StartCount > s_ItemCount )
{ {
succes = TRUE; succes = TRUE;
locate_pos = Module->m_Pos; locate_pos = Module->m_Pos;
s_ItemCount++; s_ItemCount++;
break; break;
} }
} }
} }
if ( succes ) if ( succes )
{ /* Il y a peut-etre necessite de recadrer le dessin: */ { /* Il y a peut-etre necessite de recadrer le dessin: */
if( ! m_Parent->DrawPanel->IsPointOnDisplay(locate_pos) ) if( ! m_Parent->DrawPanel->IsPointOnDisplay(locate_pos) )
{ {
screen->m_Curseur = locate_pos; screen->m_Curseur = locate_pos;
m_Parent->Recadre_Trace(TRUE); m_Parent->Recadre_Trace(TRUE);
} }
else else
{ // Positionnement du curseur sur l'item { // Positionnement du curseur sur l'item
m_Parent->DrawPanel->CursorOff(m_DC); m_Parent->DrawPanel->CursorOff(m_DC);
screen->m_Curseur = locate_pos; screen->m_Curseur = locate_pos;
GRMouseWarp(m_Parent->DrawPanel, screen->m_Curseur ); GRMouseWarp(m_Parent->DrawPanel, screen->m_Curseur );
m_Parent->DrawPanel->MouseToCursorSchema(); m_Parent->DrawPanel->MouseToCursorSchema();
m_Parent->DrawPanel->CursorOn(m_DC); m_Parent->DrawPanel->CursorOn(m_DC);
} }
if( FindMarker ) msg = _("Marker found"); if( FindMarker ) msg = _("Marker found");
else msg.Printf( _("<%s> Found"), s_OldStringFound.GetData() ); else msg.Printf( _("<%s> Found"), s_OldStringFound.GetData() );
m_Parent->Affiche_Message(msg); m_Parent->Affiche_Message(msg);
EndModal(1); EndModal(1);
} }
else else
{ {
m_Parent->Affiche_Message(wxEmptyString); m_Parent->Affiche_Message(wxEmptyString);
if( FindMarker ) msg = _("Marker not found"); if( FindMarker ) msg = _("Marker not found");
else msg.Printf( _("<%s> Not Found"), s_OldStringFound.GetData()); else msg.Printf( _("<%s> Not Found"), s_OldStringFound.GetData());
DisplayError(this,msg, 10); DisplayError(this,msg, 10);
EndModal(0); EndModal(0);
} }
} }
...@@ -180,15 +180,15 @@ WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( ) ...@@ -180,15 +180,15 @@ WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( )
} }
WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( WinEDA_BasePcbFrame *parent, wxDC * DC, WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( WinEDA_BasePcbFrame *parent, wxDC * DC,
const wxPoint& pos, const wxPoint& pos,
wxWindowID id, const wxString& caption, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxSize& size, long style )
{ {
m_Parent = parent; m_Parent = parent;
m_DC = DC; m_DC = DC;
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
m_NewText->SetFocus(); m_NewText->SetFocus();
} }
/*! /*!
...@@ -219,7 +219,7 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent, wxWindowID id, const wxStrin ...@@ -219,7 +219,7 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent, wxWindowID id, const wxStrin
void WinEDA_PcbFindFrame::CreateControls() void WinEDA_PcbFindFrame::CreateControls()
{ {
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_PcbFindFrame content construction ////@begin WinEDA_PcbFindFrame content construction
// Generated by DialogBlocks, 04/03/2006 14:04:20 (unregistered) // Generated by DialogBlocks, 04/03/2006 14:04:20 (unregistered)
...@@ -304,7 +304,7 @@ wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name ) ...@@ -304,7 +304,7 @@ wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name )
void WinEDA_PcbFindFrame::OnFindItemClick( wxCommandEvent& event ) void WinEDA_PcbFindFrame::OnFindItemClick( wxCommandEvent& event )
{ {
FindItem(event); FindItem(event);
} }
/*! /*!
...@@ -313,7 +313,7 @@ void WinEDA_PcbFindFrame::OnFindItemClick( wxCommandEvent& event ) ...@@ -313,7 +313,7 @@ void WinEDA_PcbFindFrame::OnFindItemClick( wxCommandEvent& event )
void WinEDA_PcbFindFrame::OnFindNextItemClick( wxCommandEvent& event ) void WinEDA_PcbFindFrame::OnFindNextItemClick( wxCommandEvent& event )
{ {
FindItem(event); FindItem(event);
} }
/*! /*!
...@@ -322,7 +322,7 @@ void WinEDA_PcbFindFrame::OnFindNextItemClick( wxCommandEvent& event ) ...@@ -322,7 +322,7 @@ void WinEDA_PcbFindFrame::OnFindNextItemClick( wxCommandEvent& event )
void WinEDA_PcbFindFrame::OnFindMarkerClick( wxCommandEvent& event ) void WinEDA_PcbFindFrame::OnFindMarkerClick( wxCommandEvent& event )
{ {
FindItem(event); FindItem(event);
} }
/*! /*!
...@@ -331,7 +331,7 @@ void WinEDA_PcbFindFrame::OnFindMarkerClick( wxCommandEvent& event ) ...@@ -331,7 +331,7 @@ void WinEDA_PcbFindFrame::OnFindMarkerClick( wxCommandEvent& event )
void WinEDA_PcbFindFrame::OnFindNextMarkerClick( wxCommandEvent& event ) void WinEDA_PcbFindFrame::OnFindNextMarkerClick( wxCommandEvent& event )
{ {
FindItem(event); FindItem(event);
} }
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