Commit 1b1be195 authored by charras's avatar charras

changes in modedit for MacOSX compatibility

parent 8bf79111
......@@ -188,8 +188,7 @@ public:
int DrawMode, int color, int type );
// Gestion des modules
void InstallModuleOptionsFrame( MODULE* Module,
wxDC* DC, const wxPoint& pos );
void InstallModuleOptionsFrame( MODULE* Module, wxDC * DC );
MODULE* Copie_Module( MODULE* module );
MODULE* Exchange_Module( wxWindow* winaff,
MODULE* old_module,
......@@ -228,7 +227,7 @@ public:
// module texts
void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC );
void DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC );
void DeleteTextModule( TEXTE_MODULE* Text );
void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC );
void StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC );
TEXTE_MODULE* CreateTextModule( MODULE* Module, wxDC* DC );
......@@ -1000,9 +999,9 @@ private:
public:
// Footprint edition
void Place_Ancre( MODULE* module, wxDC* DC );
void RemoveStruct( EDA_BaseStruct* Item, wxDC* DC );
void Transform( MODULE* module, wxDC* DC, int transform );
void Place_Ancre( MODULE* module );
void RemoveStruct( EDA_BaseStruct* Item );
void Transform( MODULE* module, int transform );
// loading Footprint
MODULE* Import_Module( wxDC* DC );
......@@ -1010,9 +1009,9 @@ public:
void Load_Module_Module_From_BOARD( MODULE* Module );
// functions to edit footprint edges
void Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC );
void Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC );
void Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC );
void Edit_Edge_Width( EDGE_MODULE* Edge );
void Edit_Edge_Layer( EDGE_MODULE* Edge );
void Delete_Edge_Module( EDGE_MODULE* Edge );
EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge );
void End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC );
void Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC );
......
No preview for this file type
......@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-21 17:31+0100\n"
"PO-Revision-Date: 2009-05-21 17:37+0100\n"
"PO-Revision-Date: 2009-05-21 18:16+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
......@@ -290,11 +290,11 @@ msgstr "Nettoyage segments nulls"
#: pcbnew/clean.cpp:506
msgid "Merging Segments:"
msgstr "Fusionner Segments:"
msgstr "Fusion des Segments:"
#: pcbnew/clean.cpp:508
msgid "Merge"
msgstr "Fusionner"
msgstr "Fusion"
#: pcbnew/clean.cpp:508
msgid "0"
......@@ -374,7 +374,7 @@ msgstr "Erreur en Chargement de librairie"
#: pcbnew/loadcmp.cpp:221
#, c-format
msgid "Could not open PCB footprint library file <%s>."
msgstr "Ne peu ouvrir le fichier librairie de modules PCB <%s>."
msgstr "Ne peut ouvrir le fichier librairie de modules PCB <%s>."
#: pcbnew/loadcmp.cpp:228
#, c-format
......
......@@ -37,9 +37,8 @@ END_EVENT_TABLE()
/**************************************************************************************/
WinEDA_ModulePropertiesFrame::WinEDA_ModulePropertiesFrame( WinEDA_BasePcbFrame* parent,
MODULE* Module, wxDC* DC,
const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Module properties" ), framepos, wxDefaultSize, DIALOG_STYLE )
MODULE* Module, wxDC* DC ) :
wxDialog( parent, -1, _( "Module properties" ), wxDefaultPosition, wxDefaultSize, DIALOG_STYLE )
/**************************************************************************************/
{
wxString number;
......@@ -813,7 +812,7 @@ void WinEDA_ModulePropertiesFrame::EditOrDelTextModule( wxCommandEvent& event )
Line.Printf( _( "Delete [%s]" ), Text->m_Text.GetData() );
if( !IsOK( this, Line ) )
goto out;
m_Parent->DeleteTextModule( Text, m_DC );
m_Parent->DeleteTextModule( Text );
ReCreateFieldListBox();
m_TextListBox->SetSelection( 0 );
}
......
......@@ -54,7 +54,7 @@ private:
public:
// Constructor and destructor
WinEDA_ModulePropertiesFrame(WinEDA_BasePcbFrame *parent,
MODULE * Module, wxDC * DC, const wxPoint & pos);
MODULE * Module, wxDC * DC);
~WinEDA_ModulePropertiesFrame()
{
}
......
......@@ -144,7 +144,7 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/***************************************************************************/
void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge )
/***************************************************************************/
/* Change the EDGE_MODULE Edge width,
......@@ -179,7 +179,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
/***************************************************************************/
void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC )
void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
/***************************************************************************/
/* Change the EDGE_MODULE Edge layer, (The new layer will be asked)
......@@ -267,12 +267,11 @@ void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
/****************************************************************************/
void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge )
/****************************************************************************/
/* Edition of the edge items width
* delete EDGE_MODULE Edge if Edge != NULL
* @param Edge = edge to edit, or NULL
* @param DC = current Device Context
/** Function Delete_Edge_Module
* delete EDGE_MODULE Edge
* @param Edge = edge to delete
*/
{
if( Edge == NULL )
......@@ -284,7 +283,6 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
}
MODULE* Module = (MODULE*) Edge->GetParent();
Edge->Draw( DrawPanel, DC, GR_XOR );
/* suppression d'un segment */
Edge ->DeleteStructure();
......
......@@ -697,7 +697,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
break;
InstallModuleOptionsFrame( (MODULE*) GetCurItem(), &dc, pos );
InstallModuleOptionsFrame( (MODULE*) GetCurItem(), &dc );
DrawPanel->MouseToCursorSchema();
break;
......@@ -756,7 +756,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_PCB_DELETE_TEXTMODULE:
DeleteTextModule( (TEXTE_MODULE*) GetCurItem(), &dc );
DeleteTextModule( (TEXTE_MODULE*) GetCurItem() );
SetCurItem( NULL );
DrawPanel->MouseToCursorSchema();
break;
......
......@@ -19,23 +19,19 @@
/* Variables locales: */
bool GoToEditor = FALSE;
/**************************************/
/* class WinEDA_ModulePropertiesFrame */
/**************************************/
/* class WinEDA_ModulePropertiesFrame */
#include "dialog_edit_module.cpp"
/*******************************************************************/
void WinEDA_BasePcbFrame::InstallModuleOptionsFrame( MODULE* Module,
wxDC* DC,
const wxPoint& pos )
void WinEDA_BasePcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC * DC )
/*******************************************************************/
/* Fonction relai d'installation de la frame d'dition des proprietes
* du module*/
{
WinEDA_ModulePropertiesFrame* frame =
new WinEDA_ModulePropertiesFrame( this, Module, DC, pos );
new WinEDA_ModulePropertiesFrame( this, Module, DC );
frame->ShowModal(); frame->Destroy();
......@@ -61,7 +57,7 @@ void WinEDA_BasePcbFrame::InstallModuleOptionsFrame( MODULE* Module,
/*******************************************************************/
void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod, wxDC* DC )
void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
/*******************************************************************/
/*
......@@ -69,32 +65,27 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod, wxDC* DC )
* Le module doit etre d'abort selectionne
*/
{
int deltaX, deltaY;
wxPoint delta;
EDA_BaseStruct* PtStruct;
D_PAD* pt_pad;
if( pt_mod == NULL )
return;
pt_mod->DrawAncre( DrawPanel, DC, wxPoint( 0, 0 ),
DIM_ANCRE_MODULE, GR_XOR );
deltaX = pt_mod->m_Pos.x - GetScreen()->m_Curseur.x;
deltaY = pt_mod->m_Pos.y - GetScreen()->m_Curseur.y;
delta = pt_mod->m_Pos - GetScreen()->m_Curseur;
pt_mod->m_Pos = GetScreen()->m_Curseur;
/* Mise a jour des coord relatives des elements:
* les coordonnees relatives sont relatives a l'ancre, pour orient 0.
* il faut donc recalculer deltaX et deltaY en orientation 0 */
RotatePoint( &deltaX, &deltaY, -pt_mod->m_Orient );
RotatePoint( &delta, -pt_mod->m_Orient );
/* Mise a jour des coord relatives des pads */
pt_pad = (D_PAD*) pt_mod->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{
pt_pad->m_Pos0.x += deltaX;
pt_pad->m_Pos0.y += deltaY;
pt_pad->m_Pos0 += delta;
}
/* Mise a jour des coord relatives contours .. */
......@@ -106,14 +97,14 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod, wxDC* DC )
case TYPE_EDGE_MODULE:
#undef STRUCT
#define STRUCT ( (EDGE_MODULE*) PtStruct )
STRUCT->m_Start0.x += deltaX; STRUCT->m_Start0.y += deltaY;
STRUCT->m_End0.x += deltaX; STRUCT->m_End0.y += deltaY;
STRUCT->m_Start0 += delta;
STRUCT->m_End0 += delta;
break;
case TYPE_TEXTE_MODULE:
#undef STRUCT
#define STRUCT ( (TEXTE_MODULE*) PtStruct )
STRUCT->m_Pos0.x += deltaX; STRUCT->m_Pos0.y += deltaY;
STRUCT->m_Pos0 += delta;
break;
default:
......@@ -122,12 +113,12 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod, wxDC* DC )
}
pt_mod->Set_Rectangle_Encadrement();
pt_mod->DrawAncre( DrawPanel, DC, wxPoint( 0, 0 ), DIM_ANCRE_MODULE, GR_OR );
DrawPanel->Refresh();
}
/**********************************************************************/
void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item, wxDC* DC )
void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item )
/**********************************************************************/
{
if( Item == NULL )
......@@ -152,12 +143,13 @@ void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item, wxDC* DC )
DisplayError( this, _( "Text is VALUE!" ) );
break;
}
DeleteTextModule( text, DC );
DeleteTextModule( text );
}
break;
case TYPE_EDGE_MODULE:
Delete_Edge_Module( (EDGE_MODULE*) Item, DC );
Delete_Edge_Module( (EDGE_MODULE*) Item );
DrawPanel->Refresh();
break;
case TYPE_MODULE:
......
......@@ -88,7 +88,7 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
/**************************************************************************/
void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC )
void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
/**************************************************************************/
/*
......@@ -104,7 +104,6 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC )
if( Text->m_Type == TEXT_is_DIVERS )
{
// Text->Draw( DrawPanel, DC, GR_XOR );
DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
/* liberation de la memoire : */
......
This diff is collapsed.
......@@ -52,7 +52,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
wxString msg;
msg.Printf(
wxT(
"WinEDA_ModEditFrame::ProcessCommand err: m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
"WinEDA_ModEditFrame::OnLeftClick err: m_Flags != 0\nStruct @%p, type %d m_Flag %X" ),
DrawStruct, DrawStruct->Type(), DrawStruct->m_Flags );
DisplayError( this, msg );
DrawStruct->m_Flags = 0;
......@@ -122,7 +122,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct && (DrawStruct->m_Flags == 0) )
{
SaveCopyInUndoList( GetBoard()->m_Modules );
RemoveStruct( DrawStruct, DC );
RemoveStruct( DrawStruct );
SetCurItem( DrawStruct = NULL );
}
}
......@@ -130,7 +130,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case ID_MODEDIT_PLACE_ANCHOR:
SaveCopyInUndoList( GetBoard()->m_Modules );
Place_Ancre( GetBoard()->m_Modules, DC );
Place_Ancre( GetBoard()->m_Modules );
GetBoard()->m_Modules->m_Flags = 0;
GetScreen()->m_Curseur = wxPoint( 0, 0 );
Recadre_Trace( TRUE );
......@@ -401,8 +401,7 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break;
case TYPE_MODULE:
InstallModuleOptionsFrame( (MODULE*) DrawStruct,
&dc, pos );
InstallModuleOptionsFrame( (MODULE*) DrawStruct, &dc );
DrawPanel->MouseToCursorSchema();
break;
......
......@@ -214,10 +214,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( DrawStruct )
DrawPanel->m_AutoPAN_Request = TRUE;
}
else if( DrawStruct &&
// (DrawStruct->Type() == TYPE_TRACK) &&
(DrawStruct->m_Flags & IS_NEW) )
else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) )
{
TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC );
if( track ) // c'est a dire si OK
......@@ -391,7 +388,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break;
case TYPE_MODULE:
InstallModuleOptionsFrame( (MODULE*) DrawStruct, &dc, pos );
InstallModuleOptionsFrame( (MODULE*) DrawStruct, &dc );
DrawPanel->MouseToCursorSchema();
break;
......
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