GetScreen() work, menu capitalization, beautifying

This commit is contained in:
dickelbeck 2008-04-17 16:25:29 +00:00
parent 25d0403221
commit 721d878fcf
95 changed files with 3356 additions and 2832 deletions

View File

@ -5,18 +5,33 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+all
* Made a little more sense out of the GetScreen() problem by making it
non-virtual, and having the two types of frame classes (eeschema's and pcbnew's)
each return their respective types of screens {SCH,PCB}_SCREEN*.
* Added GetBaseScreen() as the virtual function which always returns BASE_SCREEN*.
* Made WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint Mouse ){ dummy }
* Added WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint Mouse );
* Moved to void <class>::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) from
void <class>::Place( WinEDA_DrawFrame* frame, wxDC* DC ) so that these
functions can use the new SCH_SCREEN* WinEDA_SchematicFrame::GetScreen()
function (the non-virtual one that returns SCH_SCREEN* not BASE_SCREEN*).
* Made some menus conformant to UIpolicies.txt regarding uppercase.
* Beautified 5-10 files.
2008-Apr-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
very small bug in display component info removed
+pcbnew
+cvpcb
removed bug: forgotten paths when adding lib files when not in the default lib path
(same problem as in eeschema, solved in 2008-Apr-09 Update)
2008-Apr-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema

View File

@ -131,7 +131,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
* Init the Block infos: command type, initial position, and other variables..
*/
{
DrawBlockStruct* Block = & GetScreen()->BlockLocate;
DrawBlockStruct* Block = & GetBaseScreen()->BlockLocate;
if( (Block->m_Command != BLOCK_IDLE)
|| ( Block->m_State != STATE_NO_BLOCK) )
@ -169,7 +169,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
if( Block->m_BlockDrawStruct == NULL ) /* No data to paste */
{
DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetBaseScreen()->BlockLocate.m_Command = BLOCK_IDLE;
DrawPanel->ManageCurseur = NULL;
return TRUE;
}

View File

@ -42,7 +42,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event )
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
{
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
if( GetBaseScreen()->BlockLocate.m_Command != BLOCK_IDLE )
DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
DrawPanel->m_PanelDefaultCursor ) );

View File

@ -321,7 +321,7 @@ wxString WinEDA_DrawFrame::GetScreenDesc()
{
wxString msg;
msg << GetScreen()->m_ScreenNumber << wxT( "/" ) <<
GetScreen()->m_NumberOfScreen;
msg << GetBaseScreen()->m_ScreenNumber << wxT( "/" )
<< GetBaseScreen()->m_NumberOfScreen;
return msg;
}

View File

@ -1,7 +1,7 @@
/***********************************************************/
/* wxstruct.h: */
/* descriptions des principales classes derivees utilisees */
/***********************************************************/
/***********************************************************/
/* wxstruct.h: */
/* descriptions des principales classes derivees utilisees */
/***********************************************************/
#ifndef CVSTRUCT_H
#define CVSTRUCT_H
@ -21,66 +21,66 @@ class STORECMP;
#define LIST_BOX_TYPE wxListView
/******************************************************/
/* classe derivee pour la Fenetre principale de cvpcb */
/******************************************************/
/******************************************************/
/* classe derivee pour la Fenetre principale de cvpcb */
/******************************************************/
class WinEDA_CvpcbFrame: public WinEDA_BasicFrame
class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
{
public:
FootprintListBox * m_FootprintList;
ListBoxCmp * m_ListCmp;
WinEDA_DisplayFrame * DrawFrame;
WinEDA_Toolbar * m_HToolBar; // Toolbar horizontal haut d'ecran
FootprintListBox* m_FootprintList;
ListBoxCmp* m_ListCmp;
WinEDA_DisplayFrame* DrawFrame;
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
private:
wxMenu * m_FilesMenu;
wxMenu* m_FilesMenu;
// Constructor and destructor
public:
WinEDA_CvpcbFrame(WinEDA_App * parent, const wxString & title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE);
WinEDA_CvpcbFrame( WinEDA_App * parent, const wxString &title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_CvpcbFrame();
void OnLeftClick(wxListEvent & event);
void OnLeftDClick(wxListEvent & event);
void OnSelectComponent(wxListEvent & event);
void OnLeftClick( wxListEvent& event );
void OnLeftDClick( wxListEvent& event );
void OnSelectComponent( wxListEvent& event );
void Update_Config(wxCommandEvent& event);/* enregistrement de la config */
void OnQuit(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent & Event);
void OnSize(wxSizeEvent& SizeEvent);
void OnChar(wxKeyEvent& event);
void Update_Config( wxCommandEvent& event ); /* enregistrement de la config */
void OnQuit( wxCommandEvent& event );
void OnCloseWindow( wxCloseEvent& Event );
void OnSize( wxSizeEvent& SizeEvent );
void OnChar( wxKeyEvent& event );
void ReCreateHToolbar();
virtual void ReCreateMenuBar();
void SetLanguage(wxCommandEvent& event);
void AddFontSelectionMenu(wxMenu * main_menu);
void ProcessFontPreferences(wxCommandEvent& event);
void SetLanguage( wxCommandEvent& event );
void AddFontSelectionMenu( wxMenu* main_menu );
void ProcessFontPreferences( wxCommandEvent& event );
void ToFirstNA(wxCommandEvent& event);
void ToPreviousNA(wxCommandEvent& event);
void DelAssociations(wxCommandEvent& event);
void SaveQuitCvpcb(wxCommandEvent& event);
void LoadNetList(wxCommandEvent& event);
void ConfigCvpcb(wxCommandEvent& event);
void DisplayModule(wxCommandEvent& event);
void AssocieModule(wxCommandEvent& event);
void WriteStuffList(wxCommandEvent & event);
void DisplayDocFile(wxCommandEvent & event);
void OnSelectFilteringFootprint(wxCommandEvent & event);
void SetNewPkg(const wxString & package);
void ToFirstNA( wxCommandEvent& event );
void ToPreviousNA( wxCommandEvent& event );
void DelAssociations( wxCommandEvent& event );
void SaveQuitCvpcb( wxCommandEvent& event );
void LoadNetList( wxCommandEvent& event );
void ConfigCvpcb( wxCommandEvent& event );
void DisplayModule( wxCommandEvent& event );
void AssocieModule( wxCommandEvent& event );
void WriteStuffList( wxCommandEvent& event );
void DisplayDocFile( wxCommandEvent& event );
void OnSelectFilteringFootprint( wxCommandEvent& event );
void SetNewPkg( const wxString& package );
void BuildCmpListBox();
void BuildFootprintListBox();
void CreateScreenCmp();
void CreateConfigWindow();
int SaveNetList(const wxString & FullFileName);
int SaveComponentList(const wxString & FullFileName);
bool ReadInputNetList(const wxString & FullFileName);
int SaveNetList( const wxString& FullFileName );
int SaveComponentList( const wxString& FullFileName );
bool ReadInputNetList( const wxString& FullFileName );
void ReadNetListe();
int rdpcad();
int ReadSchematicNetlist();
int ReadFootprintFilterList( FILE * f);
int ReadFootprintFilterList( FILE* f );
int ReadViewlogicWirList();
int ReadViewlogicNetList();
@ -91,53 +91,54 @@ public:
/***********************************************/
/* ListBox derivee pour l'affichage des listes */
/***********************************************/
class ListBoxBase: public LIST_BOX_TYPE
class ListBoxBase : public LIST_BOX_TYPE
{
public:
WinEDA_CvpcbFrame * m_Parent;
WinEDA_CvpcbFrame* m_Parent;
public:
ListBoxBase(WinEDA_CvpcbFrame * parent, wxWindowID id,
const wxPoint& loc, const wxSize& size);
ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id,
const wxPoint &loc, const wxSize &size );
~ListBoxBase();
int GetSelection();
void OnSize(wxSizeEvent& event);
void OnSize( wxSizeEvent& event );
};
/************************************************************/
/* ListBox derivee pour l'affichage de la liste des Modules */
/************************************************************/
class FootprintListBox: public ListBoxBase
class FootprintListBox : public ListBoxBase
{
private:
wxArrayString m_FullFootprintList;
wxArrayString m_FilteredFootprintList;
public:
wxArrayString * m_ActiveFootprintList;
wxArrayString* m_ActiveFootprintList;
bool m_UseFootprintFullList;
public:
FootprintListBox(WinEDA_CvpcbFrame * parent,
wxWindowID id, const wxPoint& loc, const wxSize& size,
int nbitems, wxString choice[]);
FootprintListBox( WinEDA_CvpcbFrame * parent,
wxWindowID id, const wxPoint &loc, const wxSize &size,
int nbitems, wxString choice[] );
~FootprintListBox();
int GetCount();
void SetSelection(unsigned index, bool State = TRUE);
void SetString(unsigned linecount, const wxString & text);
void AppendLine(const wxString & text);
void SetSelection( unsigned index, bool State = TRUE );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
void SetFootprintFullList();
void SetFootprintFilteredList(STORECMP * Component);
void SetActiveFootprintList(bool FullList, bool Redraw = FALSE);
void SetFootprintFilteredList( STORECMP* Component );
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
wxString GetSelectedFootprint();
wxString OnGetItemText(long item, long column) const;
void OnLeftClick(wxListEvent & event);
void OnLeftDClick(wxListEvent & event);
wxString OnGetItemText( long item, long column ) const;
void OnLeftClick( wxListEvent& event );
void OnLeftDClick( wxListEvent& event );
DECLARE_EVENT_TABLE()
};
@ -145,67 +146,66 @@ public:
/* ListBox derivee pour l'affichage de la liste des Composants */
/***************************************************************/
class ListBoxCmp: public ListBoxBase
class ListBoxCmp : public ListBoxBase
{
public:
wxArrayString m_ComponentList;
WinEDA_CvpcbFrame * m_Parent;
WinEDA_CvpcbFrame* m_Parent;
public:
ListBoxCmp(WinEDA_CvpcbFrame * parent, wxWindowID id,
const wxPoint& loc, const wxSize& size,
int nbitems, wxString choice[]);
ListBoxCmp( WinEDA_CvpcbFrame * parent, wxWindowID id,
const wxPoint &loc, const wxSize &size,
int nbitems, wxString choice[] );
~ListBoxCmp();
void Clear();
int GetCount();
wxString OnGetItemText(long item, long column) const;
void SetSelection(unsigned index, bool State = TRUE);
void SetString(unsigned linecount, const wxString & text);
void AppendLine(const wxString & text);
wxString OnGetItemText( long item, long column ) const;
void SetSelection( unsigned index, bool State = TRUE );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
DECLARE_EVENT_TABLE()
};
/*******************************************************/
/* class WWinEDA_DisplayFrame: public WinEDA_DrawFrame */
/*******************************************************/
/*******************************************************/
/* class WWinEDA_DisplayFrame: public WinEDA_DrawFrame */
/*******************************************************/
class WinEDA_DisplayFrame: public WinEDA_BasePcbFrame
class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
{
public:
public:
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App *parent,
const wxString & title,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE);
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App * parent,
const wxString &title,
const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_DisplayFrame();
void OnCloseWindow(wxCloseEvent & Event);
void Process_Special_Functions(wxCommandEvent& event);
void RedrawActiveWindow(wxDC * DC, bool EraseBg);
void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar();
void ReCreateVToolbar();
void RecreateMenuBar();
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
bool OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void SetToolbars();
void GeneralControle( wxDC* DC, wxPoint Mouse );
void InstallOptionsDisplay(wxCommandEvent& event);
MODULE * Get_Module(const wxString & CmpName);
void InstallOptionsDisplay( wxCommandEvent& event );
MODULE* Get_Module( const wxString& CmpName );
void Process_Settings(wxCommandEvent& event);
void Show3D_Frame(wxCommandEvent& event);
void Process_Settings( wxCommandEvent& event );
void Show3D_Frame( wxCommandEvent& event );
DECLARE_EVENT_TABLE()
};
#endif //#ifndef CVSTRUCT_H

View File

@ -53,7 +53,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
m_Pcb = new BOARD( NULL, this );
m_CurrentScreen = new PCB_SCREEN( CVPCB_DISPLAY_FRAME );
SetBaseScreen( new PCB_SCREEN( CVPCB_DISPLAY_FRAME ) );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
@ -66,10 +66,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
/******************************************/
WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
/******************************************/
// Destructor
{
delete m_CurrentScreen;
delete GetBaseScreen();
SetBaseScreen( 0 );
delete m_Pcb;
@ -177,14 +176,14 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{
wxSize delta;
int flagcurseur = 0;
int zoom = m_CurrentScreen->GetZoom();
int zoom = GetScreen()->GetZoom();
wxPoint curpos, oldpos;
curpos = DrawPanel->CursorRealPosition( Mouse );
oldpos = m_CurrentScreen->m_Curseur;
oldpos = GetScreen()->m_Curseur;
delta.x = m_CurrentScreen->GetGrid().x / zoom;
delta.y = m_CurrentScreen->GetGrid().y / zoom;
delta.x = GetScreen()->GetGrid().x / zoom;
delta.y = GetScreen()->GetGrid().y / zoom;
if( delta.x <= 0 )
delta.x = 1;
if( delta.y <= 0 )
@ -197,13 +196,13 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F1:
OnZoom( ID_ZOOM_IN_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case WXK_F2:
OnZoom( ID_ZOOM_OUT_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case WXK_F3:
@ -214,11 +213,11 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F4:
OnZoom( ID_ZOOM_CENTER_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case ' ':
m_CurrentScreen->m_O_Curseur = m_CurrentScreen->m_Curseur;
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break;
case WXK_NUMPAD8: /* cursor moved up */
@ -251,26 +250,26 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
}
}
m_CurrentScreen->m_Curseur = curpos;
GetScreen()->m_Curseur = curpos;
/* Put cursor on grid */
PutOnGrid( &m_CurrentScreen->m_Curseur );
PutOnGrid( &GetScreen()->m_Curseur );
if( m_CurrentScreen->IsRefreshReq() )
if( GetScreen()->IsRefreshReq() )
{
flagcurseur = 2;
RedrawActiveWindow( DC, TRUE );
}
if( (oldpos.x != m_CurrentScreen->m_Curseur.x)
|| (oldpos.y != m_CurrentScreen->m_Curseur.y) )
if( (oldpos.x != GetScreen()->m_Curseur.x)
|| (oldpos.y != GetScreen()->m_Curseur.y) )
{
if( flagcurseur != 2 )
{
curpos = m_CurrentScreen->m_Curseur;
m_CurrentScreen->m_Curseur = oldpos;
curpos = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
m_CurrentScreen->m_Curseur = curpos;
GetScreen()->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
}

View File

@ -479,7 +479,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{
DrawBlockStruct* PtBlock;
DrawPickedStruct* PickedList;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
PtBlock = &panel->GetScreen()->BlockLocate;
GRSetDrawMode( DC, g_XorMode );

View File

@ -435,7 +435,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*/
{
DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
LibEDA_BaseStruct* item;
wxPoint move_offset;

View File

@ -370,7 +370,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
*/
{
EDA_DrawLineStruct* CurrentLine =
(EDA_DrawLineStruct*) panel->m_Parent->GetScreen()->GetCurItem();
(EDA_DrawLineStruct*) panel->GetScreen()->GetCurItem();
EDA_DrawLineStruct* segment;
int color;
@ -390,7 +390,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
}
}
wxPoint endpos = panel->m_Parent->GetScreen()->m_Curseur;
wxPoint endpos = panel->GetScreen()->m_Curseur;
if( g_HVLines ) /* Coerce the line to vertical or horizontal one: */
{
ComputeBreakPoint( CurrentLine, endpos );
@ -463,11 +463,11 @@ static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool eras
*/
{
DrawPolylineStruct* NewPoly =
(DrawPolylineStruct*) panel->m_Parent->GetScreen()->GetCurItem();
(DrawPolylineStruct*) panel->GetScreen()->GetCurItem();
int color;
wxPoint endpos;
endpos = panel->m_Parent->GetScreen()->m_Curseur;
endpos = panel->GetScreen()->m_Curseur;
color = ReturnLayerColor( NewPoly->GetLayer() );
GRSetDrawMode( DC, g_XorMode );

View File

@ -56,7 +56,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* Dessin du Segment "BusEntry" lors des deplacements du curseur
*/
{
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem();
if( BusEntry == NULL )

View File

@ -218,13 +218,13 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
/****************************************************************/
void DrawSheetStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/****************************************************************/
{
/* Placement en liste des structures si nouveau composant:*/
if( m_Flags & IS_NEW )
{
if( !( (WinEDA_SchematicFrame*) frame )->EditSheet( this, DC ) )
if( !frame->EditSheet( this, DC ) )
{
frame->GetScreen()->SetCurItem( NULL );
frame->DrawPanel->ManageCurseur = NULL;

View File

@ -40,13 +40,13 @@ public:
Hierarchical_PIN_Sheet_Struct* Next()
{ return (Hierarchical_PIN_Sheet_Struct*) Pnext; }
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
@ -99,7 +99,7 @@ public:
*/
bool Save( FILE* aFile ) const;
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC );

View File

@ -42,7 +42,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
/***************************************************************/
void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***************************************************************/
/* place the struct in EEDrawList.
@ -52,12 +52,12 @@ void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
{
if( m_Flags & IS_NEW )
{
SCH_SCREEN* screen = (SCH_SCREEN*) frame->GetScreen();
SCH_SCREEN* screen = frame->GetScreen();
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
screen->AddToDrawList( this );
g_ItemToRepeat = this;
if( frame->m_Ident == SCHEMATIC_FRAME )
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_NEW );
frame->SaveCopyInUndoList( this, IS_NEW );
}
m_Flags = 0;

View File

@ -94,7 +94,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
/***************************************************************/
void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_TEXT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***************************************************************/
{
/* save old text in undo list */
@ -104,7 +104,7 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );

View File

@ -101,7 +101,7 @@ public:
void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundingBox();
/**

View File

@ -418,7 +418,7 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
/***********************************************************************/
void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_COMPONENT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***********************************************************************/
{
/* save old text in undo list */
@ -430,7 +430,7 @@ void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );

View File

@ -57,7 +57,7 @@ public:
void PartTextCopy( PartTextStruct* target );
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundaryBox() const;
bool IsVoid();
@ -164,7 +164,7 @@ public:
void SwapData( SCH_COMPONENT* copyitem );
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
//returns a unique ID, in the form of a path.

View File

@ -217,11 +217,11 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
/***********************************************************************/
void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
/***********************************************************************/
{
wxSize delta;
SCH_SCREEN* screen = (SCH_SCREEN*)GetScreen();
SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
@ -323,7 +323,7 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
curpos = screen->m_Curseur;
screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = curpos;
screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )

View File

@ -1,4 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_options.cpp
// Purpose:
// Author: jean-pierre Charras
@ -11,7 +12,7 @@
// Generated by DialogBlocks (unregistered), 31/01/2006 13:27:33
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#pragma implementation "dialog_options.h"
#endif
@ -47,13 +48,13 @@
////@end XPM images
/**************************************************************************/
void DisplayOptionFrame(WinEDA_DrawFrame * parent, const wxPoint & framepos)
void DisplayOptionFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos )
/**************************************************************************/
{
WinEDA_SetOptionsFrame * frame =
new WinEDA_SetOptionsFrame(parent);
WinEDA_SetOptionsFrame* frame =
new WinEDA_SetOptionsFrame( parent );
frame->ShowModal(); frame->Destroy();
}
@ -71,9 +72,9 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_SetOptionsFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_SetOptionsFrame, wxDialog )
////@begin WinEDA_SetOptionsFrame event table entries
EVT_BUTTON( wxID_OK, WinEDA_SetOptionsFrame::OnOkClick )
EVT_BUTTON( wxID_OK, WinEDA_SetOptionsFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_SetOptionsFrame::OnCancelClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_SetOptionsFrame::OnCancelClick )
////@end WinEDA_SetOptionsFrame event table entries
@ -83,77 +84,92 @@ END_EVENT_TABLE()
* WinEDA_SetOptionsFrame constructors
*/
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( )
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame()
{
}
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( WinEDA_DrawFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( WinEDA_DrawFrame* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{
m_Parent = parent;
Create(parent, id, caption, pos, size, style);
Create( parent, id, caption, pos, size, style );
BASE_SCREEN* screen = m_Parent->GetBaseScreen();
/* Init options */
if ( m_Parent->GetScreen() )
if( screen )
{
switch( m_Parent->GetScreen()->GetGrid().x )
switch( screen->GetGrid().x )
{
case 50:
m_SelGridSize->SetSelection(0);
m_SelGridSize->SetSelection( 0 );
break;
case 25:
m_SelGridSize->SetSelection(1);
m_SelGridSize->SetSelection( 1 );
break;
case 10:
m_SelGridSize->SetSelection(2);
m_SelGridSize->SetSelection( 2 );
break;
case 5:
m_SelGridSize->SetSelection(3);
m_SelGridSize->SetSelection( 3 );
break;
case 2:
m_SelGridSize->SetSelection(4);
m_SelGridSize->SetSelection( 4 );
break;
case 1:
m_SelGridSize->SetSelection(5);
m_SelGridSize->SetSelection( 5 );
break;
default:
DisplayError(this, wxT("WinEDA_SetOptionsFrame: Grid value not handle"));
DisplayError( this, wxT( "WinEDA_SetOptionsFrame: Grid value not handle" ) );
break;
}
}
/* Adjust the current selections and options: */
m_ShowGridOpt->SetValue(m_Parent->m_Draw_Grid);
m_AutoPANOpt->SetValue(m_Parent->DrawPanel-> m_AutoPAN_Enable);
m_SelShowPins->SetSelection( g_ShowAllPins ? TRUE : FALSE);
m_Selunits->SetSelection( g_UnitMetric ? 0 : 1);
m_SelDirWires->SetSelection( g_HVLines ? 0 : 1);
m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1);
wxString msg;
msg = ReturnStringFromValue( g_UnitMetric,g_RepeatStep.x, m_Parent->m_InternalUnits);
m_ShowGridOpt->SetValue( m_Parent->m_Draw_Grid );
m_AutoPANOpt->SetValue( m_Parent->DrawPanel->m_AutoPAN_Enable );
m_SelShowPins->SetSelection( g_ShowAllPins ? TRUE : FALSE );
m_Selunits->SetSelection( g_UnitMetric ? 0 : 1 );
m_SelDirWires->SetSelection( g_HVLines ? 0 : 1 );
m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1 );
wxString msg;
msg = ReturnStringFromValue( g_UnitMetric, g_RepeatStep.x, m_Parent->m_InternalUnits );
m_DeltaStepCtrl_X->SetValue( msg );
wxString title = _("Delta Step X") + ReturnUnitSymbol(g_UnitMetric);
wxString title = _( "Delta Step X" ) + ReturnUnitSymbol( g_UnitMetric );
m_DeltaStepXTitle->SetLabel( title );
msg = ReturnStringFromValue( g_UnitMetric,g_RepeatStep.y, m_Parent->m_InternalUnits);
msg = ReturnStringFromValue( g_UnitMetric, g_RepeatStep.y, m_Parent->m_InternalUnits );
m_DeltaStepCtrl_Y->SetValue( msg );
title = _("Delta Step Y") + ReturnUnitSymbol(g_UnitMetric);
title = _( "Delta Step Y" ) + ReturnUnitSymbol( g_UnitMetric );
m_DeltaStepYTitle->SetLabel( title );
m_DeltaLabelCtrl->SetValue( g_RepeatDeltaLabel );
}
/*!
* WinEDA_SetOptionsFrame creator
*/
bool WinEDA_SetOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
bool WinEDA_SetOptionsFrame::Create( wxWindow* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{
////@begin WinEDA_SetOptionsFrame member initialisation
m_DrawOptionsSizer = NULL;
@ -171,148 +187,233 @@ bool WinEDA_SetOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxSt
m_DeltaStepCtrl_Y = NULL;
m_DeltaIncTitle = NULL;
m_DeltaLabelCtrl = NULL;
////@end WinEDA_SetOptionsFrame member initialisation
////@begin WinEDA_SetOptionsFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
if( GetSizer() )
{
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
}
Centre();
////@end WinEDA_SetOptionsFrame creation
return true;
}
/*!
* Control creation for WinEDA_SetOptionsFrame
*/
void WinEDA_SetOptionsFrame::CreateControls()
{
SetFont(*g_DialogFont);
SetFont( *g_DialogFont );
////@begin WinEDA_SetOptionsFrame content construction
// Generated by DialogBlocks, 23/02/2007 10:59:46 (unregistered)
WinEDA_SetOptionsFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemDialog1->SetSizer( itemBoxSizer2 );
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Draw Options:"));
m_DrawOptionsSizer = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(m_DrawOptionsSizer, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxVERTICAL );
m_ShowGridOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Show grid"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_ShowGridOpt->SetValue(false);
m_DrawOptionsSizer->Add(m_ShowGridOpt, 0, wxALIGN_LEFT|wxALL, 5);
itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
"Draw Options:" ) );
m_DrawOptionsSizer = new wxStaticBoxSizer( itemStaticBoxSizer4Static,
wxVERTICAL );
itemBoxSizer3->Add( m_DrawOptionsSizer, 0, wxGROW | wxALL, 5 );
m_ShowGridOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _(
"Show grid" ),
wxDefaultPosition, wxDefaultSize,
wxCHK_2STATE );
m_ShowGridOpt->SetValue( false );
m_DrawOptionsSizer->Add( m_ShowGridOpt, 0, wxALIGN_LEFT | wxALL, 5 );
wxString m_SelGridSizeStrings[] = {
_("Normal (50 mils)"),
_("Small (25 mils)"),
_("Very small (10 mils)"),
_("Special (5 mils)"),
_("Special (2 mils)"),
_("Special (1 mil)")
_( "Normal (50 mils)" ),
_( "Small (25 mils)" ),
_( "Very small (10 mils)" ),
_( "Special (5 mils)" ),
_( "Special (2 mils)" ),
_( "Special (1 mil)" )
};
m_SelGridSize = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Grid Size"), wxDefaultPosition, wxDefaultSize, 6, m_SelGridSizeStrings, 1, wxRA_SPECIFY_COLS );
m_SelGridSize->SetSelection(0);
itemBoxSizer3->Add(m_SelGridSize, 0, wxGROW|wxALL, 5);
m_SelGridSize = new wxRadioBox( itemDialog1, ID_RADIOBOX, _(
"Grid Size" ), wxDefaultPosition, wxDefaultSize, 6,
m_SelGridSizeStrings, 1, wxRA_SPECIFY_COLS );
m_SelGridSize->SetSelection( 0 );
itemBoxSizer3->Add( m_SelGridSize, 0, wxGROW | wxALL, 5 );
wxString m_SelShowPinsStrings[] = {
_("Normal"),
_("Show alls")
_( "Normal" ),
_( "Show alls" )
};
m_SelShowPins = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Show pins"), wxDefaultPosition, wxDefaultSize, 2, m_SelShowPinsStrings, 1, wxRA_SPECIFY_COLS );
m_SelShowPins->SetSelection(0);
itemBoxSizer3->Add(m_SelShowPins, 0, wxGROW|wxALL, 5);
m_SelShowPins = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _(
"Show pins" ), wxDefaultPosition,
wxDefaultSize, 2, m_SelShowPinsStrings, 1,
wxRA_SPECIFY_COLS );
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_SelShowPins->SetSelection( 0 );
itemBoxSizer3->Add( m_SelShowPins, 0, wxGROW | wxALL, 5 );
m_AutoPANOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AutoPANOpt->SetValue(false);
m_AutoPANOpt->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer8->Add(m_AutoPANOpt, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer2->Add( itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_AutoPANOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _(
"Auto PAN" ), wxDefaultPosition, wxDefaultSize,
wxCHK_2STATE );
m_AutoPANOpt->SetValue( false );
m_AutoPANOpt->SetForegroundColour( wxColour( 0, 0, 255 ) );
itemBoxSizer8->Add( m_AutoPANOpt, 0, wxGROW | wxALL, 5 );
wxString m_SelunitsStrings[] = {
_("millimeter"),
_("inches")
_( "millimeter" ),
_( "inches" )
};
m_Selunits = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Units"), wxDefaultPosition, wxDefaultSize, 2, m_SelunitsStrings, 1, wxRA_SPECIFY_COLS );
m_Selunits->SetSelection(0);
itemBoxSizer8->Add(m_Selunits, 0, wxGROW|wxALL, 5);
m_Selunits = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _(
"Units" ), wxDefaultPosition, wxDefaultSize, 2,
m_SelunitsStrings, 1, wxRA_SPECIFY_COLS );
m_LabelSizeCtrlSizer = new wxBoxSizer(wxVERTICAL);
itemBoxSizer8->Add(m_LabelSizeCtrlSizer, 0, wxGROW|wxALL, 5);
m_Selunits->SetSelection( 0 );
itemBoxSizer8->Add( m_Selunits, 0, wxGROW | wxALL, 5 );
m_LabelSizeCtrlSizer = new wxBoxSizer( wxVERTICAL );
itemBoxSizer8->Add( m_LabelSizeCtrlSizer, 0, wxGROW | wxALL, 5 );
wxString m_SelDirWiresStrings[] = {
_("Horiz/Vertical"),
_("Any")
_( "Horiz/Vertical" ),
_( "Any" )
};
m_SelDirWires = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _("Wires - Bus orient"), wxDefaultPosition, wxDefaultSize, 2, m_SelDirWiresStrings, 1, wxRA_SPECIFY_COLS );
m_SelDirWires->SetSelection(0);
itemBoxSizer8->Add(m_SelDirWires, 0, wxGROW|wxALL, 5);
m_SelDirWires = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _(
"Wires - Bus orient" ), wxDefaultPosition, wxDefaultSize,
2, m_SelDirWiresStrings, 1,
wxRA_SPECIFY_COLS );
m_SelDirWires->SetSelection( 0 );
itemBoxSizer8->Add( m_SelDirWires, 0, wxGROW | wxALL, 5 );
wxString m_Show_Page_LimitsStrings[] = {
_("Yes"),
_("No")
_( "Yes" ),
_( "No" )
};
m_Show_Page_Limits = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 2, m_Show_Page_LimitsStrings, 1, wxRA_SPECIFY_COLS );
m_Show_Page_Limits->SetSelection(0);
itemBoxSizer8->Add(m_Show_Page_Limits, 0, wxGROW|wxALL, 5);
m_Show_Page_Limits = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _(
"Show page limits" ), wxDefaultPosition,
wxDefaultSize, 2, m_Show_Page_LimitsStrings, 1,
wxRA_SPECIFY_COLS );
wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_Show_Page_Limits->SetSelection( 0 );
itemBoxSizer8->Add( m_Show_Page_Limits, 0, wxGROW | wxALL, 5 );
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton15->SetForegroundColour(wxColour(202, 0, 0));
itemBoxSizer14->Add(itemButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer14 = new wxBoxSizer( wxVERTICAL );
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton16->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer14->Add(itemButton16, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add( itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
itemBoxSizer14->Add(5, 5, 0, wxGROW|wxALL, 5);
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_OK, _(
"&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Auto increment params"));
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
itemBoxSizer14->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemButton15->SetForegroundColour( wxColour( 202, 0, 0 ) );
itemBoxSizer14->Add( itemButton15, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
m_DeltaStepXTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step X"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer18->Add(m_DeltaStepXTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_CANCEL, _(
"&Cancel" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_DeltaStepCtrl_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_X, 0, wxGROW|wxALL, 5);
itemButton16->SetForegroundColour( wxColour( 0, 0, 255 ) );
itemBoxSizer14->Add( itemButton16, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
m_DeltaStepYTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step Y"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer18->Add(m_DeltaStepYTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
itemBoxSizer14->Add( 5, 5, 0, wxGROW | wxALL, 5 );
m_DeltaStepCtrl_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_Y, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
"Auto increment params" ) );
m_DeltaIncTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Label:"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer18->Add(m_DeltaIncTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(
itemStaticBoxSizer18Static,
wxVERTICAL );
m_DeltaLabelCtrl = new wxSpinCtrl( itemDialog1, ID_SPINCTRL, _T("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -16, 16, 0 );
itemStaticBoxSizer18->Add(m_DeltaLabelCtrl, 0, wxGROW|wxALL, 5);
itemBoxSizer14->Add( itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
m_DeltaStepXTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Delta Step X" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer18->Add( m_DeltaStepXTitle,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_DeltaStepCtrl_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer18->Add( m_DeltaStepCtrl_X, 0, wxGROW | wxALL, 5 );
m_DeltaStepYTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Delta Step Y" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer18->Add( m_DeltaStepYTitle,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_DeltaStepCtrl_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer18->Add( m_DeltaStepCtrl_Y, 0, wxGROW | wxALL, 5 );
m_DeltaIncTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Delta Label:" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer18->Add( m_DeltaIncTitle,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_DeltaLabelCtrl = new wxSpinCtrl( itemDialog1, ID_SPINCTRL, _T(
"0" ), wxDefaultPosition,
wxDefaultSize, wxSP_ARROW_KEYS,
-16, 16, 0 );
itemStaticBoxSizer18->Add( m_DeltaLabelCtrl, 0, wxGROW | wxALL, 5 );
////@end WinEDA_SetOptionsFrame content construction
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl(this, _("Default Line Width"),g_DrawMinimunLineWidth,
g_UnitMetric, m_DrawOptionsSizer, EESCHEMA_INTERNAL_UNIT);
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl(this, _("Default Label Size"),g_DefaultTextLabelSize,
g_UnitMetric, m_LabelSizeCtrlSizer, EESCHEMA_INTERNAL_UNIT);
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl( this, _(
"Default Line Width" ),
g_DrawMinimunLineWidth,
g_UnitMetric, m_DrawOptionsSizer,
EESCHEMA_INTERNAL_UNIT );
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl( this, _(
"Default Label Size" ),
g_DefaultTextLabelSize,
g_UnitMetric, m_LabelSizeCtrlSizer,
EESCHEMA_INTERNAL_UNIT );
}
/*!
* Should we show tooltips?
*/
@ -322,6 +423,7 @@ bool WinEDA_SetOptionsFrame::ShowToolTips()
return true;
}
/*!
* Get bitmap resources
*/
@ -330,11 +432,13 @@ wxBitmap WinEDA_SetOptionsFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_SetOptionsFrame bitmap retrieval
wxUnusedVar(name);
wxUnusedVar( name );
return wxNullBitmap;
////@end WinEDA_SetOptionsFrame bitmap retrieval
}
/*!
* Get icon resources
*/
@ -343,20 +447,25 @@ wxIcon WinEDA_SetOptionsFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_SetOptionsFrame icon retrieval
wxUnusedVar(name);
wxUnusedVar( name );
return wxNullIcon;
////@end WinEDA_SetOptionsFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void WinEDA_SetOptionsFrame::OnOkClick( wxCommandEvent& event )
{
Accept(event);
Accept( event );
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
}
@ -370,51 +479,65 @@ void WinEDA_SetOptionsFrame::OnCancelClick( wxCommandEvent& event )
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
}
/**************************************************************************/
void WinEDA_SetOptionsFrame::Accept(wxCommandEvent& event)
void WinEDA_SetOptionsFrame::Accept( wxCommandEvent& event )
/**************************************************************************/
{
wxSize grid;
bool setgrid = TRUE;
wxString msg;
wxSize grid;
bool setgrid = TRUE;
wxString msg;
g_DrawMinimunLineWidth = m_DefaultDrawLineWidthCtrl->GetValue();
if ( g_DrawMinimunLineWidth < 0 ) g_DrawMinimunLineWidth = 0;
if ( g_DrawMinimunLineWidth > 100 ) g_DrawMinimunLineWidth = 100;
if( g_DrawMinimunLineWidth < 0 )
g_DrawMinimunLineWidth = 0;
if( g_DrawMinimunLineWidth > 100 )
g_DrawMinimunLineWidth = 100;
g_DefaultTextLabelSize = m_DefaultLabelSizeCtrl->GetValue();
if ( g_DefaultTextLabelSize < 0 ) g_DefaultTextLabelSize = 0;
if ( g_DefaultTextLabelSize > 1000 ) g_DefaultTextLabelSize = 1000;
if( g_DefaultTextLabelSize < 0 )
g_DefaultTextLabelSize = 0;
if( g_DefaultTextLabelSize > 1000 )
g_DefaultTextLabelSize = 1000;
msg = m_DeltaStepCtrl_X->GetValue();
g_RepeatStep.x =
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits);
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
msg = m_DeltaStepCtrl_Y->GetValue();
g_RepeatStep.y =
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits);
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
g_RepeatDeltaLabel = m_DeltaLabelCtrl->GetValue();
if ( m_Show_Page_Limits->GetSelection() == 0 ) g_ShowPageLimits = TRUE;
else g_ShowPageLimits = FALSE;
if( m_Show_Page_Limits->GetSelection() == 0 )
g_ShowPageLimits = TRUE;
else
g_ShowPageLimits = FALSE;
if ( m_SelDirWires->GetSelection() == 0 ) g_HVLines = 1;
else g_HVLines = 0;
if( m_SelDirWires->GetSelection() == 0 )
g_HVLines = 1;
else
g_HVLines = 0;
if ( m_Selunits->GetSelection() == 0 ) g_UnitMetric = 1;
else g_UnitMetric = 0;
if( m_Selunits->GetSelection() == 0 )
g_UnitMetric = 1;
else
g_UnitMetric = 0;
if ( m_SelShowPins->GetSelection() == 0 ) g_ShowAllPins = FALSE;
else g_ShowAllPins = TRUE;
if( m_SelShowPins->GetSelection() == 0 )
g_ShowAllPins = FALSE;
else
g_ShowAllPins = TRUE;
g_ShowGrid = m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
switch( m_SelGridSize->GetSelection() )
{
default:
@ -422,21 +545,22 @@ wxString msg;
break;
case 0:
grid = wxSize(50,50);
grid = wxSize( 50, 50 );
break;
case 1:
grid = wxSize(25,25);
grid = wxSize( 25, 25 );
break;
case 2:
grid = wxSize(10,10);
grid = wxSize( 10, 10 );
break;
}
if ( m_Parent->GetScreen() )
if( m_Parent->GetBaseScreen() )
{
if ( setgrid ) m_Parent->GetScreen()->SetGrid(grid);
m_Parent->GetScreen()->SetRefreshReq();
if( setgrid )
m_Parent->GetBaseScreen()->SetGrid( grid );
m_Parent->GetBaseScreen()->SetRefreshReq();
}
}

View File

@ -694,7 +694,7 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC )
/*********************************************************************/
void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void PartTextStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/*********************************************************************/
{
int FieldNumber;

View File

@ -179,7 +179,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/*************************************************************************/
EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
SCH_TEXT* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
/*************************************************************************/
/* Routine to create new text struct (GraphicText, label or Glabel).
@ -278,7 +278,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
/* Abort function for the command move text */
{
SCH_SCREEN* screen = (SCH_SCREEN*) Panel->m_Parent->GetScreen();
BASE_SCREEN* screen = Panel->GetScreen();
SCH_ITEM* Struct = (SCH_ITEM*) screen->GetCurItem();
g_ItemToRepeat = NULL;

View File

@ -142,7 +142,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask
wxBeginBusyCursor();
ActiveScreen = screen = m_Parent->GetScreen();
ActiveScreen = screen = m_Parent->GetBaseScreen();
RedrawStructList( this, DC, screen->EEDrawList, GR_COPY );
if( Print_Sheet_Ref )

View File

@ -255,8 +255,9 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
panel->m_Parent->GetScreen()->GetCurItem();
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
/* Effacement du composant */
if( erase )
@ -264,8 +265,8 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
}
move_vector.x = panel->m_Parent->GetScreen()->m_Curseur.x - DrawLibItem->m_Pos.x;
move_vector.y = panel->m_Parent->GetScreen()->m_Curseur.y - DrawLibItem->m_Pos.y;
move_vector.x = screen->m_Curseur.x - DrawLibItem->m_Pos.x;
move_vector.y = screen->m_Curseur.y - DrawLibItem->m_Pos.y;
MoveOneStruct( DrawLibItem, move_vector );
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
@ -320,8 +321,9 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant
*/
{
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
Panel->m_Parent->GetScreen()->GetCurItem();
SCH_SCREEN* screen = (SCH_SCREEN*) Panel->GetScreen();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
{
@ -342,12 +344,11 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
DrawLibItem->m_Flags = 0;
}
D(printf("refresh\n");)
Panel->Refresh( TRUE );
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
Panel->m_Parent->GetScreen()->SetCurItem( NULL );
screen->SetCurItem( NULL );
}

View File

@ -280,7 +280,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct == NULL )
break;
}
@ -332,7 +332,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_MIRROR_X_COMPONENT: // Mirror X (Component)
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct )
{
if( DrawStruct->m_Flags == 0 )
@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_ORIENT_NORMAL_COMPONENT: // Orient 0, no mirror (Component)
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct )
{
if( DrawStruct->m_Flags == 0 )
@ -365,10 +365,10 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct && (DrawStruct->m_Flags ==0) )
{
((SCH_SCREEN*)GetScreen())->SetCurItem( DrawStruct );
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
@ -378,7 +378,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct)
{
EditComponentValue(
@ -390,7 +390,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct)
{
EditComponentFootprint(

View File

@ -35,10 +35,10 @@ static void ExitMoveField(WinEDA_DrawPanel * Panel, wxDC * DC)
if(CurrentDrawItem == NULL) return;
wxPoint curpos;
curpos = Panel->m_Parent->GetScreen()->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = StartCursor;
curpos = Panel->GetScreen()->m_Curseur;
Panel->GetScreen()->m_Curseur = StartCursor;
ShowMoveField(Panel, DC, TRUE);
Panel->m_Parent->GetScreen()->m_Curseur = curpos;
Panel->GetScreen()->m_Curseur = curpos;
CurrentDrawItem->m_Flags = 0;
CurrentDrawItem = NULL;

View File

@ -73,7 +73,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon
SetIcon( wxIcon( libedit_xpm ) );
m_CurrentScreen = ScreenLib;
SetBaseScreen( ScreenLib );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel )
@ -90,7 +90,6 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
/**********************************************/
{
m_Parent->m_LibeditFrame = NULL;
//m_CurrentScreen = ScreenSch; humm, is this needed?
}
@ -118,7 +117,8 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
msg.Printf( _( "Library \"%s\" was modified!\nDiscard changes?" ), Lib->m_Name.GetData() );
if( !IsOK( this, msg ) )
{
Event.Veto(); return;
Event.Veto();
return;
}
}
}

View File

@ -157,7 +157,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_NOCONNECT_STRUCT_TYPE:
// if( !flags ) PopMenu->Append(ID_POPUP_SCH_MOVE_ITEM_REQUEST, "Move noconnect");
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete noconn" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Noconn" ), delete_xpm );
break;
case DRAW_JUNCTION_STRUCT_TYPE:
@ -167,17 +167,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_BUSENTRY_STRUCT_TYPE:
if( !flags )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move bus entry" ), move_xpm );
_( "Move Bus Entry" ), move_xpm );
if( GetBusEntryShape( (DrawBusEntryStruct*) DrawStruct ) == '\\' )
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "set bus entry /" ) );
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "Set Bus Entry /" ) );
else
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "set bus entry \\" ) );
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "Set Bus Entry \\" ) );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "delete bus entry" ), delete_bus_xpm );
_( "Delete Bus Entry" ), delete_bus_xpm );
break;
case DRAW_MARKER_STRUCT_TYPE:
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
break;
case TYPE_SCH_TEXT:
@ -230,9 +230,9 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
default:
if( is_new )
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "Delete drawing" ), delete_xpm );
_( "Delete Drawing" ), delete_xpm );
break;
}
@ -417,7 +417,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global label" ), label2glabel_xpm );
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
@ -444,7 +444,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global label" ), label2glabel_xpm );
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
@ -494,14 +494,14 @@ void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
}
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete junction" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Junction" ), delete_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM ) )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _(
"Delete connection" ), delete_connection_xpm );
"Delete Connection" ), delete_connection_xpm );
}
}
@ -525,9 +525,9 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
if( is_new )
return;
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _(
"Delete connection" ), delete_connection_xpm );
"Delete Connection" ), delete_connection_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) )
@ -535,13 +535,13 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add label" ), add_line_label_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm );
// Place Global label command only if the cursor is over one end of the Wire:
if( ( pos.x == Wire->m_Start.x && pos.y == Wire->m_Start.y)
|| ( pos.x == Wire->m_End.x && pos.y == Wire->m_End.y ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add global label" ), add_glabel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
@ -567,13 +567,13 @@ void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
_( "Break Bus" ), break_bus_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add label" ), add_line_label_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm );
// Place Global label command only if the cursor is over one end of the Bus:
if( ( pos.x == Bus->m_Start.x && pos.y == Bus->m_Start.y)
|| ( pos.x == Bus->m_End.x && pos.y == Bus->m_End.y ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add global label" ), add_glabel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
@ -645,14 +645,14 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
{
wxMenu* menu_other_block_commands = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_other_block_commands,
-1, _( "Other block commands" ), right_xpm );
-1, _( "Other Block Commands" ), right_xpm );
ADD_MENUITEM( menu_other_block_commands, wxID_COPY, _( "Save Block" ), copy_button );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ), copyblock_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DRAG_BLOCK,
_( "Drag Block (ctrl + drag mouse)" ), move_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DELETE_BLOCK,
_( "Del. Block (shift+ctrl + drag mouse)" ), delete_xpm );
_( "Delelet Block (shift+ctrl + drag mouse)" ), delete_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_MIRROR_Y_BLOCK, _(
"Mirror Block ||" ), mirror_H_xpm );
#if 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
int id = event.GetId();
wxPoint pos;
wxClientDC dc( DrawPanel );
SCH_SCREEN* screen = GetScreen();
DrawPanel->PrepareGraphicContext( &dc );
@ -119,7 +120,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
if( screen->BlockLocate.m_Command != BLOCK_IDLE )
DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
DrawPanel->
m_PanelDefaultCursor ) );
@ -129,11 +130,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
/* ne devrait pas etre execute, sauf bug: */
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
if( screen->BlockLocate.m_Command != BLOCK_IDLE )
{
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
screen->BlockLocate.m_Command = BLOCK_IDLE;
screen->BlockLocate.m_State = STATE_NO_BLOCK;
screen->BlockLocate.m_BlockDrawStruct = NULL;
}
break;
@ -166,14 +167,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case wxID_CUT:
if( GetScreen()->BlockLocate.m_Command != BLOCK_MOVE )
if( screen->BlockLocate.m_Command != BLOCK_MOVE )
break;
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
g_ItemToRepeat = NULL;
break;
case wxID_PASTE:
HandleBlockBegin( &dc, BLOCK_PASTE, GetScreen()->m_Curseur );
HandleBlockBegin( &dc, BLOCK_PASTE, screen->m_Curseur );
break;
case ID_HIERARCHY_PUSH_POP_BUTT:
@ -247,13 +248,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
DrawPanel->MouseToCursorSchema();
SetBusEntryShape( &dc,
(DrawBusEntryStruct*) GetScreen()->GetCurItem(), '/' );
(DrawBusEntryStruct*) screen->GetCurItem(), '/' );
break;
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
DrawPanel->MouseToCursorSchema();
SetBusEntryShape( &dc,
(DrawBusEntryStruct*) GetScreen()->GetCurItem(), '\\' );
(DrawBusEntryStruct*) screen->GetCurItem(), '\\' );
break;
case ID_NO_SELECT_BUTT:
@ -271,35 +272,35 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_SCH_EDIT_TEXT:
EditSchematicText( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
EditSchematicText( (SCH_TEXT*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_ROTATE_TEXT:
DrawPanel->MouseToCursorSchema();
ChangeTextOrient( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
ChangeTextOrient( (SCH_TEXT*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
&dc, TYPE_SCH_LABEL );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
&dc, TYPE_SCH_GLOBALLABEL );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
&dc, TYPE_SCH_HIERLABEL );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
&dc, TYPE_SCH_TEXT );
break;
@ -310,11 +311,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_ROTATE_FIELD:
DrawPanel->MouseToCursorSchema();
RotateCmpField( (PartTextStruct*) GetScreen()->GetCurItem(), &dc );
RotateCmpField( (PartTextStruct*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_EDIT_FIELD:
EditCmpFieldText( (PartTextStruct*) GetScreen()->GetCurItem(), &dc );
EditCmpFieldText( (PartTextStruct*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_DELETE_NODE:
@ -322,41 +323,43 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
DeleteConnection( &dc,
id == ID_POPUP_SCH_DELETE_CONNECTION ? TRUE : FALSE );
GetScreen()->SetCurItem( NULL );
screen->SetCurItem( NULL );
g_ItemToRepeat = NULL;
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
TestDanglingEnds( screen->EEDrawList, &dc );
break;
case ID_POPUP_SCH_BREAK_WIRE:
{
DrawPickedStruct* ListForUndo;
DrawPanel->MouseToCursorSchema();
ListForUndo = BreakSegment( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_Curseur, TRUE );
ListForUndo = BreakSegment( screen, screen->m_Curseur, TRUE );
if( ListForUndo )
SaveCopyInUndoList( ListForUndo, IS_NEW | IS_CHANGED );
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
TestDanglingEnds( screen->EEDrawList, &dc );
}
break;
case ID_POPUP_SCH_DELETE_CMP:
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem() == NULL )
break;
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
case ID_POPUP_SCH_DELETE:
if( GetScreen()->GetCurItem() == NULL )
{
SCH_ITEM* item = screen->GetCurItem();
if( item == NULL )
break;
DeleteStruct( DrawPanel, &dc, (SCH_ITEM*)GetScreen()->GetCurItem() );
GetScreen()->SetCurItem( NULL );
DeleteStruct( DrawPanel, &dc, item );
screen->SetCurItem( NULL );
g_ItemToRepeat = NULL;
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
GetScreen()->SetModify();
TestDanglingEnds( screen->EEDrawList, &dc );
screen->SetModify();
}
break;
case ID_SCHEMATIC_DELETE_ITEM_BUTT:
@ -365,33 +368,33 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_END_SHEET:
DrawPanel->MouseToCursorSchema();
((SCH_ITEM*)GetScreen()->GetCurItem())->Place( this, &dc );
screen->GetCurItem()->Place( this, &dc );
break;
case ID_POPUP_SCH_RESIZE_SHEET:
DrawPanel->MouseToCursorSchema();
ReSizeSheet( (DrawSheetStruct*) GetScreen()->GetCurItem(), &dc );
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
ReSizeSheet( (DrawSheetStruct*) screen->GetCurItem(), &dc );
TestDanglingEnds( screen->EEDrawList, &dc );
break;
case ID_POPUP_SCH_EDIT_SHEET:
EditSheet( (DrawSheetStruct*) GetScreen()->GetCurItem(), &dc );
EditSheet( (DrawSheetStruct*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_CLEANUP_SHEET:
( (DrawSheetStruct*)
GetScreen()->GetCurItem() )->CleanupSheet( this, &dc );
screen->GetCurItem() )->CleanupSheet( this, &dc );
break;
case ID_POPUP_SCH_EDIT_PINSHEET:
Edit_PinSheet( (Hierarchical_PIN_Sheet_Struct*)
GetScreen()->GetCurItem(), &dc );
screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_MOVE_PINSHEET:
DrawPanel->MouseToCursorSchema();
StartMove_PinSheet( (Hierarchical_PIN_Sheet_Struct*)
GetScreen()->GetCurItem(), &dc );
screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_DRAG_CMP_REQUEST:
@ -399,10 +402,9 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
@ -411,29 +413,28 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
{
// The easiest way to handle a drag component is simulate a
// block drag command
if( GetScreen()->BlockLocate.m_State == STATE_NO_BLOCK )
if( screen->BlockLocate.m_State == STATE_NO_BLOCK )
{
if( !HandleBlockBegin( &dc, BLOCK_DRAG,
GetScreen()->m_Curseur ) )
screen->m_Curseur ) )
break;
HandleBlockEnd( &dc );
}
}
else
Process_Move_Item( (SCH_ITEM*) GetScreen()->GetCurItem(), &dc );
Process_Move_Item( (SCH_ITEM*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_EDIT_CMP:
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
InstallCmpeditFrame( this, pos,
(SCH_COMPONENT*) GetScreen()->GetCurItem() );
(SCH_COMPONENT*) screen->GetCurItem() );
break;
case ID_POPUP_SCH_MIROR_X_CMP:
@ -444,10 +445,9 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
{
int option;
@ -472,11 +472,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
}
DrawPanel->MouseToCursorSchema();
if( GetScreen()->GetCurItem()->m_Flags == 0 )
SaveCopyInUndoList( (SCH_ITEM*) GetScreen()->GetCurItem(), IS_CHANGED );
if( screen->GetCurItem()->m_Flags == 0 )
SaveCopyInUndoList( (SCH_ITEM*) screen->GetCurItem(), IS_CHANGED );
CmpRotationMiroir(
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
(SCH_COMPONENT*) screen->GetCurItem(),
&dc, option );
break;
}
@ -489,41 +489,38 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
EditComponentValue(
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_EDIT_REF_CMP:
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
EditComponentReference(
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
break;
case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP:
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
EditComponentFootprint(
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
break;
@ -531,14 +528,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
DrawPanel->MouseToCursorSchema();
ConvertPart(
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
(SCH_COMPONENT*) screen->GetCurItem(),
&dc );
break;
@ -546,10 +542,9 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
{
SCH_COMPONENT* olditem, * newitem;
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
olditem = (SCH_COMPONENT*) GetScreen()->GetCurItem();
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
olditem = (SCH_COMPONENT*) screen->GetCurItem();
if( olditem == NULL )
break;
newitem = olditem->GenCopy();
@ -593,14 +588,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
DrawPanel->MouseToCursorSchema();
SelPartUnit(
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
(SCH_COMPONENT*) screen->GetCurItem(),
id + 1 - ID_POPUP_SCH_SELECT_UNIT1,
&dc );
break;
@ -609,15 +603,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a piece of a
// component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
screen->SetCurItem( LocateSmallestComponent( screen ) );
if( screen->GetCurItem() == NULL )
break;
{
EDA_LibComponentStruct* LibEntry;
LibEntry = FindLibPart(
( (SCH_COMPONENT*) GetScreen()->GetCurItem() )->m_ChipName,
( (SCH_COMPONENT*) screen->GetCurItem() )->m_ChipName,
wxEmptyString,
FIND_ALIAS );
if( LibEntry && LibEntry->m_DocFile != wxEmptyString )
@ -629,7 +622,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_ENTER_SHEET:
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
EDA_BaseStruct* DrawStruct = screen->GetCurItem();
if( DrawStruct && (DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE) )
{
InstallNextScreen( (DrawSheetStruct*) DrawStruct );
@ -687,30 +680,30 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_ADD_JUNCTION:
DrawPanel->MouseToCursorSchema();
GetScreen()->SetCurItem(
CreateNewJunctionStruct( &dc, GetScreen()->m_Curseur, TRUE ) );
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
GetScreen()->SetCurItem( NULL );
screen->SetCurItem(
CreateNewJunctionStruct( &dc, screen->m_Curseur, TRUE ) );
TestDanglingEnds( screen->EEDrawList, &dc );
screen->SetCurItem( NULL );
break;
case ID_POPUP_SCH_ADD_LABEL:
case ID_POPUP_SCH_ADD_GLABEL:
GetScreen()->SetCurItem(
screen->SetCurItem(
CreateNewText( &dc,
id == ID_POPUP_SCH_ADD_LABEL ?
LAYER_LOCLABEL : LAYER_GLOBLABEL ) );
if( GetScreen()->GetCurItem() )
if( screen->GetCurItem() )
{
((SCH_ITEM*)GetScreen()->GetCurItem())->Place( this, &dc );
TestDanglingEnds( GetScreen()->EEDrawList, &dc );
GetScreen()->SetCurItem( NULL );
((SCH_ITEM*)screen->GetCurItem())->Place( this, &dc );
TestDanglingEnds( screen->EEDrawList, &dc );
screen->SetCurItem( NULL );
}
break;
case ID_SCHEMATIC_UNDO:
if( GetSchematicFromUndoList() )
{
TestDanglingEnds( GetScreen()->EEDrawList, NULL );
TestDanglingEnds( screen->EEDrawList, NULL );
DrawPanel->Refresh( TRUE );
}
break;
@ -718,7 +711,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_SCHEMATIC_REDO:
if( GetSchematicFromRedoList() )
{
TestDanglingEnds( GetScreen()->EEDrawList, NULL );
TestDanglingEnds( screen->EEDrawList, NULL );
DrawPanel->Refresh( TRUE );
}
break;

View File

@ -151,10 +151,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
#endif
g_ItemToRepeat = NULL;
/* Get config */
GetSettings();
g_DrawMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 );
g_PlotPSMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 );
@ -183,6 +186,12 @@ WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
}
BASE_SCREEN* WinEDA_SchematicFrame::GetBaseScreen() const
{
return GetScreen();
}
/***************/
/* utility functions */
/***************/
@ -192,7 +201,7 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet()
}
BASE_SCREEN* WinEDA_SchematicFrame::GetScreen()
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
{
return m_CurrentSheet->LastScreen();
}

View File

@ -468,7 +468,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
Hierarchical_PIN_Sheet_Struct* SheetLabel;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*)
screen->GetCurItem();
@ -479,10 +479,8 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( Sheet->m_Flags & IS_RESIZED )
{
Sheet->m_Size.x = MAX( s_SheetMindx,
screen->m_Curseur.x - Sheet->m_Pos.x );
Sheet->m_Size.y = MAX( s_SheetMindy,
screen->m_Curseur.y - Sheet->m_Pos.y );
Sheet->m_Size.x = MAX( s_SheetMindx, screen->m_Curseur.x - Sheet->m_Pos.x );
Sheet->m_Size.y = MAX( s_SheetMindy, screen->m_Curseur.y - Sheet->m_Pos.y );
SheetLabel = Sheet->m_Label;
while( SheetLabel )
{
@ -507,7 +505,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/****************************************/
static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
{
SCH_SCREEN* Screen = (SCH_SCREEN*) Panel->m_Parent->GetScreen();
SCH_SCREEN* Screen = (SCH_SCREEN*) Panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*) Screen->GetCurItem();
if( Sheet == NULL )
@ -530,7 +528,7 @@ static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
else if( Sheet->m_Flags & IS_MOVED ) /* move en cours: on l'annule */
{
wxPoint curspos = Screen->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = s_OldPos;
Panel->GetScreen()->m_Curseur = s_OldPos;
DeplaceSheet( Panel, DC, TRUE );
RedrawOneStruct( Panel, DC, Sheet, GR_DEFAULT_DRAWMODE );
Sheet->m_Flags = 0;

View File

@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
* de deplacement
* Si le NetSheet est nouveau, il est pointe par NewSheetLabel
*/
void Hierarchical_PIN_Sheet_Struct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void Hierarchical_PIN_Sheet_Struct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
{
DrawSheetStruct* Sheet = (DrawSheetStruct*) m_Parent;
@ -237,7 +237,7 @@ void WinEDA_SchematicFrame::StartMove_PinSheet( Hierarchical_PIN_Sheet_Struct* S
static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
Hierarchical_PIN_Sheet_Struct* SheetLabel = (Hierarchical_PIN_Sheet_Struct*)
panel->m_Parent->GetScreen()->GetCurItem();
panel->GetScreen()->GetCurItem();
if( SheetLabel == NULL )
return;
@ -251,13 +251,13 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
SheetLabel->m_Edge = 0;
SheetLabel->m_Pos.x = Sheet->m_Pos.x;
if( panel->m_Parent->GetScreen()->m_Curseur.x > ( Sheet->m_Pos.x + (Sheet->m_Size.x / 2) ) )
if( panel->GetScreen()->m_Curseur.x > ( Sheet->m_Pos.x + (Sheet->m_Size.x / 2) ) )
{
SheetLabel->m_Edge = 1;
SheetLabel->m_Pos.x = Sheet->m_Pos.x + Sheet->m_Size.x;
}
SheetLabel->m_Pos.y = panel->m_Parent->GetScreen()->m_Curseur.y;
SheetLabel->m_Pos.y = panel->GetScreen()->m_Curseur.y;
if( SheetLabel->m_Pos.y < Sheet->m_Pos.y )
SheetLabel->m_Pos.y = Sheet->m_Pos.y;
if( SheetLabel->m_Pos.y > (Sheet->m_Pos.y + Sheet->m_Size.y) )

View File

@ -383,7 +383,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
/* Redraw the graphoc shape while moving
*/
{
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx, my;
/* Erase shape in the old positon*/
@ -529,7 +529,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
int DrawMode = g_XorMode;
int* ptpoly;
int dx, dy;
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx = Screen->m_Curseur.x,
my = Screen->m_Curseur.y;

View File

@ -69,7 +69,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
if( m_Semaphore )
SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
m_CurrentScreen = new SCH_SCREEN( VIEWER_FRAME );
SetBaseScreen( new SCH_SCREEN( VIEWER_FRAME ) );
GetScreen()->SetZoom( 16 );
if( Library == NULL )
@ -110,7 +110,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
{
SAFE_DELETE( m_CurrentScreen );
delete GetScreen();
SetBaseScreen( 0 );
m_Parent->m_ViewlibFrame = NULL;
}

View File

@ -239,7 +239,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
}
}
if( panel->m_Parent->GetScreen()->BlockLocate.m_State != STATE_BLOCK_STOP )
if( panel->GetScreen()->BlockLocate.m_State != STATE_BLOCK_STOP )
{
screen->BlockLocate.m_MoveVector.x = screen->m_Curseur.x - screen->BlockLocate.GetRight();
screen->BlockLocate.m_MoveVector.y = screen->m_Curseur.y - screen->BlockLocate.GetBottom();

View File

@ -22,8 +22,9 @@
/**********************************************************************/
EDA_BaseStruct* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() {
BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay()
/**********************************************************************/
{
return Locate( CURSEUR_OFF_GRILLE );
}
@ -72,22 +73,22 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_ZOOM_IN_FROM_MOUSE:

View File

@ -1,6 +1,6 @@
/********************************************************/
/**** Routine de lecture et visu d'un fichier GERBER ****/
/********************************************************/
/********************************************************/
/**** Routine de lecture et visu d'un fichier GERBER ****/
/********************************************************/
#include "fctsys.h"
@ -13,7 +13,7 @@
#define DEFAULT_SIZE 100
/* Format Gerber : NOTES :
Fonctions preparatoires:
Fonctions preparatoires:
Gn =
G01 interpolation lineaire ( trace de droites )
G02,G20,G21 Interpolation circulaire , sens trigo < 0
@ -39,7 +39,7 @@ Fonctions preparatoires:
G90 Mode Coordonnees absolues
G91 Mode Coordonnees Relatives
Coordonnees X,Y
Coordonnees X,Y
X,Y sont suivies de + ou - et de m+n chiffres (non separes)
m = partie entiere
n = partie apres la virgule
@ -48,7 +48,7 @@ Coordonnees X,Y
ex:
G__ X00345Y-06123 D__*
Outils et D_CODES
Outils et D_CODES
numero d'outil ( identification des formes )
1 a 99 (classique)
1 a 999
@ -63,30 +63,29 @@ Outils et D_CODES
D10 ... = Indentification d'outils ( d'ouvertures )
*/
/*********************************/
/* class GERBER_Descr : Methodes */
/*********************************/
/*********************************/
/* class GERBER_Descr : Methodes */
/*********************************/
GERBER_Descr::GERBER_Descr(int layer)
GERBER_Descr::GERBER_Descr( int layer )
{
int ii;
int ii;
m_Layer = layer; // Layer Number
m_Selected_Tool = FIRST_DCODE;
ResetDefaultValues();
for ( ii = 0; ii <= MAX_TOOLS; ii++ )
m_Aperture_List[ii] = new D_CODE(ii + FIRST_DCODE);
for( ii = 0; ii <= MAX_TOOLS; ii++ )
m_Aperture_List[ii] = new D_CODE( ii + FIRST_DCODE );
}
GERBER_Descr::~GERBER_Descr()
{
int ii;
int ii;
if (m_Aperture_List )
if( m_Aperture_List )
{
for ( ii = 0; ii < MAX_TOOLS; ii++)
for( ii = 0; ii < MAX_TOOLS; ii++ )
{
delete m_Aperture_List[ii];
m_Aperture_List[ii] = NULL;
@ -94,6 +93,7 @@ int ii;
}
}
/******************************************/
void GERBER_Descr::ResetDefaultValues()
/******************************************/
@ -102,7 +102,7 @@ void GERBER_Descr::ResetDefaultValues()
m_Pback = NULL;
m_Pnext = NULL;
m_FileName.Empty();
m_Name = wxT("no name"); // Layer name
m_Name = wxT( "no name" ); // Layer name
m_LayerNegative = FALSE; // TRUE = Negative Layer
m_ImageNegative = FALSE; // TRUE = Negative image
m_GerbMetric = FALSE; // FALSE = Inches, TRUE = metric
@ -134,16 +134,17 @@ void GERBER_Descr::ResetDefaultValues()
m_PolygonFillModeState = 0;
}
/********************************************/
int GERBER_Descr::ReturnUsedDcodeNumber()
/********************************************/
{
int ii, jj;
int ii, jj;
jj = 0;
if (m_Aperture_List )
if( m_Aperture_List )
{
for ( ii = 0; ii < MAX_TOOLS; ii++)
for( ii = 0; ii < MAX_TOOLS; ii++ )
{
if( m_Aperture_List[ii]->m_InUse || m_Aperture_List[ii]->m_Defined )
jj++;
@ -153,50 +154,53 @@ int ii, jj;
}
/******************************/
void GERBER_Descr::InitToolTable()
/******************************/
/* Creation du tableau des MAX_TOOLS DCodes utilisables, si il n'existe pas,
et Init des DCodes <EFBFBD> une valeur raisonnable
*/
* et Init des DCodes <EFBFBD> une valeur raisonnable
*/
{
int count;
int count;
/* Init du buffer des D_CODES a des valeurs raisonnables */
for (count = 0 ; count < MAX_TOOLS ; count++)
for( count = 0; count < MAX_TOOLS; count++ )
{
if (m_Aperture_List[count] == NULL ) continue;
if( m_Aperture_List[count] == NULL )
continue;
m_Aperture_List[count]->m_Num_Dcode = count + FIRST_DCODE;
m_Aperture_List[count]->Clear_D_CODE_Data();
}
}
/*************************/
/* Class DCODE: methodes */
/*************************/
/*************************/
/* Class DCODE: methodes */
/*************************/
/* Variables locales : */
/* Routines Locales */
D_CODE::D_CODE(int num_dcode)
D_CODE::D_CODE( int num_dcode )
{
m_Num_Dcode = num_dcode;
Clear_D_CODE_Data();
}
D_CODE::~D_CODE()
{
}
void D_CODE::Clear_D_CODE_Data()
{
m_Size.x = DEFAULT_SIZE;
m_Size.y = DEFAULT_SIZE;
m_Shape= GERB_CIRCLE;
m_Shape = GERB_CIRCLE;
m_Drill.x = m_Drill.y = 0;
m_DrillShape = 0;
m_InUse = FALSE;
@ -205,60 +209,62 @@ void D_CODE::Clear_D_CODE_Data()
/******************************************************************************/
int WinEDA_GerberFrame::Read_D_Code_File( const wxString & D_Code_FullFileName)
int WinEDA_GerberFrame::Read_D_Code_File( const wxString& D_Code_FullFileName )
/******************************************************************************/
/* Routine de Lecture d'un fichier de D Codes.
Accepte format standard ou ALSPCB
un ';' demarre un commentaire.
Format Standard:
tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]
ex: 1, 12, 12, 0, 0, 0, 3 ; D10
Format:
Ver , Hor , Type , Tool [,Drill]
ex: 0.012, 0.012, L , D10
Classe les caract en buf_tmp sous forme de tableau de structures D_CODE.
Retourne:
< 0 si erreur:
-1 = Fichier non trouve
-2 = Erreur lecture fichier
0 si pas de nom de fichier (inits seules)
1 si OK
*/
* Accepte format standard ou ALSPCB
* un ';' demarre un commentaire.
*
* Format Standard:
* tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
*
* Format:
* Ver , Hor , Type , Tool [,Drill]
* ex: 0.012, 0.012, L , D10
*
* Classe les caract en buf_tmp sous forme de tableau de structures D_CODE.
* Retourne:
* < 0 si erreur:
* -1 = Fichier non trouve
* -2 = Erreur lecture fichier
* 0 si pas de nom de fichier (inits seules)
* 1 si OK
*/
{
int current_Dcode, ii, dcode_scale;
char* ptcar;
int dimH, dimV, drill, type_outil, dummy;
float fdimH, fdimV, fdrill;
char c_type_outil[256];
char Line[2000];
wxString msg;
D_CODE * pt_Dcode;
FILE * dest;
int layer = GetPCBScreen()->m_Active_Layer;
D_CODE ** ListeDCode;
int current_Dcode, ii, dcode_scale;
char* ptcar;
int dimH, dimV, drill, type_outil, dummy;
float fdimH, fdimV, fdrill;
char c_type_outil[256];
char Line[2000];
wxString msg;
D_CODE* pt_Dcode;
FILE* dest;
int layer = GetScreen()->m_Active_Layer;
D_CODE** ListeDCode;
if ( g_GERBER_Descr_List[layer] == NULL )
if( g_GERBER_Descr_List[layer] == NULL )
{
g_GERBER_Descr_List[layer] = new GERBER_Descr(layer);
g_GERBER_Descr_List[layer] = new GERBER_Descr( layer );
}
/* Mise a jour de l'echelle gerber : */
dcode_scale = 10; /* ici unit dcode = mil, unit interne = 0.1 mil
-> 1 unite dcode = 10 unit PCB */
* -> 1 unite dcode = 10 unit PCB */
current_Dcode = 0;
if ( D_Code_FullFileName.IsEmpty() ) return 0;
if( D_Code_FullFileName.IsEmpty() )
return 0;
dest = wxFopen(D_Code_FullFileName, wxT("rt") );
dest = wxFopen( D_Code_FullFileName, wxT( "rt" ) );
if (dest == 0)
if( dest == 0 )
{
msg = _("File ") + D_Code_FullFileName + _(" not found");
DisplayError(this, msg, 10);
msg = _( "File " ) + D_Code_FullFileName + _( " not found" );
DisplayError( this, msg, 10 );
return -1;
}
@ -266,94 +272,110 @@ D_CODE ** ListeDCode;
ListeDCode = g_GERBER_Descr_List[layer]->m_Aperture_List;
while( fgets(Line, sizeof(Line)-1,dest) != NULL)
while( fgets( Line, sizeof(Line) - 1, dest ) != NULL )
{
if (*Line == ';') continue; /* Commentaire */
if (strlen(Line) < 10 ) continue ; /* Probablemant ligne vide */
if( *Line == ';' )
continue; /* Commentaire */
if( strlen( Line ) < 10 )
continue; /* Probablemant ligne vide */
pt_Dcode = NULL; current_Dcode = 0;
/* Determination du type de fichier D_Code */
ptcar = Line ; ii = 0 ;
while( *ptcar ) if (*(ptcar++) == ',') ii++ ;
ptcar = Line; ii = 0;
while( *ptcar )
if( *(ptcar++) == ',' )
ii++;
if (ii >= 6 ) /* valeurs en mils */
if( ii >= 6 ) /* valeurs en mils */
{
sscanf(Line,"%d,%d,%d,%d,%d,%d,%d",&ii,
sscanf( Line, "%d,%d,%d,%d,%d,%d,%d", &ii,
&dimH, &dimV, &drill,
&dummy,&dummy,
&type_outil);
dimH = (int)( (dimH * dcode_scale) + 0.5) ;
dimV = (int)( (dimV * dcode_scale) + 0.5) ;
drill = (int)( (drill * dcode_scale) + 0.5);
if ( ii < 1 ) ii = 1;
current_Dcode = ii-1 + FIRST_DCODE;
&dummy, &dummy,
&type_outil );
dimH = (int) ( (dimH * dcode_scale) + 0.5 );
dimV = (int) ( (dimV * dcode_scale) + 0.5 );
drill = (int) ( (drill * dcode_scale) + 0.5 );
if( ii < 1 )
ii = 1;
current_Dcode = ii - 1 + FIRST_DCODE;
}
else /* valeurs en inches a convertir en mils */
{
fdrill = 0 ; current_Dcode = 0 ; fdrill = 0 ;
sscanf(Line,"%f,%f,%1s",&fdimV, &fdimH, c_type_outil);
ptcar = Line ;
fdrill = 0; current_Dcode = 0; fdrill = 0;
sscanf( Line, "%f,%f,%1s", &fdimV, &fdimH, c_type_outil );
ptcar = Line;
while( *ptcar )
{
if (*ptcar == 'D')
if( *ptcar == 'D' )
{
sscanf(ptcar+1,"%d,%f", &current_Dcode,&fdrill); break ;
sscanf( ptcar + 1, "%d,%f", &current_Dcode, &fdrill ); break;
}
else ptcar++ ;
else
ptcar++;
}
dimH = (int)( (fdimH * dcode_scale * 1000) + 0.5);
dimV = (int)( (fdimV * dcode_scale * 1000) + 0.5);
drill = (int)( (fdrill * dcode_scale * 1000) + 0.5);
type_outil = -1 ;
if(c_type_outil[0] == 'L') type_outil = GERB_LINE;
if(c_type_outil[0] == 'R') type_outil = GERB_RECT;
if(c_type_outil[0] == 'C') type_outil = GERB_CIRCLE;
if(c_type_outil[0] == 'O') type_outil = GERB_OVALE;
if(type_outil == -1) {fclose(dest); return(-2);}
dimH = (int) ( (fdimH * dcode_scale * 1000) + 0.5 );
dimV = (int) ( (fdimV * dcode_scale * 1000) + 0.5 );
drill = (int) ( (fdrill * dcode_scale * 1000) + 0.5 );
type_outil = -1;
if( c_type_outil[0] == 'L' )
type_outil = GERB_LINE;
if( c_type_outil[0] == 'R' )
type_outil = GERB_RECT;
if( c_type_outil[0] == 'C' )
type_outil = GERB_CIRCLE;
if( c_type_outil[0] == 'O' )
type_outil = GERB_OVALE;
if( type_outil == -1 )
{
fclose( dest ); return -2;
}
}
/* Mise a jour de la liste des d_codes si valeurs lues coherentes*/
if (current_Dcode < FIRST_DCODE ) continue;
if (current_Dcode >= MAX_TOOLS ) continue;
pt_Dcode = ReturnToolDescr(layer, current_Dcode);
if( current_Dcode < FIRST_DCODE )
continue;
if( current_Dcode >= MAX_TOOLS )
continue;
pt_Dcode = ReturnToolDescr( layer, current_Dcode );
pt_Dcode->m_Size.x = dimH;
pt_Dcode->m_Size.y = dimV;
pt_Dcode->m_Shape = type_outil;
pt_Dcode->m_Drill.x = pt_Dcode->m_Drill.y = drill;
pt_Dcode->m_Defined = TRUE;
}
fclose(dest) ;
return(1);
fclose( dest );
return 1;
}
/***************************************************/
void WinEDA_GerberFrame::CopyDCodesSizeToItems()
/***************************************************/
/* Set Size Items (Lines, Flashes) from DCodes List
*/
*/
{
TRACK * track;
D_CODE * pt_Dcode; /* Pointeur sur le D code*/
TRACK* track;
D_CODE* pt_Dcode; /* Pointeur sur le D code*/
track = m_Pcb->m_Track;
for ( ; track != NULL ; track = (TRACK*) track->Pnext )
for( ; track != NULL; track = (TRACK*) track->Pnext )
{
pt_Dcode = ReturnToolDescr(track->GetLayer(), track->GetNet());
pt_Dcode = ReturnToolDescr( track->GetLayer(), track->GetNet() );
pt_Dcode->m_InUse = TRUE;
if ( // Line Item
(track->m_Shape == S_SEGMENT ) || /* segment rectiligne */
(track->m_Shape == S_RECT ) || /* segment forme rect (i.e. bouts non arrondis) */
(track->m_Shape == S_ARC ) || /* segment en arc de cercle (bouts arrondis)*/
(track->m_Shape == S_CIRCLE ) || /* segment en cercle (anneau)*/
(track->m_Shape == S_ARC_RECT ) /* segment en arc de cercle (bouts droits) (GERBER)*/
if( // Line Item
(track->m_Shape == S_SEGMENT ) /* segment rectiligne */
|| (track->m_Shape == S_RECT ) /* segment forme rect (i.e. bouts non arrondis) */
|| (track->m_Shape == S_ARC ) /* segment en arc de cercle (bouts arrondis)*/
|| (track->m_Shape == S_CIRCLE ) /* segment en cercle (anneau)*/
|| (track->m_Shape == S_ARC_RECT ) /* segment en arc de cercle (bouts droits) (GERBER)*/
)
{
track->m_Width = pt_Dcode->m_Size.x;
}
else // Spots ( Flashed Items )
{
int width, len;
@ -367,29 +389,29 @@ D_CODE * pt_Dcode; /* Pointeur sur le D code*/
track->m_Start.x = (track->m_Start.x + track->m_End.x) / 2;
track->m_Start.y = (track->m_Start.y + track->m_End.y) / 2;
track->m_End = track->m_Start; // m_Start = m_End = Spot center
switch (pt_Dcode->m_Shape)
{
case GERB_LINE : // ne devrait pas etre utilis<69> ici
case GERB_CIRCLE : /* spot rond (for GERBER)*/
track->m_Shape = S_SPOT_CIRCLE;
break ;
case GERB_OVALE : /* spot ovale (for GERBER)*/
switch( pt_Dcode->m_Shape )
{
case GERB_LINE: // ne devrait pas etre utilis<69> ici
case GERB_CIRCLE: /* spot rond (for GERBER)*/
track->m_Shape = S_SPOT_CIRCLE;
break;
case GERB_OVALE: /* spot ovale (for GERBER)*/
track->m_Shape = S_SPOT_OVALE;
break ;
break;
default: /* spot rect (for GERBER)*/
track->m_Shape = S_SPOT_RECT;
break ;
break;
}
len >>= 1;
if ( size.x > size.y )
if( size.x > size.y )
{
track->m_Start.x -= len;
track->m_End.x += len;
}
else
{
track->m_Start.y -= len;
@ -401,81 +423,93 @@ D_CODE * pt_Dcode; /* Pointeur sur le D code*/
/*********************************************************/
D_CODE * ReturnToolDescr(int layer, int Dcode, int * index)
D_CODE* ReturnToolDescr( int layer, int Dcode, int* index )
/*********************************************************/
/* Retourne un pointeur sur la description de l'outil DCode de reference Dcode
(rappel : Dcode >= 10)
*/
* (rappel : Dcode >= 10)
*/
{
GERBER_Descr * DcodeList = g_GERBER_Descr_List[layer];
D_CODE * pt_dcode = NULL;
GERBER_Descr* DcodeList = g_GERBER_Descr_List[layer];
D_CODE* pt_dcode = NULL;
if (index) *index = 0;
if ( DcodeList && Dcode >= FIRST_DCODE && Dcode < MAX_TOOLS)
if( index )
*index = 0;
if( DcodeList && Dcode >= FIRST_DCODE && Dcode < MAX_TOOLS )
{
pt_dcode = DcodeList->m_Aperture_List[Dcode - FIRST_DCODE];
if ( index ) *index = Dcode - FIRST_DCODE + 1;
if( index )
*index = Dcode - FIRST_DCODE + 1;
}
return pt_dcode;
}
/************************************************/
void WinEDA_GerberFrame::Liste_D_Codes(wxDC * DC)
void WinEDA_GerberFrame::Liste_D_Codes( wxDC* DC )
/************************************************/
{
int ii, jj;
D_CODE * pt_D_code ;
wxString Line;
WinEDA_TextFrame * List;
int scale = 10000;
int curr_layer = GetPCBScreen()->m_Active_Layer;
int layer;
GERBER_Descr * DcodeList;
int ii, jj;
D_CODE* pt_D_code;
wxString Line;
WinEDA_TextFrame* List;
int scale = 10000;
int curr_layer = GetScreen()->m_Active_Layer;
int layer;
GERBER_Descr* DcodeList;
/* Construction de la liste des messages */
List = new WinEDA_TextFrame(this, _("List D codes"));
List = new WinEDA_TextFrame( this, _( "List D codes" ) );
for (layer = 0; layer < 32; layer++ )
for( layer = 0; layer < 32; layer++ )
{
DcodeList = g_GERBER_Descr_List[layer];
if ( DcodeList == NULL ) continue;
if ( DcodeList->ReturnUsedDcodeNumber() == 0 )
if( DcodeList == NULL )
continue;
if (layer == curr_layer )
Line.Printf( wxT("*** Active layer (%2.2d) ***"), layer+1);
else Line.Printf( wxT("*** layer %2.2d ***"), layer+1);
List->Append(Line);
if( DcodeList->ReturnUsedDcodeNumber() == 0 )
continue;
if( layer == curr_layer )
Line.Printf( wxT( "*** Active layer (%2.2d) ***" ), layer + 1 );
else
Line.Printf( wxT( "*** layer %2.2d ***" ), layer + 1 );
List->Append( Line );
for ( ii = 0, jj = 1 ; ii < MAX_TOOLS ; ii++ )
for( ii = 0, jj = 1; ii < MAX_TOOLS; ii++ )
{
pt_D_code = DcodeList->m_Aperture_List[ii] ;
if ( pt_D_code == NULL ) continue;
if ( !pt_D_code->m_InUse && !pt_D_code->m_Defined ) continue;
pt_D_code = DcodeList->m_Aperture_List[ii];
if( pt_D_code == NULL )
continue;
if( !pt_D_code->m_InUse && !pt_D_code->m_Defined )
continue;
Line.Printf( wxT(
"tool %2.2d: D%2.2d V %2.4f H %2.4f %s"),
"tool %2.2d: D%2.2d V %2.4f H %2.4f %s" ),
jj,
pt_D_code->m_Num_Dcode,
(float)pt_D_code->m_Size.y /scale,
(float)pt_D_code->m_Size.x /scale,
(float) pt_D_code->m_Size.y / scale,
(float) pt_D_code->m_Size.x / scale,
g_GERBER_Tool_Type[pt_D_code->m_Shape] );
if ( ! pt_D_code->m_Defined ) Line += wxT(" ?");
if ( ! pt_D_code->m_InUse ) Line += wxT(" *");
List->Append(Line);
if( !pt_D_code->m_Defined )
Line += wxT( " ?" );
if( !pt_D_code->m_InUse )
Line += wxT( " *" );
List->Append( Line );
jj++;
}
}
ii = List->ShowModal(); List->Destroy();
if (ii < 0) return;
if( ii < 0 )
return;
#if 0
// Mise en surbrillance des <20>l<EFBFBD>ments correspondant au DCode s<>lectionn<6E>
if(Etat_Surbrillance) Hight_Light(DrawPanel, DC);
net_code_Surbrillance = (GetScreen()->m_Active_Layer<< 16) + ii;
Hight_Light(DrawPanel, DC);
if( Etat_Surbrillance )
Hight_Light( DrawPanel, DC );
net_code_Surbrillance = (GetScreen()->m_Active_Layer << 16) + ii;
Hight_Light( DrawPanel, DC );
#endif
}

View File

@ -23,7 +23,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
* quand un outil est deja selectionn<EFBFBD>
*/
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg;
if( m_ID_current_state == 0 )
@ -84,7 +84,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
*/
{
int id = event.GetId();
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
GERBER_Descr* gerber_layer = g_GERBER_Descr_List[layer];
wxPoint pos;
wxClientDC dc( DrawPanel );
@ -114,11 +114,11 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
/* ne devrait pas etre execute, sauf bug */
if( m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE )
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
{
m_CurrentScreen->BlockLocate.m_Command = BLOCK_IDLE;
m_CurrentScreen->BlockLocate.m_State = STATE_NO_BLOCK;
m_CurrentScreen->BlockLocate.m_BlockDrawStruct = NULL;
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
}
if( m_ID_current_state == 0 )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
@ -267,21 +267,21 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE;
HandleBlockEnd( &dc );
break;
case ID_POPUP_ZOOM_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_DELETE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_DELETE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;

View File

@ -41,10 +41,13 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
case ID_MENU_INC_LAYER_AND_APPEND_FILE:
case ID_INC_LAYER_AND_APPEND_FILE:
{
int layer = GetPCBScreen()->m_Active_Layer;
((PCB_SCREEN*)GetScreen())->m_Active_Layer++;
int origLayer = GetScreen()->m_Active_Layer;
GetScreen()->m_Active_Layer++;
if( !LoadOneGerberFile( wxEmptyString, &dc, 0 ) )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = layer;
GetScreen()->m_Active_Layer = origLayer;
SetToolbars();
}
break;

View File

@ -1,6 +1,6 @@
/******************************************************************/
/* gerberframe.cpp - fonctions des classes du type WinEDA_GerberFrame */
/******************************************************************/
/******************************************************************/
/* gerberframe.cpp - fonctions des classes du type WinEDA_GerberFrame */
/******************************************************************/
#ifdef __GNUG__
#pragma implementation
@ -17,135 +17,140 @@
#include "id.h"
/****************************************/
/* class WinEDA_GerberFrame for GerbView*/
/****************************************/
/****************************************/
/* class WinEDA_GerberFrame for GerbView*/
/****************************************/
BEGIN_EVENT_TABLE(WinEDA_GerberFrame, wxFrame)
COMMON_EVENTS_DRAWFRAME
BEGIN_EVENT_TABLE( WinEDA_GerberFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow )
EVT_SIZE( WinEDA_GerberFrame::OnSize )
EVT_CLOSE(WinEDA_GerberFrame::OnCloseWindow)
EVT_SIZE(WinEDA_GerberFrame::OnSize)
EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA_GerberFrame::Process_Zoom )
EVT_TOOL_RANGE(ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA_GerberFrame::Process_Zoom)
EVT_TOOL( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DCODE_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
EVT_TOOL(ID_LOAD_FILE, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_APPEND_FILE, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_GERBVIEW_LOAD_DCODE_FILE, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_NEW_BOARD, WinEDA_GerberFrame::Files_io)
EVT_TOOL(ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io)
EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN, ID_PREFERENCES_FONT_END,
WinEDA_DrawFrame::ProcessFontPreferences )
EVT_MENU_RANGE(ID_PREFERENCES_FONT_INFOSCREEN, ID_PREFERENCES_FONT_END,
WinEDA_DrawFrame::ProcessFontPreferences)
// Menu Files:
EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat )
// Menu Files:
EVT_MENU(ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_APPEND_FILE, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter)
EVT_MENU(ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat)
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
WinEDA_GerberFrame::Files_io )
EVT_MENU_RANGE(ID_LOAD_FILE_1,ID_LOAD_FILE_10,
WinEDA_GerberFrame::Files_io)
EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU(ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions)
// menu Config
EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, ID_CONFIG_AND_PREFERENCES_END,
WinEDA_GerberFrame::Process_Config )
// menu Config
EVT_MENU_RANGE(ID_CONFIG_AND_PREFERENCES_START, ID_CONFIG_AND_PREFERENCES_END,
WinEDA_GerberFrame::Process_Config)
EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_PCB_LOOK_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU(ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config)
EVT_MENU(ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config)
EVT_MENU(ID_PCB_LOOK_SETUP, WinEDA_GerberFrame::Process_Config)
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage )
EVT_MENU_RANGE(ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage)
// menu Postprocess
EVT_MENU(ID_GERBVIEW_SHOW_LIST_DCODES, WinEDA_GerberFrame::Process_Special_Functions)
EVT_MENU(ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, WinEDA_GerberFrame::Process_Special_Functions)
EVT_MENU(ID_GERBVIEW_SHOW_SOURCE,
// menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE,
WinEDA_GerberFrame::Process_Special_Functions )
// menu Miscellaneous
EVT_MENU(ID_PCB_GLOBAL_DELETE, WinEDA_GerberFrame::Process_Special_Functions)
// Menu Help
EVT_MENU(ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp)
EVT_MENU(ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout)
// menu Miscellaneous
EVT_MENU( ID_PCB_GLOBAL_DELETE, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL(ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings)
EVT_TOOL(wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter)
EVT_TOOL(ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions)
EVT_KICAD_CHOICEBOX(ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_GerberFrame::Process_Special_Functions)
// Menu Help
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
EVT_KICAD_CHOICEBOX(ID_TOOLBARH_GERBER_SELECT_TOOL,
WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings )
EVT_TOOL( wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBER_SELECT_TOOL,
WinEDA_GerberFrame::Process_Special_Functions )
// Vertical toolbar:
EVT_TOOL(ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_PCB_ZONES_BUTT, WinEDA_GerberFrame::Process_Special_Functions)
EVT_TOOL(ID_PCB_DELETE_ITEM_BUTT, WinEDA_GerberFrame::Process_Special_Functions)
// Vertical toolbar:
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ZONES_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
// Annulation de commande en cours
EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
// Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions )
// Pop up menu
EVT_MENU(ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
// Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions )
// Option toolbar
EVT_TOOL_RANGE(ID_TB_OPTIONS_START,ID_TB_OPTIONS_END,
WinEDA_GerberFrame::OnSelectOptionToolbar)
// Option toolbar
EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END,
WinEDA_GerberFrame::OnSelectOptionToolbar )
// PopUp Menu trait<69>s dans drawpanel.cpp
// PopUp Menu trait<69>s dans drawpanel.cpp
END_EVENT_TABLE()
/****************/
/* Constructeur */
/****************/
/****************/
/* Constructeur */
/****************/
WinEDA_GerberFrame::WinEDA_GerberFrame(wxWindow * father, WinEDA_App *parent,
const wxString & title, const wxPoint& pos, const wxSize& size, long style) :
WinEDA_BasePcbFrame(father, parent, GERBER_FRAME, title, pos, size, style)
WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_App* parent,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
WinEDA_BasePcbFrame( father, parent, GERBER_FRAME, title, pos, size, style )
{
m_FrameName = wxT("GerberFrame");
m_FrameName = wxT( "GerberFrame" );
m_AboutTitle = g_GerbviewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin<69>
m_Ident = GERBER_FRAME;
m_ZoomMaxValue = 1024;
if ( DrawPanel ) DrawPanel->m_Block_Enable = TRUE;
if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE;
// Give an icon
#ifdef __WINDOWS__
SetIcon( wxICON(a_icon_gerbview));
SetIcon( wxICON( a_icon_gerbview ) );
#else
SetIcon( wxICON(icon_gerbview));
SetIcon( wxICON( icon_gerbview ) );
#endif
m_CurrentScreen = ActiveScreen = ScreenPcb;
SetBaseScreen( ActiveScreen = ScreenPcb );
GetSettings();
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 );
ReCreateMenuBar();
ReCreateHToolbar();
ReCreateVToolbar();
@ -156,26 +161,26 @@ WinEDA_GerberFrame::WinEDA_GerberFrame(wxWindow * father, WinEDA_App *parent,
WinEDA_GerberFrame::~WinEDA_GerberFrame()
{
m_Parent->m_GerberFrame = NULL;
m_CurrentScreen = ScreenPcb;
SetBaseScreen( ScreenPcb );
}
/***********************************************************/
void WinEDA_GerberFrame::OnCloseWindow(wxCloseEvent & Event)
void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event )
/***********************************************************/
{
PCB_SCREEN * screen;
PCB_SCREEN* screen = ScreenPcb;
screen = ScreenPcb ;
while( screen )
{
if(screen->IsModify()) break;
if( screen->IsModify() )
break;
screen = screen->Next();
}
if ( screen )
if( screen )
{
if( ! IsOK(this, _("Layer modified, Continue ?")) )
if( !IsOK( this, _( "Layer modified, Continue ?" ) ) )
{
Event.Veto();
return;
@ -188,129 +193,133 @@ PCB_SCREEN * screen;
screen = screen->Next();
}
/* Reselection de l'ecran de base,
pour les evenements de refresh g<EFBFBD>n<EFBFBD>r<EFBFBD>s par wxWindows */
m_CurrentScreen = ActiveScreen = ScreenPcb;
SetBaseScreen( ActiveScreen = ScreenPcb );
SaveSettings();
Destroy();
}
/*******************************************/
void WinEDA_GerberFrame::SetToolbars()
/*******************************************/
/** Function SetToolbars()
* Set the tools state for the toolbars, accordint to display options
*/
{
int layer = ((PCB_SCREEN*)GetScreen())->m_Active_Layer;
GERBER_Descr * Gerber_layer_descr = g_GERBER_Descr_List[layer];
int layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer;
GERBER_Descr* Gerber_layer_descr = g_GERBER_Descr_List[layer];
if( m_HToolBar == NULL ) return;
if( m_HToolBar == NULL )
return;
if ( GetScreen()->BlockLocate.m_Command == BLOCK_MOVE )
if( GetScreen()->BlockLocate.m_Command == BLOCK_MOVE )
{
m_HToolBar->EnableTool(wxID_CUT,TRUE);
m_HToolBar->EnableTool(wxID_COPY,TRUE);
m_HToolBar->EnableTool( wxID_CUT, TRUE );
m_HToolBar->EnableTool( wxID_COPY, TRUE );
}
else
{
m_HToolBar->EnableTool(wxID_CUT,FALSE);
m_HToolBar->EnableTool(wxID_COPY,FALSE);
m_HToolBar->EnableTool( wxID_CUT, FALSE );
m_HToolBar->EnableTool( wxID_COPY, FALSE );
}
if ( g_UnDeleteStackPtr )
if( g_UnDeleteStackPtr )
{
m_HToolBar->EnableTool(wxID_PASTE,TRUE);
m_HToolBar->EnableTool(ID_UNDO_BUTT,TRUE);
m_HToolBar->EnableTool( wxID_PASTE, TRUE );
m_HToolBar->EnableTool( ID_UNDO_BUTT, TRUE );
}
else
{
m_HToolBar->EnableTool(wxID_PASTE,FALSE);
m_HToolBar->EnableTool(ID_UNDO_BUTT,FALSE);
m_HToolBar->EnableTool( wxID_PASTE, FALSE );
m_HToolBar->EnableTool( ID_UNDO_BUTT, FALSE );
}
if ( m_SelLayerBox->GetSelection() != ((PCB_SCREEN*)GetScreen())->m_Active_Layer )
if( m_SelLayerBox->GetSelection() != ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer )
{
m_SelLayerBox->SetSelection( ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
m_SelLayerBox->SetSelection( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
}
if ( Gerber_layer_descr )
if( Gerber_layer_descr )
{
int sel_index;
m_SelLayerTool->Enable(TRUE);
if ( Gerber_layer_descr->m_Selected_Tool < FIRST_DCODE ) // No tool selected
m_SelLayerTool->Enable( TRUE );
if( Gerber_layer_descr->m_Selected_Tool < FIRST_DCODE ) // No tool selected
sel_index = 0;
else
sel_index = Gerber_layer_descr->m_Selected_Tool - FIRST_DCODE + 1;
if ( sel_index != m_SelLayerTool->GetSelection() )
if( sel_index != m_SelLayerTool->GetSelection() )
{
m_SelLayerTool->SetSelection(sel_index);
m_SelLayerTool->SetSelection( sel_index );
}
}
else
{
m_SelLayerTool->SetSelection(0);
m_SelLayerTool->Enable(FALSE);
m_SelLayerTool->SetSelection( 0 );
m_SelLayerTool->Enable( FALSE );
}
if ( m_OptionsToolBar )
if( m_OptionsToolBar )
{
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric == MILLIMETRE ? TRUE : FALSE);
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UnitMetric == INCHES ? TRUE : FALSE);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric == MILLIMETRE ? TRUE : FALSE );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UnitMetric == INCHES ? TRUE : FALSE );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_GRID,
m_Draw_Grid);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,
m_Draw_Grid );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SELECT_CURSOR,
g_CursorShape);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR,
g_CursorShape );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_PADS_SKETCH,
! m_DisplayPadFill);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
!m_DisplayPadFill );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
! m_DisplayPcbTrackFill);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
!m_DisplayPcbTrackFill );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH,
g_DisplayPolygonsModeSketch == 0 ? 0 : 1);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH,
g_DisplayPolygonsModeSketch == 0 ? 0 : 1 );
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_DCODES,
DisplayOpt.DisplayPadNum);
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_DCODES,
DisplayOpt.DisplayPadNum );
}
DisplayUnitsMsg();
}
/*************************************/
int WinEDA_GerberFrame::BestZoom()
/*************************************/
{
int ii,jj ;
int bestzoom;
wxSize size;
int ii, jj;
int bestzoom;
wxSize size;
/* calcul du zoom montrant tout le dessim */
m_Pcb->ComputeBoundaryBox();
size = DrawPanel->GetClientSize();
ii = m_Pcb->m_BoundaryBox.GetWidth() / size.x;
jj = m_Pcb->m_BoundaryBox.GetHeight() / size.y;
bestzoom = MAX(ii, jj) + 1;
bestzoom = MAX( ii, jj ) + 1;
/* determination du zoom existant le plus proche */
for (ii = 1 ; ii < 2048 ; ii <<= 1 )
for( ii = 1; ii < 2048; ii <<= 1 )
{
if(ii >= bestzoom) break;
if( ii >= bestzoom )
break;
}
bestzoom = ii;
GetScreen()->m_Curseur = m_Pcb->m_BoundaryBox.Centre();
return(bestzoom);
return bestzoom;
}

View File

@ -74,8 +74,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
m_Pcb->m_NbSegmZone = 0;
/* Init parametres de gestion des ecrans PAD et PCB */
m_CurrentScreen = ActiveScreen = ScreenPcb;
GetPCBScreen()->Init();
SetBaseScreen( ActiveScreen = ScreenPcb );
GetScreen()->Init();
return TRUE;
}
@ -104,7 +104,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
{
BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext;
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
if( all_layers )
layer = -1;
@ -189,7 +189,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/*********************************************************/
{
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
wxString msg;
msg.Printf( _( "Delete Layer %d" ), layer + 1 );

View File

@ -34,7 +34,7 @@ static int distance( int seuil );
/*************************************************************/
EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
/*************************************************************/
/* Fonction de localisation generale
@ -48,7 +48,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
int layer;
/* Localistion des pistes et vias, avec priorite aux vias */
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
Track = Locate_Pistes( m_Pcb->m_Track, -1, typeloc );
if( Track != NULL )
{
@ -80,7 +80,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
}
if( ( TrackLocate = Locate_Zone( (TRACK*) m_Pcb->m_Zone,
GetPCBScreen()->m_Active_Layer, typeloc ) ) != NULL )
GetScreen()->m_Active_Layer, typeloc ) ) != NULL )
{
TrackLocate->Display_Infos( this );
return TrackLocate;

View File

@ -20,9 +20,9 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
* The menu already has a list of zoom commands.
*/
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu

View File

@ -126,7 +126,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
wxPoint pos;
int error = 0;
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
if( g_GERBER_Descr_List[layer] == NULL )
{

View File

@ -107,7 +107,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = diametre;
track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y );
@ -140,7 +140,7 @@ static void Append_1_Flash_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = width;
track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y );
@ -181,7 +181,7 @@ static void Append_1_Line_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = largeur;
track->m_Start = startpoint;
NEGATE( track->m_Start.y );
@ -220,7 +220,7 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->m_Shape = S_ARC;
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = largeur;
if( multiquadrant )
@ -741,7 +741,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
edge_poly->Insert( frame->m_Pcb, last );
edge_poly->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
edge_poly->SetLayer( frame->GetScreen()->m_Active_Layer );
edge_poly->m_Width = 1;
edge_poly->m_Start = m_PreviousPos;
NEGATE( edge_poly->m_Start.y );

View File

@ -200,7 +200,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
if( GetScreen() )
{
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
gerber_layer = g_GERBER_Descr_List[layer];
}
@ -313,7 +313,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
m_SelLayerBox = new WinEDAChoiceBox( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER,
wxDefaultPosition, wxSize( 150, -1 ), choices );
m_SelLayerBox->SetSelection( GetPCBScreen()->m_Active_Layer );
m_SelLayerBox->SetSelection( GetScreen()->m_Active_Layer );
m_HToolBar->AddControl( m_SelLayerBox );
m_HToolBar->AddSeparator();

View File

@ -26,6 +26,21 @@ public:
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN();
/**
* Function GetCurItem
* returns the currently selected SCH_ITEM, overriding BASE_SCREEN::GetCurItem().
* @return SCH_ITEM* - the one selected, or NULL.
*/
SCH_ITEM* GetCurItem() const { return (SCH_ITEM*) BASE_SCREEN::GetCurItem(); }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from SCH_ITEM
*/
void SetCurItem( SCH_ITEM* aItem ) { BASE_SCREEN::SetCurItem( aItem ); }
virtual wxString GetClass() const
{
return wxT( "SCH_SCREEN" );
@ -34,7 +49,8 @@ public:
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies)
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void RemoveFromDrawList( SCH_ITEM* DrawStruct ); /* remove DrawStruct from EEDrawList. */
bool CheckIfOnDrawList( SCH_ITEM* st );
void AddToDrawList( SCH_ITEM* DrawStruct );

View File

@ -23,7 +23,7 @@ class SCH_ITEM;
/* classe representant un ecran graphique de dessin */
/****************************************************/
class WinEDA_DrawPanel : public EDA_DRAW_PANEL
class WinEDA_DrawPanel : public wxScrolledWindow
{
public:
int m_Ident;
@ -59,8 +59,10 @@ public:
// Constructor and destructor
WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, const wxSize& size );
~WinEDA_DrawPanel() { }
/****************************/
virtual BASE_SCREEN* GetScreen() { return m_Parent->GetScreen(); }
BASE_SCREEN* GetScreen();
void PrepareGraphicContext( wxDC* DC );
wxPoint CalcAbsolutePosition( const wxPoint& rel_pos );
@ -140,6 +142,7 @@ public:
DECLARE_EVENT_TABLE()
};
/**************************/
/* class DrawBlockStruct */
/**************************/
@ -264,6 +267,14 @@ public:
BASE_SCREEN( int idscreen, KICAD_T aType = SCREEN_STRUCT_TYPE );
~BASE_SCREEN();
/**
* Function setCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from EDA_BaseStruct
*/
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
void InitDatas(); /* Inits completes des variables */
wxSize ReturnPageSize();
int GetInternalUnits();
@ -289,15 +300,6 @@ public:
int IsSave() { return m_FlagSave & 1; }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from EDA_BaseStruct
*/
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
//----<zoom stuff>----------------------------------------------------------
/**
* Function GetZoom

View File

@ -236,6 +236,14 @@ public:
*/
BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param aItem Any object derived from BOARD_ITEM
*/
void SetCurItem( BOARD_ITEM* aItem ) { BASE_SCREEN::SetCurItem( aItem ); }
/* Return true if a microvia can be put on board
* A microvia ia a small via restricted to 2 near neighbour layers
* because its is hole is made by laser which can penetrate only one layer

View File

@ -56,7 +56,7 @@ public:
/* fonction de placement */
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
virtual void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
/**
* Function Save
@ -84,7 +84,7 @@ public:
public:
DrawPickedStruct( SCH_ITEM * pickedstruct = NULL );
~DrawPickedStruct();
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void DeleteWrapperList();
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }

View File

@ -28,6 +28,7 @@ enum fl_rot_cmp {
CMP_MIROIR_Y = 0x200 // miroir selon axe Y
};
class WinEDA_SchematicFrame : public WinEDA_DrawFrame
{
public:
@ -47,6 +48,9 @@ public:
void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void Process_Config( wxCommandEvent& event );
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
void Save_Config( wxWindow* displayframe );
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
@ -62,7 +66,11 @@ public:
EDA_BaseStruct* DrawStruct );
DrawSheetPath* GetSheet();
virtual BASE_SCREEN* GetScreen();
SCH_SCREEN* GetScreen() const;
BASE_SCREEN* GetBaseScreen() const;
virtual void SetScreen( SCH_SCREEN* screen );
virtual wxString GetScreenDesc();
@ -161,7 +169,7 @@ private:
bool PutInUndoList = FALSE );
// Text ,label, glabel
EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
SCH_TEXT* CreateNewText( wxDC* DC, int type );
void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
@ -296,7 +304,7 @@ public:
void SetToolbars();
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
private:
@ -406,7 +414,7 @@ public:
void ClickOnLibList( wxCommandEvent& event );
void ClickOnCmpList( wxCommandEvent& event );
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
private:
void SelectCurrentLibrary();

View File

@ -82,6 +82,7 @@ public:
*/
void SetBOARD( BOARD* aBoard );
// General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
@ -93,7 +94,10 @@ public:
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar();
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
PCB_SCREEN* GetScreen() const { return (PCB_SCREEN*) WinEDA_DrawFrame::GetBaseScreen(); }
BASE_SCREEN* GetBaseScreen() const;
int BestZoom();
void Show3D_Frame( wxCommandEvent& event );
@ -740,10 +744,9 @@ public:
int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
PCB_SCREEN* GetPCBScreen(){ return (PCB_SCREEN*)GetScreen(); }
EDA_BaseStruct* GerberGeneralLocateAndDisplay();
EDA_BaseStruct* Locate( int typeloc );
BOARD_ITEM* GerberGeneralLocateAndDisplay();
BOARD_ITEM* Locate( int typeloc );
void SetToolbars();

View File

@ -35,7 +35,6 @@
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS
#define EDA_DRAW_PANEL wxScrolledWindow
class wxMyDialogModalData;
@ -206,8 +205,6 @@ public:
WinEDAChoiceBox* m_SelZoomBox; // Dialog box to choose the Zoom value
int m_ZoomMaxValue; // Max zoom value: Draw min scale is 1/m_ZoomMaxValue
BASE_SCREEN* m_CurrentScreen; // current used SCREEN
int m_CurrentCursorShape; // shape for cursor (0 = default cursor)
int m_ID_current_state; // Id of active button on the vertical toolbar
int m_HTOOL_current_state; // Id of active button on horizontal toolbar
@ -226,6 +223,12 @@ public:
* dans la generation les fichiers de positionnement
* des composants) */
private:
BASE_SCREEN* m_CurrentScreen; ///< current used SCREEN
protected:
void SetBaseScreen( BASE_SCREEN* aScreen ) { m_CurrentScreen = aScreen; }
public:
// Constructor and destructor
@ -236,9 +239,15 @@ public:
~WinEDA_DrawFrame();
virtual BASE_SCREEN* GetScreen() { return m_CurrentScreen; }
virtual wxString GetScreenDesc();
/**
* Function GetBaseScreen
* is virtual and returns a pointer to a BASE_SCREEN or one of its derivatives.
* It may be overloaded by derived classes.
*/
virtual BASE_SCREEN* GetBaseScreen() const { return m_CurrentScreen; }
void OnMenuOpen( wxMenuEvent& event );
void OnMouseEvent( wxMouseEvent& event );
virtual void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
@ -261,7 +270,7 @@ public:
virtual void OnSelectGrid( wxCommandEvent& event );
virtual void OnSelectZoom( wxCommandEvent& event );
virtual void GeneralControle( wxDC* DC, wxPoint Mouse );
virtual void GeneralControle( wxDC* DC, wxPoint Mouse ){ /* dummy */ }
virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent );

View File

@ -105,11 +105,11 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
break;
case ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE:
FixeModule( (MODULE*) m_CurrentScreen->GetCurItem(), TRUE );
FixeModule( (MODULE*) GetScreen()->GetCurItem(), TRUE );
break;
case ID_POPUP_PCB_AUTOPLACE_FREE_MODULE:
FixeModule( (MODULE*) m_CurrentScreen->GetCurItem(), FALSE );
FixeModule( (MODULE*) GetScreen()->GetCurItem(), FALSE );
break;
case ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES:
@ -121,7 +121,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
break;
case ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE:
AutoPlaceModule( (MODULE*) m_CurrentScreen->GetCurItem(),
AutoPlaceModule( (MODULE*) GetScreen()->GetCurItem(),
PLACE_1_MODULE, &dc );
break;
@ -199,7 +199,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
MODULE* Module;
wxPoint start, current;
int Ymax_size, Xsize_allowed;
int pas_grille = m_CurrentScreen->GetGrid().x;
int pas_grille = GetScreen()->GetGrid().x;
bool EdgeExists;
float surface;
@ -237,8 +237,8 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
*/
if( PlaceModulesHorsPcb && EdgeExists )
{
if( m_CurrentScreen->m_Curseur.y < (m_Pcb->m_BoundaryBox.GetBottom() + 2000) )
m_CurrentScreen->m_Curseur.y = m_Pcb->m_BoundaryBox.GetBottom() + 2000;
if( GetScreen()->m_Curseur.y < (m_Pcb->m_BoundaryBox.GetBottom() + 2000) )
GetScreen()->m_Curseur.y = m_Pcb->m_BoundaryBox.GetBottom() + 2000;
}
/* calcul de la surface occupee par les circuits */
@ -257,7 +257,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
Xsize_allowed = (int) (sqrt( surface ) * 4.0 / 3.0);
/* Placement des modules */
start = current = m_CurrentScreen->m_Curseur;
start = current = GetScreen()->m_Curseur;
Ymax_size = 0;
for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ )
@ -279,13 +279,13 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
Ymax_size = 0;
}
m_CurrentScreen->m_Curseur.x =
GetScreen()->m_Curseur.x =
current.x + Module->m_Pos.x - Module->m_RealBoundaryBox.GetX();
m_CurrentScreen->m_Curseur.y =
GetScreen()->m_Curseur.y =
current.y + Module->m_Pos.y - Module->m_RealBoundaryBox.GetY();
Ymax_size = MAX( Ymax_size, Module->m_RealBoundaryBox.GetHeight() );
PutOnGrid( &m_CurrentScreen->m_Curseur );
PutOnGrid( &GetScreen()->m_Curseur );
Module->Draw( DrawPanel, DC, GR_XOR );
Place_Module( Module, DC ); /* positionne Module et recalcule cadre */
@ -294,7 +294,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
}
MyFree( BaseListeModules );
m_CurrentScreen->SetRefreshReq();
GetScreen()->SetRefreshReq();
}
@ -353,7 +353,7 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
if( WildCompareString( ModuleMask, Module->m_Reference->m_Text, FALSE ) )
{
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
Module->Draw( DrawPanel, DC, GR_XOR );
Rotate_Module( NULL, Module, Orient, FALSE );
Module->Draw( DrawPanel, DC, GR_OR );

View File

@ -118,7 +118,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
lay_tmp_TOP = Route_Layer_TOP;
OldPasRoute = g_GridRoutingSize;
g_GridRoutingSize = m_CurrentScreen->GetGrid().x;
g_GridRoutingSize = GetScreen()->GetGrid().x;
// Ensure g_GridRoutingSize has a reasonnable value:
if( g_GridRoutingSize < 10 )
@ -282,10 +282,10 @@ end_of_tst:
break;
/* placement du module */
CurrPosition = m_CurrentScreen->m_Curseur;
m_CurrentScreen->m_Curseur = PosOK;
CurrPosition = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = PosOK;
Place_Module( Module, DC );
m_CurrentScreen->m_Curseur = CurrPosition;
GetScreen()->m_Curseur = CurrPosition;
Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit();

View File

@ -45,7 +45,6 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
WinEDA_DrawFrame( father, idtype, parent, title, pos, size, style )
{
m_InternalUnits = 10000; // Internal unit = 1/10000 inch
m_CurrentScreen = NULL;
m_Pcb = NULL;
m_DisplayPadFill = TRUE; // How to draw pads
@ -66,6 +65,12 @@ WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame( void )
}
BASE_SCREEN* WinEDA_BasePcbFrame::GetBaseScreen() const
{
return GetScreen();
}
void WinEDA_BasePcbFrame::SetBOARD( BOARD* aBoard )
{
if(m_Pcb != g_ModuleEditor_Pcb)
@ -98,7 +103,7 @@ int WinEDA_BasePcbFrame::BestZoom( void )
jj = ( dy + (size.y / 2) ) / size.y;
bestzoom = MAX( ii, jj ) + 1;
m_CurrentScreen->m_Curseur = m_Pcb->m_BoundaryBox.Centre();
GetScreen()->m_Curseur = m_Pcb->m_BoundaryBox.Centre();
return bestzoom;
}
@ -284,7 +289,7 @@ void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event )
void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
/*****************************************************************/
{
m_CurrentScreen->SetCurItem( aItem );
GetScreen()->SetCurItem( aItem );
if( aItem )
{
@ -314,7 +319,7 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem()
/*****************************************************************/
{
return (BOARD_ITEM*) m_CurrentScreen->GetCurItem();
return GetScreen()->GetCurItem();
}

View File

@ -419,7 +419,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
}
}
if( panel->m_Parent->GetScreen()->BlockLocate.m_State != STATE_BLOCK_STOP )
if( screen->BlockLocate.m_State != STATE_BLOCK_STOP )
{
screen->BlockLocate.m_MoveVector.x = screen->m_Curseur.x - screen->BlockLocate.GetRight();
screen->BlockLocate.m_MoveVector.y = screen->m_Curseur.y - screen->BlockLocate.GetBottom();

View File

@ -292,12 +292,12 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*/
{
DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
BOARD_ITEM* item;
wxPoint move_offset;
MODULE* Currentmodule = g_EDA_Appl->m_ModuleEditFrame->m_Pcb->m_Modules;
PtBlock = &panel->GetScreen()->BlockLocate;
PtBlock = &screen->BlockLocate;
GRSetDrawMode( DC, g_XorMode );
/* Effacement ancien cadre */

View File

@ -18,7 +18,7 @@ wxPoint BOARD_ITEM::ZeroOffset(0,0);
// this is an ugly workaround to a linking problem in debug mode
// which needs to define SCH_ITEM::Place() when not really used.
#include "sch_item_struct.h"
void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
{
}
@ -503,15 +503,15 @@ bool BOARD::ComputeBoundaryBox()
if( m_PcbFrame->m_Draw_Sheet_Ref )
{
xmin = ymin = 0;
xmax = m_PcbFrame->m_CurrentScreen->ReturnPageSize().x;
ymax = m_PcbFrame->m_CurrentScreen->ReturnPageSize().y;
xmax = m_PcbFrame->GetScreen()->ReturnPageSize().x;
ymax = m_PcbFrame->GetScreen()->ReturnPageSize().y;
}
else
{
xmin = -m_PcbFrame->m_CurrentScreen->ReturnPageSize().x / 2;
ymin = -m_PcbFrame->m_CurrentScreen->ReturnPageSize().y / 2;
xmax = m_PcbFrame->m_CurrentScreen->ReturnPageSize().x / 2;
ymax = m_PcbFrame->m_CurrentScreen->ReturnPageSize().y / 2;
xmin = -m_PcbFrame->GetScreen()->ReturnPageSize().x / 2;
ymin = -m_PcbFrame->GetScreen()->ReturnPageSize().y / 2;
xmax = m_PcbFrame->GetScreen()->ReturnPageSize().x / 2;
ymax = m_PcbFrame->GetScreen()->ReturnPageSize().y / 2;
}
}

View File

@ -154,13 +154,10 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
if( (color & ITEM_NOT_SHOW) != 0 )
return;
if( panel )
screen = (PCB_SCREEN*) panel->m_Parent->m_CurrentScreen;
else
screen = (PCB_SCREEN*) ActiveScreen;
frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
screen = frame->GetScreen();
zoom = screen->GetZoom();
type_trace = m_Shape;

View File

@ -238,23 +238,18 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
wxPoint coord[4];
int zoom;
int fillpad = 0;
WinEDA_BasePcbFrame* frame = NULL;
wxPoint shape_pos;
PCB_SCREEN* screen = panel ?
(PCB_SCREEN*) panel->m_Parent->m_CurrentScreen :
(PCB_SCREEN*) ActiveScreen;
wxASSERT( panel );
if ( panel ) // Use current frame setting
{
frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
}
else if( DisplayOpt.DisplayPadFill == FILLED ) // Use board frame setting
fillpad = 1;
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
PCB_SCREEN* screen = frame->GetScreen();
zoom = screen->GetZoom();
if( frame->m_DisplayPadFill == FILLED )
fillpad = 1;
zoom = screen->GetZoom();
#ifdef PCBNEW
if( m_Flags & IS_MOVED )

View File

@ -151,7 +151,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
frame->Compile_Ratsnest( DC, AFFICHE );
frame->m_CurrentScreen->SetModify();
frame->GetScreen()->SetModify();
}

View File

@ -529,22 +529,22 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_ZOOM_IN_FROM_MOUSE:

View File

@ -186,7 +186,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->m_CurrentScreen->SetModify();
m_Parent->GetScreen()->SetModify();
EndModal( 1 );
}
@ -226,7 +226,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
if( Cotation == NULL ) /* debut reel du trace */
{
status_cotation = 1;
pos = m_CurrentScreen->m_Curseur;
pos = GetScreen()->m_Curseur;
Cotation = new COTATION( m_Pcb );
Cotation->m_Flags = IS_NEW;
@ -286,7 +286,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
m_Pcb->m_Drawings->Pback = Cotation;
m_Pcb->m_Drawings = Cotation;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
@ -374,7 +374,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
if( DC )
Cotation->Draw( DrawPanel, DC, GR_XOR );
Cotation->DeleteStructure();
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
}

View File

@ -765,7 +765,7 @@ void DrcDialog::OnButtonBrowseRptFileClick( wxCommandEvent& event )
wxString Mask(wxT("*"));
wxString Ext(wxT(".rpt"));
FileName = m_Parent->m_CurrentScreen->m_FileName;
FileName = m_Parent->GetScreen()->m_FileName;
ChangeFileNameExt(FileName, wxT("-drc") + Ext);
Mask += Ext;

View File

@ -141,11 +141,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
/* Should not be executed, just in case */
if( m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE )
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
{
m_CurrentScreen->BlockLocate.m_Command = BLOCK_IDLE;
m_CurrentScreen->BlockLocate.m_State = STATE_NO_BLOCK;
m_CurrentScreen->BlockLocate.m_BlockDrawStruct = NULL;
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
}
if( m_ID_current_state == 0 )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
@ -204,33 +204,33 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE;
HandleBlockPlace( &dc );
break;
case ID_POPUP_ZOOM_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_DELETE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_DELETE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_ROTATE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ROTATE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_INVERT_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_INVERT;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;

View File

@ -78,7 +78,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
/* Init nom fichier */
NameLayerCmp = m_CurrentScreen->m_FileName;
NameLayerCmp = GetScreen()->m_FileName;
ChangeFileNameExt( NameLayerCmp, wxT( "-cmp.pos" ) );
LayerCmp = wxFopen( NameLayerCmp, wxT( "wt" ) );
@ -90,7 +90,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
if( GenCu )
{
NameLayerCu = m_CurrentScreen->m_FileName;
NameLayerCu = GetScreen()->m_FileName;
ChangeFileNameExt( NameLayerCu, wxT( "-copper.pos" ) );
LayerCu = wxFopen( NameLayerCu, wxT( "wt" ) );
if( LayerCu == 0 )
@ -242,7 +242,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
File_Place_Offset = wxPoint( 0, 0 );
/* Init nom fichier */
FullFileName = m_CurrentScreen->m_FileName;
FullFileName = GetScreen()->m_FileName;
ChangeFileNameExt( FullFileName, wxT( ".rpt" ) );
rptfile = wxFopen( FullFileName, wxT( "wt" ) );

View File

@ -187,7 +187,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
Self_On = 0;
Mself.m_End = m_CurrentScreen->m_Curseur;
Mself.m_End = GetScreen()->m_Curseur;
/* Agencement des parametres pour simplifier le calcul : */
/* le point de depart doit avoir la coord depart < celle du point de fin */

View File

@ -288,7 +288,7 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
layer1, layer2, gen_through_holes ? false : true );
if( s_ToolListBuffer.size() > 0 ) //holes?
{
FullFileName = m_Parent->m_CurrentScreen->m_FileName;
FullFileName = m_Parent->GetScreen()->m_FileName;
layer_extend.Empty();
if( !gen_through_holes )
{
@ -360,7 +360,7 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
if( m_Choice_Drill_Report->GetSelection() > 0 )
{
FullFileName = m_Parent->m_CurrentScreen->m_FileName;
FullFileName = m_Parent->GetScreen()->m_FileName;
GenDrillReport( FullFileName );
}
@ -748,7 +748,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
GenDrillMapFile( m_Parent->m_Pcb,
dest,
FullFileName,
m_Parent->m_CurrentScreen->m_CurrentSheetDesc->m_Size,
m_Parent->GetScreen()->m_CurrentSheetDesc->m_Size,
s_HoleListBuffer,
s_ToolListBuffer,
s_Unit_Drill_is_Inch,
@ -791,7 +791,7 @@ void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName )
return;
}
GenDrillReportFile( dest, m_Parent->m_Pcb,
m_Parent->m_CurrentScreen->m_FileName,
m_Parent->GetScreen()->m_FileName,
s_Unit_Drill_is_Inch,
s_HoleListBuffer,
s_ToolListBuffer );

View File

@ -834,7 +834,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if( strnicmp( Line, "$SHEETDESCR", 11 ) == 0 )
{
ReadSheetDescr( m_CurrentScreen, File, &LineNum );
ReadSheetDescr( GetScreen(), File, &LineNum );
continue;
}
@ -1060,7 +1060,7 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
DateAndTime( line ) );
WriteGeneralDescrPcb( aFile );
WriteSheetDescr( m_CurrentScreen, aFile );
WriteSheetDescr( GetScreen(), aFile );
WriteSetup( aFile, this, m_Pcb );
rc = m_Pcb->Save( aFile );

View File

@ -743,7 +743,7 @@ MODULE* WinEDA_BasePcbFrame::Create_1_Module( wxDC* DC, const wxString& module_n
* 2eme = type VALEUR: "VAL**" */
/* Mise a jour des caract du nouveau module */
newpos = m_CurrentScreen->m_Curseur;
newpos = GetScreen()->m_Curseur;
Module->SetPosition( newpos );
Module->m_LastEdit_Time = time( NULL );

View File

@ -77,12 +77,12 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
build_liste_pads();
m_CurrentScreen->m_Curseur.x = m_CurrentScreen->m_Curseur.y = 0;
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
Place_Module( Module, NULL );
if( Module->GetLayer() != CMP_N )
m_Pcb->Change_Side_Module( Module, NULL );
Rotate_Module( NULL, Module, 0, FALSE );
m_CurrentScreen->ClrModify();
GetScreen()->ClrModify();
Zoom_Automatique( TRUE );
}
@ -94,7 +94,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
/* Permet de charger un module directement a partir de la librairie */
{
MODULE* module;
wxPoint curspos = m_CurrentScreen->m_Curseur;
wxPoint curspos = GetScreen()->m_Curseur;
wxString ModuleName, keys;
static wxArrayString HistoryList;
bool AllowWildSeach = TRUE;
@ -148,7 +148,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
module = Get_Librairie_Module( this, library, ModuleName, TRUE );
}
m_CurrentScreen->m_Curseur = curspos;
GetScreen()->m_Curseur = curspos;
DrawPanel->MouseToCursorSchema();
if( module )

View File

@ -604,27 +604,27 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE;
HandleBlockPlace( &dc );
break;
case ID_POPUP_ZOOM_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_DELETE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_DELETE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_ROTATE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ROTATE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
@ -632,7 +632,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_MIRROR_Y_BLOCK:
case ID_POPUP_INVERT_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_INVERT;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;

View File

@ -140,7 +140,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
SaveCopyInUndoList( m_Pcb->m_Modules );
Place_Ancre( m_Pcb->m_Modules, DC );
m_Pcb->m_Modules->m_Flags = 0;
m_CurrentScreen->m_Curseur = wxPoint( 0, 0 );
GetScreen()->m_Curseur = wxPoint( 0, 0 );
Recadre_Trace( TRUE );
Place_Module( m_Pcb->m_Modules, DC );
RedrawActiveWindow( DC, TRUE );
@ -185,7 +185,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
BOARD_ITEM* DrawStruct = GetCurItem();
wxString msg;
bool append_set_width = FALSE;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
// Simple localisation des elements si possible
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )

View File

@ -132,11 +132,12 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, WinEDA_App* pa
if( g_ModuleEditor_Pcb == NULL )
g_ModuleEditor_Pcb = new BOARD( NULL, this );
m_Pcb = g_ModuleEditor_Pcb;
m_Pcb->m_PcbFrame = this;
m_CurrentScreen = ScreenModule;
m_CurrentScreen->SetCurItem( NULL );
SetBaseScreen( ScreenModule );
GetScreen()->SetCurItem( NULL );
GetSettings();
wxSize GridSize( 500, 500 );
@ -169,7 +170,7 @@ WinEDA_ModuleEditFrame::~WinEDA_ModuleEditFrame()
/****************************************************/
{
m_Parent->m_ModuleEditFrame = NULL;
m_CurrentScreen = ScreenPcb;
SetBaseScreen( ScreenPcb );
}
@ -307,7 +308,7 @@ void WinEDA_ModuleEditFrame::SetToolbars()
int zoom;
for( jj = 1, zoom = 1; zoom <= m_ZoomMaxValue; zoom <<= 1, jj++ )
{
if( m_CurrentScreen && (m_CurrentScreen->GetZoom() == zoom) )
if( GetScreen() && (GetScreen()->GetZoom() == zoom) )
break;
new_choice++;
}

View File

@ -149,7 +149,7 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
MODULE* module;
WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) Panel->m_Parent;
module = (MODULE*) pcbframe->m_CurrentScreen->GetCurItem();
module = (MODULE*) pcbframe->GetScreen()->GetCurItem();
pcbframe->m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
if( module )
@ -219,7 +219,7 @@ MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
if( module == NULL )
return NULL;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
/* Duplication du module */
m_Pcb->m_Status_Pcb = 0;
@ -244,7 +244,7 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* redessin du contour de l'empreinte lors des deplacements de la souris
*/
{
MODULE* module = (MODULE*) panel->m_Parent->m_CurrentScreen->GetCurItem();
MODULE* module = (MODULE*) panel->GetScreen()->GetCurItem();
if( module == NULL )
return;
@ -256,7 +256,7 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
}
/* Redessine le module a la nouvelle place */
g_Offset_Module = module->m_Pos - panel->m_Parent->m_CurrentScreen->m_Curseur;
g_Offset_Module = module->m_Pos - panel->GetScreen()->m_Curseur;
DrawModuleOutlines( panel, DC, module );
Dessine_Segments_Dragges( panel, DC );
@ -297,7 +297,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
}
}
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
/* Erase rastnest if needed
* Dirty rectangle is not used here because usually using a XOR draw mode gives good results (very few artefacts) for ratsnest
@ -661,13 +661,13 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
if( module == 0 )
return;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
m_Pcb->m_Status_Pcb &= ~( LISTE_CHEVELU_OK | CONNEXION_OK);
if( g_Show_Module_Ratsnest && (m_Pcb->m_Status_Pcb & LISTE_PAD_OK) && DC )
trace_ratsnest_module( DC );
newpos = m_CurrentScreen->m_Curseur;
newpos = GetScreen()->m_Curseur;
module->SetPosition( newpos );
if( DC )
@ -716,7 +716,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
if( module == NULL )
return;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
/* efface ancienne position */
if( !(module->m_Flags & IS_MOVED) ) /* Rotation simple */

View File

@ -96,7 +96,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC,
static void Exit_Muonde( WinEDA_DrawFrame* frame, wxDC* DC )
/**********************************************************/
{
MODULE* Module = (MODULE*) frame->m_CurrentScreen->GetCurItem();
MODULE* Module = (MODULE*) frame->GetScreen()->GetCurItem();
if( Module )
{
@ -276,7 +276,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
Module->Draw( DrawPanel, DC, GR_OR );
DrawPanel->MouseToCursorSchema();
m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
return Module;
}
@ -646,7 +646,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC )
Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, GR_OR );
m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
return Module;
}

View File

@ -186,7 +186,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
if( aMessageWindow )
aMessageWindow->AppendText( msg );
aFrame->m_CurrentScreen->SetModify();
aFrame->GetScreen()->SetModify();
aFrame->m_Pcb->m_Status_Pcb = 0; State = 0; LineNum = 0; Comment = 0;
s_NbNewModules = 0;
@ -1003,7 +1003,7 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC )
MODULEtoLOAD* ref, * cmp;
int ii;
MODULE* Module = NULL;
wxPoint OldPos = aPcbFrame->m_CurrentScreen->m_Curseur;
wxPoint OldPos = aPcbFrame->GetScreen()->m_Curseur;
if( s_NbNewModules == 0 )
return;
@ -1014,14 +1014,14 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC )
// Calculate the footprint "best" position:
if( aPcbFrame->SetBoardBoundaryBoxFromEdgesOnly() )
{
aPcbFrame->m_CurrentScreen->m_Curseur.x = aPcbFrame->m_Pcb->m_BoundaryBox.GetRight() +
aPcbFrame->GetScreen()->m_Curseur.x = aPcbFrame->m_Pcb->m_BoundaryBox.GetRight() +
5000;
aPcbFrame->m_CurrentScreen->m_Curseur.y = aPcbFrame->m_Pcb->m_BoundaryBox.GetBottom() +
aPcbFrame->GetScreen()->m_Curseur.y = aPcbFrame->m_Pcb->m_BoundaryBox.GetBottom() +
10000;
}
else
{
aPcbFrame->m_CurrentScreen->m_Curseur = wxPoint( 0, 0 );
aPcbFrame->GetScreen()->m_Curseur = wxPoint( 0, 0 );
}
for( ii = 0; ii < s_NbNewModules; ii++, cmp = cmp->Next() )
@ -1061,7 +1061,7 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC )
}
}
aPcbFrame->m_CurrentScreen->m_Curseur = OldPos;
aPcbFrame->GetScreen()->m_Curseur = OldPos;
}

View File

@ -128,7 +128,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
wxString msg;
int flags = 0;
bool locate_track = FALSE;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
wxClientDC dc( DrawPanel );

View File

@ -215,7 +215,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
SetIcon( wxICON( a_icon_pcbnew ) );
m_InternalUnits = PCB_INTERNAL_UNIT; // Unites internes = 1/10000 inch
m_CurrentScreen = ScreenPcb;
SetBaseScreen( ScreenPcb );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
@ -249,9 +249,12 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_PcbFrame::~WinEDA_PcbFrame()
{
m_Parent->m_PcbFrame = NULL;
m_CurrentScreen = ScreenPcb;
SetBaseScreen( ScreenPcb );
delete m_drc;
if(m_Pcb != g_ModuleEditor_Pcb) delete m_Pcb;
if( m_Pcb != g_ModuleEditor_Pcb )
delete m_Pcb;
}
@ -304,7 +307,7 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
/* Reselection de l'ecran de base,
* pour les evenements de refresh generes par wxWindows */
m_CurrentScreen = ActiveScreen = ScreenPcb;
SetBaseScreen( ActiveScreen = ScreenPcb );
SaveSettings();
if( m_Parent && m_Parent->m_EDA_Config )
@ -342,9 +345,9 @@ void WinEDA_PcbFrame::SetToolbars()
if( m_HToolBar == NULL )
return;
m_HToolBar->EnableTool( ID_SAVE_BOARD, m_CurrentScreen->IsModify() );
m_HToolBar->EnableTool( ID_SAVE_BOARD, GetScreen()->IsModify() );
if( m_CurrentScreen->BlockLocate.m_Command == BLOCK_MOVE )
if( GetScreen()->BlockLocate.m_Command == BLOCK_MOVE )
{
m_HToolBar->EnableTool( wxID_CUT, TRUE );
m_HToolBar->EnableTool( wxID_COPY, TRUE );
@ -525,7 +528,7 @@ void WinEDA_PcbFrame::SetToolbars()
for( jj = 1, zoom = 1; zoom <= m_ZoomMaxValue; zoom <<= 1, jj++ )
{
if( m_CurrentScreen && (m_CurrentScreen->GetZoom() == zoom) )
if( GetScreen() && (GetScreen()->GetZoom() == zoom) )
break;
new_choice++;
}
@ -534,15 +537,15 @@ void WinEDA_PcbFrame::SetToolbars()
m_SelZoomBox->SetSelection( new_choice );
}
if( m_SelGridBox && m_CurrentScreen )
if( m_SelGridBox && GetScreen() )
{
int kk = m_SelGridBox->GetChoice();
for( ii = 0; g_GridList[ii].x > 0; ii++ )
{
if( !m_CurrentScreen->m_UserGridIsON
&& (m_CurrentScreen->GetGrid().x == g_GridList[ii].x)
&& (m_CurrentScreen->GetGrid().y == g_GridList[ii].y) )
if( !GetScreen()->m_UserGridIsON
&& (GetScreen()->GetGrid().x == g_GridList[ii].x)
&& (GetScreen()->GetGrid().y == g_GridList[ii].y) )
{
if( kk != ii )
m_SelGridBox->SetSelection( ii );

View File

@ -240,7 +240,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
/* Redessin du Texte */
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->m_CurrentScreen->SetModify();
m_Parent->GetScreen()->SetModify();
EndModal( 1 );
}
@ -288,7 +288,7 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL );
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
TextePcb->m_Flags = 0;
}
@ -318,8 +318,7 @@ static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/*************************************************************************/
/* Routine deplacant le texte PCB suivant le curseur de la souris */
{
TEXTE_PCB* TextePcb = (TEXTE_PCB*)
panel->m_Parent->m_CurrentScreen->GetCurItem();
TEXTE_PCB* TextePcb = (TEXTE_PCB*) panel->GetScreen()->GetCurItem();
if( TextePcb == NULL )
return;
@ -329,7 +328,7 @@ static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( erase )
TextePcb->Draw( panel, DC, GR_XOR );
TextePcb->m_Pos = panel->m_Parent->m_CurrentScreen->m_Curseur;
TextePcb->m_Pos = panel->GetScreen()->m_Curseur;
/* Redessin du Texte */
TextePcb->Draw( panel, DC, GR_XOR );
@ -376,7 +375,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
TextePcb->m_Miroir = 0;
TextePcb->m_Size = g_DesignSettings.m_PcbTextSize;
TextePcb->m_Pos = m_CurrentScreen->m_Curseur;
TextePcb->m_Pos = GetScreen()->m_Curseur;
TextePcb->m_Width = g_DesignSettings.m_PcbTextWidth;
InstallTextPCBOptionsFrame( TextePcb, DC, TextePcb->m_Pos );
@ -418,5 +417,5 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
TextePcb->Draw( DrawPanel, DC, drawmode );
TextePcb->Display_Infos( this );
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
}

View File

@ -39,8 +39,8 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
scale_y = Scale_Y * SCALE_HPGL;
// calcul en unites internes des dimensions de la feuille ( connues en 1/1000 pouce )
SheetSize.x = m_CurrentScreen->m_CurrentSheetDesc->m_Size.x * U_PCB;
SheetSize.y = m_CurrentScreen->m_CurrentSheetDesc->m_Size.y * U_PCB;
SheetSize.x = GetScreen()->m_CurrentSheetDesc->m_Size.x * U_PCB;
SheetSize.y = GetScreen()->m_CurrentSheetDesc->m_Size.y * U_PCB;
g_PlotOffset.x = 0;
g_PlotOffset.y = (int) (SheetSize.y * scale_y);
@ -79,7 +79,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
{
int tmp = g_PlotOrient; g_PlotOrient = 0;
InitPlotParametresHPGL( g_PlotOffset, scale_x, scale_y, g_PlotOrient );
PlotWorkSheet( PLOT_FORMAT_HPGL, m_CurrentScreen );
PlotWorkSheet( PLOT_FORMAT_HPGL, GetScreen() );
g_PlotOrient = tmp;
}

View File

@ -38,7 +38,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo
wxSize BoardSize;
wxPoint BoardCenter;
bool Center = FALSE;
Ki_PageDescr* currentsheet = m_CurrentScreen->m_CurrentSheetDesc;
Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc;
double scale_format; // Facteur correctif pour conversion forlat Ax->A4
double scale_x, scale_y;
int PlotMarge_in_mils = 0;
@ -105,7 +105,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo
int tmp = g_PlotOrient;
g_PlotOrient = 0;
SetPlotScale( 1.0, 1.0 );
PlotWorkSheet( PLOT_FORMAT_POST, m_CurrentScreen );
PlotWorkSheet( PLOT_FORMAT_POST, GetScreen() );
g_PlotOrient = tmp;
}

View File

@ -52,7 +52,7 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
}
/* Calcule du nom du fichier intermediaire de communication */
FullFileName = m_CurrentScreen->m_FileName;
FullFileName = GetScreen()->m_FileName;
ChangeFileNameExt( FullFileName, wxT( ".ipt" ) );
if( ( outfile = wxFopen( FullFileName, wxT( "wt" ) ) ) == NULL )
@ -558,7 +558,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
int max_layer = m_Pcb->m_BoardSettings->m_CopperLayerCount;
/* Calcule du nom du fichier intermediaire de communication */
FullFileName = m_CurrentScreen->m_FileName;
FullFileName = GetScreen()->m_FileName;
ChangeFileNameExt( FullFileName, wxT( ".trc" ) );
if( ( File = wxFopen( FullFileName, wxT( "rt" ) ) ) == NULL )
@ -661,10 +661,10 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
else
{
m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
}
Compile_Ratsnest( DC, TRUE );
if( NbTrack )
m_CurrentScreen->SetRefreshReq();
GetScreen()->SetRefreshReq();
}

View File

@ -274,7 +274,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
m_Parent = parent;
SetFont( *g_DialogFont );
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->m_CurrentScreen;
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen();
/* Construction de la liste des couches autoris<69>s */
int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount - 1];
Masque_Layer += ALL_NO_CU_LAYERS;
@ -361,7 +361,7 @@ void WinEDA_SelLayerPairFrame::OnOkClick( wxCommandEvent& event )
return;
}
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->m_CurrentScreen;
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen();
screen->m_Route_Layer_TOP = m_LayerId[m_LayerListTOP->GetSelection()];
screen->m_Route_Layer_BOTTOM = m_LayerId[m_LayerListBOTTOM->GetSelection()];

View File

@ -335,7 +335,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
pt_segm = (TRACK*) m_Pcb->m_Track;
for( ; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext )
{
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
if( pt_segm->Type() == TYPEVIA )
{
SEGVIA* Via = (SEGVIA*) pt_segm;
@ -361,7 +361,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
pt_segm = (TRACK*) m_Pcb->m_Zone;
for( ; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext )
{
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
jj = pt_segm->GetLayer();
if( New_Layer[jj] >= 0 && New_Layer[jj] < LAYER_NO_CHANGE )
pt_segm->SetLayer( New_Layer[jj] );
@ -373,7 +373,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
{
if( PtStruct->Type() == TYPEDRAWSEGMENT )
{
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
pt_drawsegm = (DRAWSEGMENT*) PtStruct;
jj = pt_drawsegm->GetLayer();
if( New_Layer[jj] >= 0 && New_Layer[jj] < LAYER_NO_CHANGE )

View File

@ -186,6 +186,6 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
DrawGeneralRatsnest( DC );
m_CurrentScreen->ClrRefreshReq();
GetScreen()->ClrRefreshReq();
}

View File

@ -211,7 +211,7 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp(
return 0; /* pas de changement de nom */
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */
FileNameCmp = m_Parent->m_CurrentScreen->m_FileName;
FileNameCmp = m_Parent->GetScreen()->m_FileName;
ChangeFileNameExt( FileNameCmp, NetCmpExtBuffer );
// Modification du fichier .cmp correcpondant
@ -527,10 +527,10 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
NewModule->m_Parent = m_Pcb;
m_Pcb->m_Status_Pcb = 0;
oldpos = m_CurrentScreen->m_Curseur;
m_CurrentScreen->m_Curseur = OldModule->m_Pos;
oldpos = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = OldModule->m_Pos;
Place_Module( NewModule, NULL );
m_CurrentScreen->m_Curseur = oldpos;
GetScreen()->m_Curseur = oldpos;
/* Changement eventuel de couche */
if( OldModule->GetLayer() != NewModule->GetLayer() )
@ -575,7 +575,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
m_Pcb->m_Status_Pcb = 0;
NewModule->m_Flags = 0;
m_CurrentScreen->SetModify();
GetScreen()->SetModify();
return NewModule;
}
@ -614,7 +614,7 @@ bool WinEDA_PcbFrame::RecreateCmpFileFromBoard()
}
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */
FullFileNameCmp = m_CurrentScreen->m_FileName;
FullFileNameCmp = GetScreen()->m_FileName;
ChangeFileNameExt( FullFileNameCmp, NetCmpExtBuffer );
mask = wxT( "*" ) + NetCmpExtBuffer;

View File

@ -266,35 +266,17 @@ void WinEDA_DrawFrame::OnSelectGrid( wxCommandEvent& event )
if( id < 0 )
return;
GetScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
wxSize grid = GetScreen()->GetGrid();
GetScreen()->SetGrid( g_GridList[id] );
wxSize newgrid = GetScreen()->GetGrid();
BASE_SCREEN* screen = GetBaseScreen();
screen->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
wxSize grid = screen->GetGrid();
screen->SetGrid( g_GridList[id] );
wxSize newgrid = screen->GetGrid();
if( newgrid.x != grid.x || newgrid.y != grid.y )
Recadre_Trace( FALSE );
}
#ifndef EESCHEMA
/**************************************************************/
void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
/**************************************************************/
/* Fonction virtuelle
* traitement des touches de fonctions utilisees ds tous les menus
* Zoom
* Redessin d'ecran
* Cht Unites
* Cht couches
* Remise a 0 de l'origine des coordonnees relatives
*/
{
}
#endif
/********************************************************/
void WinEDA_DrawFrame::OnSelectZoom( wxCommandEvent& event ) // fonction virtuelle
/********************************************************/
@ -326,10 +308,10 @@ void WinEDA_DrawFrame::OnSelectZoom( wxCommandEvent& event ) // fonction virtue
int zoom = 1 << id;
if( zoom > m_ZoomMaxValue )
zoom = m_ZoomMaxValue;
if( GetScreen()->GetZoom() == zoom )
if( GetBaseScreen()->GetZoom() == zoom )
return;
GetScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
GetScreen()->SetZoom( zoom );
GetBaseScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
GetBaseScreen()->SetZoom( zoom );
Recadre_Trace( FALSE );
}
}
@ -339,7 +321,7 @@ int WinEDA_DrawFrame::GetZoom(void)
/***********************************/
/* Return the current zoom level */
{
return GetScreen()->GetZoom();
return GetBaseScreen()->GetZoom();
}
@ -587,12 +569,13 @@ void WinEDA_DrawFrame::OnZoom( int zoom_type )
if( DrawPanel == NULL )
return;
BASE_SCREEN* screen = GetBaseScreen();
bool move_mouse_cursor = FALSE;
int x, y;
wxPoint old_pos;
DrawPanel->GetViewStart( &x, &y );
old_pos = GetScreen()->m_Curseur;
old_pos = GetBaseScreen()->m_Curseur;
switch( zoom_type )
{
@ -603,9 +586,9 @@ void WinEDA_DrawFrame::OnZoom( int zoom_type )
case ID_ZOOM_IN_BUTT:
if( zoom_type == ID_ZOOM_IN_BUTT )
GetScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
GetBaseScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
GetScreen()->SetPreviousZoom();
screen->SetPreviousZoom();
Recadre_Trace( move_mouse_cursor );
break;
@ -617,8 +600,8 @@ void WinEDA_DrawFrame::OnZoom( int zoom_type )
case ID_ZOOM_OUT_BUTT:
if( zoom_type == ID_ZOOM_OUT_BUTT )
GetScreen()->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
GetScreen()->SetNextZoom();
screen->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
screen->SetNextZoom();
Recadre_Trace( move_mouse_cursor );
break;
@ -736,7 +719,7 @@ int WinEDA_DrawFrame::ReturnBlockCommand( int key )
void WinEDA_DrawFrame::InitBlockPasteInfos()
{
GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
GetBaseScreen()->BlockLocate.m_BlockDrawStruct = NULL;
DrawPanel->ManageCurseur = NULL;
}
@ -759,15 +742,18 @@ void WinEDA_DrawFrame::AdjustScrollBars()
wxSize draw_size, panel_size;
wxSize scrollbar_number;
wxPoint scrollbar_pos;
int zoom = GetScreen()->GetZoom();
BASE_SCREEN* screen = GetBaseScreen();
int zoom = screen->GetZoom();
int xUnit, yUnit;
if( GetScreen() == NULL )
if( screen == NULL )
return;
if( DrawPanel == NULL )
return;
draw_size = GetScreen()->ReturnPageSize();
draw_size = screen->ReturnPageSize();
// La zone d'affichage est reglee a une taille double de la feuille de travail:
draw_size.x *= 2; draw_size.y *= 2;
@ -780,20 +766,20 @@ void WinEDA_DrawFrame::AdjustScrollBars()
draw_size.y += panel_size.y / 2;
if( GetScreen()->m_Center )
if( screen->m_Center )
{
GetScreen()->m_DrawOrg.x = -draw_size.x / 2;
GetScreen()->m_DrawOrg.y = -draw_size.y / 2;
screen->m_DrawOrg.x = -draw_size.x / 2;
screen->m_DrawOrg.y = -draw_size.y / 2;
}
else
{
GetScreen()->m_DrawOrg.x = -panel_size.x / 2;
GetScreen()->m_DrawOrg.y = -panel_size.y / 2;
screen->m_DrawOrg.x = -panel_size.x / 2;
screen->m_DrawOrg.y = -panel_size.y / 2;
}
// DrawOrg est rendu multiple du zoom min :
GetScreen()->m_DrawOrg.x -= GetScreen()->m_DrawOrg.x % 256;
GetScreen()->m_DrawOrg.y -= GetScreen()->m_DrawOrg.y % 256;
screen->m_DrawOrg.x -= screen->m_DrawOrg.x % 256;
screen->m_DrawOrg.y -= screen->m_DrawOrg.y % 256;
// Calcul du nombre de scrolls (en unites de scrool )
scrollbar_number.x = draw_size.x / (DrawPanel->m_Scroll_unit * zoom);
@ -808,10 +794,10 @@ void WinEDA_DrawFrame::AdjustScrollBars()
xUnit *= zoom; yUnit *= zoom;
// Calcul de la position, curseur place au centre d'ecran
scrollbar_pos = GetScreen()->m_Curseur;
scrollbar_pos = screen->m_Curseur;
scrollbar_pos.x -= GetScreen()->m_DrawOrg.x;
scrollbar_pos.y -= GetScreen()->m_DrawOrg.y;
scrollbar_pos.x -= screen->m_DrawOrg.x;
scrollbar_pos.y -= screen->m_DrawOrg.y;
scrollbar_pos.x -= panel_size.x / 2;
scrollbar_pos.y -= panel_size.y / 2;
@ -823,15 +809,15 @@ void WinEDA_DrawFrame::AdjustScrollBars()
scrollbar_pos.x /= xUnit;
scrollbar_pos.y /= yUnit;
GetScreen()->m_ScrollbarPos = scrollbar_pos;
GetScreen()->m_ScrollbarNumber = scrollbar_number;
screen->m_ScrollbarPos = scrollbar_pos;
screen->m_ScrollbarNumber = scrollbar_number;
DrawPanel->SetScrollbars( DrawPanel->m_Scroll_unit,
DrawPanel->m_Scroll_unit,
GetScreen()->m_ScrollbarNumber.x,
GetScreen()->m_ScrollbarNumber.y,
GetScreen()->m_ScrollbarPos.x,
GetScreen()->m_ScrollbarPos.y, TRUE );
screen->m_ScrollbarNumber.x,
screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x,
screen->m_ScrollbarPos.y, TRUE );
}
@ -885,24 +871,25 @@ void WinEDA_DrawFrame::Affiche_Status_Box()
{
wxString Line;
int dx, dy;
BASE_SCREEN* screen = GetBaseScreen();
if( GetScreen() == NULL )
if( !screen )
return;
/* affichage Zoom et coordonnees absolues */
Line.Printf( wxT( "Z %d" ), GetScreen()->GetZoom() );
Line.Printf( wxT( "Z %d" ), screen->GetZoom() );
SetStatusText( Line, 1 );
Line.Printf( g_UnitMetric ? wxT( "X %.3f Y %.3f" ) : wxT( "X %.4f Y %.4f" ),
To_User_Unit( g_UnitMetric, GetScreen()->m_Curseur.x,
To_User_Unit( g_UnitMetric, screen->m_Curseur.x,
m_InternalUnits ),
To_User_Unit( g_UnitMetric, GetScreen()->m_Curseur.y,
To_User_Unit( g_UnitMetric, screen->m_Curseur.y,
m_InternalUnits ) );
SetStatusText( Line, 2 );
/* affichage des coordonnees relatives */
dx = GetScreen()->m_Curseur.x - GetScreen()->m_O_Curseur.x;
dy = GetScreen()->m_Curseur.y - GetScreen()->m_O_Curseur.y;
dx = screen->m_Curseur.x - screen->m_O_Curseur.x;
dy = screen->m_Curseur.y - screen->m_O_Curseur.y;
Line.Printf( g_UnitMetric ? wxT( "x %.3f y %.3f" ) : wxT( "x %.4f y %.4f" ),
To_User_Unit( g_UnitMetric, dx, m_InternalUnits ),

View File

@ -13,11 +13,19 @@
#include "macros.h"
#include "id.h"
#ifdef PCBNEW
#include "pcbstruct.h"
#endif
#ifdef EESCHEMA
#include "program.h"
#endif
// Local defines
#define CURSOR_SIZE 12 // Cursor size in pixels
// Events used by WinEDA_DrawPanel
BEGIN_EVENT_TABLE( WinEDA_DrawPanel, EDA_DRAW_PANEL )
BEGIN_EVENT_TABLE( WinEDA_DrawPanel, wxScrolledWindow )
EVT_LEAVE_WINDOW( WinEDA_DrawPanel::OnMouseLeaving )
EVT_MOUSE_EVENTS( WinEDA_DrawPanel::OnMouseEvent )
EVT_CHAR( WinEDA_DrawPanel::OnKeyEvent )
@ -38,16 +46,18 @@ END_EVENT_TABLE()
WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
const wxPoint& pos, const wxSize& size ) :
EDA_DRAW_PANEL( parent, id, pos, size,
wxScrolledWindow( parent, id, pos, size,
wxBORDER | wxNO_FULL_REPAINT_ON_RESIZE )
{
m_Parent = parent;
m_Ident = m_Parent->m_Ident;
m_Scroll_unit = 1;
m_ScrollButt_unit = 40;
SetBackgroundColour( wxColour( ColorRefs[g_DrawBgColor].m_Red,
ColorRefs[g_DrawBgColor].m_Green,
ColorRefs[g_DrawBgColor].m_Blue ) );
EnableScrolling( TRUE, TRUE );
m_ClipBox.SetSize( size );
m_ClipBox.SetX( 0 );
@ -62,6 +72,7 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
if( m_Parent->m_Parent->m_EDA_Config )
m_AutoPAN_Enable = m_Parent->m_Parent->m_EDA_Config->Read( wxT( "AutoPAN" ), TRUE );
m_AutoPAN_Request = FALSE;
m_Block_Enable = FALSE;
m_PanelDefaultCursor = m_PanelCursor = wxCURSOR_ARROW;
@ -69,6 +80,16 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
}
BASE_SCREEN* WinEDA_DrawPanel::GetScreen()
{
WinEDA_DrawFrame* parentFrame = m_Parent;
wxASSERT( parentFrame );
return parentFrame->GetBaseScreen();
}
/*********************************************************************************/
void WinEDA_DrawPanel::Trace_Curseur( wxDC* DC, int color )
/*********************************************************************************/

View File

@ -116,12 +116,13 @@ WinEDA_SetPageFrame::WinEDA_SetPageFrame( WinEDA_DrawFrame* parent, wxWindowID i
wxString msg;
m_ParentDrawFrame = parent;
m_Screen = m_ParentDrawFrame->GetScreen();
m_Screen = m_ParentDrawFrame->GetBaseScreen();
m_Modified = FALSE;
m_SelectedSheet = NULL;
m_CurrentSelection = 0;
SearchPageSizeSelection();
Create(parent, id, caption, pos, size, style);
Create( parent, id, caption, pos, size, style);
// Init display value for sheet User size
wxString format = m_TextSheetCount->GetLabel();
msg.Printf(format, m_Screen->m_NumberOfScreen);
@ -129,6 +130,7 @@ WinEDA_SetPageFrame::WinEDA_SetPageFrame( WinEDA_DrawFrame* parent, wxWindowID i
format = m_TextSheetNumber->GetLabel();
msg.Printf(format, m_Screen->m_ScreenNumber);
m_TextSheetNumber->SetLabel(msg);
if( g_UnitMetric )
{
UserSizeX = (double)g_Sheet_user.m_Size.x * 25.4 / 1000;
@ -638,7 +640,7 @@ void WinEDA_SetPageFrame::SearchPageSizeSelection()
for( ii = 0; ii < NB_ITEMS; ii++ )
{
sheet = SheetList[ii];
if( m_ParentDrawFrame->GetScreen()->m_CurrentSheetDesc == sheet )
if( m_ParentDrawFrame->GetBaseScreen()->m_CurrentSheetDesc == sheet )
m_CurrentSelection = ii;
}
}

View File

@ -350,7 +350,7 @@ wxString WinEDA_PrintSVGFrame::ReturnFullFileName()
{
wxString name, ext;
name = m_Parent->GetScreen()->m_FileName;
name = m_Parent->GetBaseScreen()->m_FileName;
ChangeFileNameExt( name, wxT( ".svg" ) );
return name;
}
@ -396,7 +396,7 @@ void WinEDA_PrintSVGFrame::PrintSVGDoc( wxCommandEvent& event )
SetPenWidth();
BASE_SCREEN* screen = m_Parent->GetScreen();
BASE_SCREEN* screen = m_Parent->GetBaseScreen();
BASE_SCREEN* oldscreen = screen;
#ifndef EESCHEMA
if( Select_PrintAll )

View File

@ -305,7 +305,7 @@ wxString WinEDA_PrintFrame::BuildPrintTitle()
{
wxString name, ext;
wxFileName::SplitPath( m_Parent->GetScreen()->m_FileName,
wxFileName::SplitPath( m_Parent->GetBaseScreen()->m_FileName,
(wxString*) NULL, &name, &ext );
name += wxT( "-" ) + ext;
return name;
@ -486,7 +486,7 @@ bool EDA_Printout::OnPrintPage( int page )
#ifdef EESCHEMA
BASE_SCREEN* screen = m_Parent->GetScreen();
BASE_SCREEN* screen = m_Parent->GetBaseScreen();
BASE_SCREEN* oldscreen = screen;
if( s_OptionPrintPage == 1 )

View File

@ -46,7 +46,7 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
* Note: Mac OS ** does not ** allow moving mouse cursor by program.
*/
{
PutOnGrid( &(GetScreen()->m_Curseur) );
PutOnGrid( &(GetBaseScreen()->m_Curseur) );
AdjustScrollBars();
@ -69,9 +69,9 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
{
double ftmp;
if( !GetScreen()->m_UserGridIsON )
if( !GetBaseScreen()->m_UserGridIsON )
{
wxSize grid_size = GetScreen()->GetGrid();
wxSize grid_size = GetBaseScreen()->GetGrid();
ftmp = (double) coord->x / grid_size.x;
coord->x = ( (int) round( ftmp ) ) * grid_size.x;
@ -81,10 +81,10 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
}
else
{
double pasx = GetScreen()->m_UserGrid.x * m_InternalUnits;
double pasy = GetScreen()->m_UserGrid.y * m_InternalUnits;
double pasx = GetBaseScreen()->m_UserGrid.x * m_InternalUnits;
double pasy = GetBaseScreen()->m_UserGrid.y * m_InternalUnits;
if( GetScreen()->m_UserGridUnit != INCHES )
if( GetBaseScreen()->m_UserGridUnit != INCHES )
{
pasx /= 25.4;
pasy /= 25.4;
@ -109,7 +109,7 @@ void WinEDA_DrawFrame::Zoom_Automatique( bool move_mouse_cursor )
int bestzoom;
bestzoom = BestZoom();
GetScreen()->SetZoom( bestzoom );
GetBaseScreen()->SetZoom( bestzoom );
Recadre_Trace( move_mouse_cursor );
}
@ -137,9 +137,9 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
if( bestzoom <= 0 )
bestzoom = 1;
GetScreen()->SetZoom( bestzoom );
GetBaseScreen()->SetZoom( bestzoom );
GetScreen()->m_Curseur = Rect.Centre();
GetBaseScreen()->m_Curseur = Rect.Centre();
Recadre_Trace( TRUE );
}
@ -171,127 +171,127 @@ void WinEDA_DrawPanel::Process_Popup_Zoom( wxCommandEvent& event )
break;
case ID_POPUP_ZOOM_LEVEL_1:
m_Parent->GetScreen()->SetZoom( 1 );
GetScreen()->SetZoom( 1 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_2:
m_Parent->GetScreen()->SetZoom( 2 );
GetScreen()->SetZoom( 2 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_4:
m_Parent->GetScreen()->SetZoom( 4 );
GetScreen()->SetZoom( 4 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_8:
m_Parent->GetScreen()->SetZoom( 8 );
GetScreen()->SetZoom( 8 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_16:
m_Parent->GetScreen()->SetZoom( 16 );
GetScreen()->SetZoom( 16 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_32:
m_Parent->GetScreen()->SetZoom( 32 );
GetScreen()->SetZoom( 32 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_64:
m_Parent->GetScreen()->SetZoom( 64 );
GetScreen()->SetZoom( 64 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_128:
m_Parent->GetScreen()->SetZoom( 128 );
GetScreen()->SetZoom( 128 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_256:
m_Parent->GetScreen()->SetZoom( 256 );
GetScreen()->SetZoom( 256 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_512:
m_Parent->GetScreen()->SetZoom( 512 );
GetScreen()->SetZoom( 512 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_1024:
m_Parent->GetScreen()->SetZoom( 1024 );
GetScreen()->SetZoom( 1024 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_ZOOM_LEVEL_2048:
m_Parent->GetScreen()->SetZoom( 2048 );
GetScreen()->SetZoom( 2048 );
m_Parent->Recadre_Trace( TRUE );
break;
case ID_POPUP_GRID_LEVEL_1:
m_Parent->GetScreen()->SetGrid( wxSize( 1, 1 ) );
GetScreen()->SetGrid( wxSize( 1, 1 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_2:
m_Parent->GetScreen()->SetGrid( wxSize( 2, 2 ) );
GetScreen()->SetGrid( wxSize( 2, 2 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_5:
m_Parent->GetScreen()->SetGrid( wxSize( 5, 5 ) );
GetScreen()->SetGrid( wxSize( 5, 5 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_10:
m_Parent->GetScreen()->SetGrid( wxSize( 10, 10 ) );
GetScreen()->SetGrid( wxSize( 10, 10 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_20:
m_Parent->GetScreen()->SetGrid( wxSize( 20, 20 ) );
GetScreen()->SetGrid( wxSize( 20, 20 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_25:
m_Parent->GetScreen()->SetGrid( wxSize( 25, 25 ) );
GetScreen()->SetGrid( wxSize( 25, 25 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_50:
m_Parent->GetScreen()->SetGrid( wxSize( 50, 50 ) );
GetScreen()->SetGrid( wxSize( 50, 50 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_100:
m_Parent->GetScreen()->SetGrid( wxSize( 100, 100 ) );
GetScreen()->SetGrid( wxSize( 100, 100 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_200:
m_Parent->GetScreen()->SetGrid( wxSize( 200, 200 ) );
GetScreen()->SetGrid( wxSize( 200, 200 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_250:
m_Parent->GetScreen()->SetGrid( wxSize( 250, 250 ) );
GetScreen()->SetGrid( wxSize( 250, 250 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_500:
m_Parent->GetScreen()->SetGrid( wxSize( 500, 500 ) );
GetScreen()->SetGrid( wxSize( 500, 500 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_LEVEL_1000:
m_Parent->GetScreen()->SetGrid( wxSize( 1000, 1000 ) );
GetScreen()->SetGrid( wxSize( 1000, 1000 ) );
m_Parent->ReDrawPanel();
break;
case ID_POPUP_GRID_USER:
m_Parent->GetScreen()->SetGrid( wxSize( -1, -1 ) );
GetScreen()->SetGrid( wxSize( -1, -1 ) );
m_Parent->ReDrawPanel();
break;
@ -369,7 +369,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_REDRAW, _( "Redraw" ), repaint_xpm );
/* Create the basic zoom list: */
zoom = m_Parent->GetScreen()->GetZoom();
zoom = GetScreen()->GetZoom();
zoom_value = 1;
for( ii = 0; zoom_value <= m_Parent->m_ZoomMaxValue; zoom_value <<= 1, ii++ ) // Create zoom choice 1 .. zoom max
{
@ -384,7 +384,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, grid_choice,
ID_POPUP_GRID_SELECT, _( "Grid Select" ), grid_select_xpm );
grid = m_Parent->GetScreen()->GetGrid();
grid = GetScreen()->GetGrid();
// Create grid list
switch( m_Parent->m_Ident )
@ -409,7 +409,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
grid_choice->Append( grid_list_pcb[ii].m_Id, msg, wxEmptyString, TRUE );
if( grid_list_pcb[ii].m_Value <= 0 )
{
if( m_Parent->GetScreen()->m_UserGridIsON )
if( GetScreen()->m_UserGridIsON )
grid_choice->Check( grid_list_pcb[ii].m_Id, TRUE );
break;
}