Commit 721d878f authored by dickelbeck's avatar dickelbeck

GetScreen() work, menu capitalization, beautifying

parent 25d04032
...@@ -5,18 +5,33 @@ Started 2007-June-11 ...@@ -5,18 +5,33 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. 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> 2008-Apr-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+eeschema +eeschema
very small bug in display component info removed very small bug in display component info removed
+pcbnew +pcbnew
+cvpcb +cvpcb
removed bug: forgotten paths when adding lib files when not in the default lib path 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) (same problem as in eeschema, solved in 2008-Apr-09 Update)
2008-Apr-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Apr-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+eeschema +eeschema
......
...@@ -131,7 +131,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key, ...@@ -131,7 +131,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
* Init the Block infos: command type, initial position, and other variables.. * 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) if( (Block->m_Command != BLOCK_IDLE)
|| ( Block->m_State != STATE_NO_BLOCK) ) || ( Block->m_State != STATE_NO_BLOCK) )
...@@ -169,7 +169,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key, ...@@ -169,7 +169,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
if( Block->m_BlockDrawStruct == NULL ) /* No data to paste */ if( Block->m_BlockDrawStruct == NULL ) /* No data to paste */
{ {
DisplayError( this, wxT( "No Block to paste" ), 20 ); DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE; GetBaseScreen()->BlockLocate.m_Command = BLOCK_IDLE;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
return TRUE; return TRUE;
} }
......
...@@ -42,7 +42,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event ) ...@@ -42,7 +42,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event )
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD ) 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->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
DrawPanel->m_PanelDefaultCursor ) ); DrawPanel->m_PanelDefaultCursor ) );
......
...@@ -321,7 +321,7 @@ wxString WinEDA_DrawFrame::GetScreenDesc() ...@@ -321,7 +321,7 @@ wxString WinEDA_DrawFrame::GetScreenDesc()
{ {
wxString msg; wxString msg;
msg << GetScreen()->m_ScreenNumber << wxT( "/" ) << msg << GetBaseScreen()->m_ScreenNumber << wxT( "/" )
GetScreen()->m_NumberOfScreen; << GetBaseScreen()->m_NumberOfScreen;
return msg; return msg;
} }
This diff is collapsed.
...@@ -53,7 +53,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent, ...@@ -53,7 +53,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
m_Pcb = new BOARD( NULL, this ); m_Pcb = new BOARD( NULL, this );
m_CurrentScreen = new PCB_SCREEN( CVPCB_DISPLAY_FRAME ); SetBaseScreen( new PCB_SCREEN( CVPCB_DISPLAY_FRAME ) );
GetSettings(); 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 );
...@@ -66,10 +66,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent, ...@@ -66,10 +66,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
/******************************************/ /******************************************/
WinEDA_DisplayFrame::~WinEDA_DisplayFrame() WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
/******************************************/ /******************************************/
// Destructor
{ {
delete m_CurrentScreen; delete GetBaseScreen();
SetBaseScreen( 0 );
delete m_Pcb; delete m_Pcb;
...@@ -177,14 +176,14 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -177,14 +176,14 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{ {
wxSize delta; wxSize delta;
int flagcurseur = 0; int flagcurseur = 0;
int zoom = m_CurrentScreen->GetZoom(); int zoom = GetScreen()->GetZoom();
wxPoint curpos, oldpos; wxPoint curpos, oldpos;
curpos = DrawPanel->CursorRealPosition( Mouse ); curpos = DrawPanel->CursorRealPosition( Mouse );
oldpos = m_CurrentScreen->m_Curseur; oldpos = GetScreen()->m_Curseur;
delta.x = m_CurrentScreen->GetGrid().x / zoom; delta.x = GetScreen()->GetGrid().x / zoom;
delta.y = m_CurrentScreen->GetGrid().y / zoom; delta.y = GetScreen()->GetGrid().y / zoom;
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
if( delta.y <= 0 ) if( delta.y <= 0 )
...@@ -197,13 +196,13 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -197,13 +196,13 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F1: case WXK_F1:
OnZoom( ID_ZOOM_IN_KEY ); OnZoom( ID_ZOOM_IN_KEY );
flagcurseur = 2; flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case WXK_F2: case WXK_F2:
OnZoom( ID_ZOOM_OUT_KEY ); OnZoom( ID_ZOOM_OUT_KEY );
flagcurseur = 2; flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case WXK_F3: case WXK_F3:
...@@ -214,11 +213,11 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -214,11 +213,11 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F4: case WXK_F4:
OnZoom( ID_ZOOM_CENTER_KEY ); OnZoom( ID_ZOOM_CENTER_KEY );
flagcurseur = 2; flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case ' ': case ' ':
m_CurrentScreen->m_O_Curseur = m_CurrentScreen->m_Curseur; GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break; break;
case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */
...@@ -251,26 +250,26 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -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 */ /* Put cursor on grid */
PutOnGrid( &m_CurrentScreen->m_Curseur ); PutOnGrid( &GetScreen()->m_Curseur );
if( m_CurrentScreen->IsRefreshReq() ) if( GetScreen()->IsRefreshReq() )
{ {
flagcurseur = 2; flagcurseur = 2;
RedrawActiveWindow( DC, TRUE ); RedrawActiveWindow( DC, TRUE );
} }
if( (oldpos.x != m_CurrentScreen->m_Curseur.x) if( (oldpos.x != GetScreen()->m_Curseur.x)
|| (oldpos.y != m_CurrentScreen->m_Curseur.y) ) || (oldpos.y != GetScreen()->m_Curseur.y) )
{ {
if( flagcurseur != 2 ) if( flagcurseur != 2 )
{ {
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
m_CurrentScreen->m_Curseur = oldpos; GetScreen()->m_Curseur = oldpos;
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
m_CurrentScreen->m_Curseur = curpos; GetScreen()->m_Curseur = curpos;
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
} }
......
...@@ -479,7 +479,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -479,7 +479,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
DrawBlockStruct* PtBlock; DrawBlockStruct* PtBlock;
DrawPickedStruct* PickedList; DrawPickedStruct* PickedList;
BASE_SCREEN* screen = panel->m_Parent->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
PtBlock = &panel->GetScreen()->BlockLocate; PtBlock = &panel->GetScreen()->BlockLocate;
GRSetDrawMode( DC, g_XorMode ); GRSetDrawMode( DC, g_XorMode );
......
...@@ -435,7 +435,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -435,7 +435,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*/ */
{ {
DrawBlockStruct* PtBlock; DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
LibEDA_BaseStruct* item; LibEDA_BaseStruct* item;
wxPoint move_offset; wxPoint move_offset;
......
...@@ -370,7 +370,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -370,7 +370,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
*/ */
{ {
EDA_DrawLineStruct* CurrentLine = EDA_DrawLineStruct* CurrentLine =
(EDA_DrawLineStruct*) panel->m_Parent->GetScreen()->GetCurItem(); (EDA_DrawLineStruct*) panel->GetScreen()->GetCurItem();
EDA_DrawLineStruct* segment; EDA_DrawLineStruct* segment;
int color; int color;
...@@ -390,7 +390,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -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: */ if( g_HVLines ) /* Coerce the line to vertical or horizontal one: */
{ {
ComputeBreakPoint( CurrentLine, endpos ); ComputeBreakPoint( CurrentLine, endpos );
...@@ -463,11 +463,11 @@ static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool eras ...@@ -463,11 +463,11 @@ static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool eras
*/ */
{ {
DrawPolylineStruct* NewPoly = DrawPolylineStruct* NewPoly =
(DrawPolylineStruct*) panel->m_Parent->GetScreen()->GetCurItem(); (DrawPolylineStruct*) panel->GetScreen()->GetCurItem();
int color; int color;
wxPoint endpos; wxPoint endpos;
endpos = panel->m_Parent->GetScreen()->m_Curseur; endpos = panel->GetScreen()->m_Curseur;
color = ReturnLayerColor( NewPoly->GetLayer() ); color = ReturnLayerColor( NewPoly->GetLayer() );
GRSetDrawMode( DC, g_XorMode ); GRSetDrawMode( DC, g_XorMode );
......
...@@ -56,7 +56,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -56,7 +56,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* Dessin du Segment "BusEntry" lors des deplacements du curseur /* 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(); DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem();
if( BusEntry == NULL ) if( BusEntry == NULL )
......
...@@ -218,13 +218,13 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem ) ...@@ -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:*/ /* Placement en liste des structures si nouveau composant:*/
if( m_Flags & IS_NEW ) if( m_Flags & IS_NEW )
{ {
if( !( (WinEDA_SchematicFrame*) frame )->EditSheet( this, DC ) ) if( !frame->EditSheet( this, DC ) )
{ {
frame->GetScreen()->SetCurItem( NULL ); frame->GetScreen()->SetCurItem( NULL );
frame->DrawPanel->ManageCurseur = NULL; frame->DrawPanel->ManageCurseur = NULL;
......
...@@ -40,13 +40,13 @@ public: ...@@ -40,13 +40,13 @@ public:
Hierarchical_PIN_Sheet_Struct* Next() Hierarchical_PIN_Sheet_Struct* Next()
{ return (Hierarchical_PIN_Sheet_Struct*) Pnext; } { 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, void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
/** /**
* Function Save * 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. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
void Place( WinEDA_DrawFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy(); DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ); void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC );
......
...@@ -42,7 +42,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ) ...@@ -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. /* place the struct in EEDrawList.
...@@ -52,12 +52,12 @@ void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -52,12 +52,12 @@ void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
{ {
if( m_Flags & IS_NEW ) 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! if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
screen->AddToDrawList( this ); screen->AddToDrawList( this );
g_ItemToRepeat = this; g_ItemToRepeat = this;
if( frame->m_Ident == SCHEMATIC_FRAME ) if( frame->m_Ident == SCHEMATIC_FRAME )
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_NEW ); frame->SaveCopyInUndoList( this, IS_NEW );
} }
m_Flags = 0; m_Flags = 0;
......
...@@ -94,7 +94,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem ) ...@@ -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 */ /* save old text in undo list */
...@@ -104,7 +104,7 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -104,7 +104,7 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_TEXT*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (SCH_TEXT*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
......
...@@ -101,7 +101,7 @@ public: ...@@ -101,7 +101,7 @@ public:
void SwapData( SCH_TEXT* copyitem ); void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
/** /**
......
...@@ -418,7 +418,7 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem ) ...@@ -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 */ /* save old text in undo list */
...@@ -430,7 +430,7 @@ void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -430,7 +430,7 @@ void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
void PartTextCopy( PartTextStruct* target ); void PartTextCopy( PartTextStruct* target );
void Place( WinEDA_DrawFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
bool IsVoid(); bool IsVoid();
...@@ -164,7 +164,7 @@ public: ...@@ -164,7 +164,7 @@ public:
void SwapData( SCH_COMPONENT* copyitem ); 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. //returns a unique ID, in the form of a path.
......
...@@ -217,11 +217,11 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -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; wxSize delta;
SCH_SCREEN* screen = (SCH_SCREEN*)GetScreen(); SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom(); int zoom = screen->GetZoom();
wxPoint curpos, oldpos; wxPoint curpos, oldpos;
int hotkey = 0; int hotkey = 0;
...@@ -323,7 +323,7 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ...@@ -323,7 +323,7 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
curpos = screen->m_Curseur; curpos = screen->m_Curseur;
screen->m_Curseur = oldpos; screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = curpos; screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
......
This diff is collapsed.
...@@ -694,7 +694,7 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC ) ...@@ -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; int FieldNumber;
......
...@@ -179,7 +179,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ) ...@@ -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). /* Routine to create new text struct (GraphicText, label or Glabel).
...@@ -278,7 +278,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -278,7 +278,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/ /*************************************************************/
/* Abort function for the command move text */ /* 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(); SCH_ITEM* Struct = (SCH_ITEM*) screen->GetCurItem();
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
......
...@@ -142,7 +142,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask ...@@ -142,7 +142,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask
wxBeginBusyCursor(); wxBeginBusyCursor();
ActiveScreen = screen = m_Parent->GetScreen(); ActiveScreen = screen = m_Parent->GetBaseScreen();
RedrawStructList( this, DC, screen->EEDrawList, GR_COPY ); RedrawStructList( this, DC, screen->EEDrawList, GR_COPY );
if( Print_Sheet_Ref ) if( Print_Sheet_Ref )
......
...@@ -255,8 +255,9 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -255,8 +255,9 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
wxPoint move_vector; wxPoint move_vector;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
panel->m_Parent->GetScreen()->GetCurItem();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
/* Effacement du composant */ /* Effacement du composant */
if( erase ) if( erase )
...@@ -264,8 +265,8 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -264,8 +265,8 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 ); DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
} }
move_vector.x = panel->m_Parent->GetScreen()->m_Curseur.x - DrawLibItem->m_Pos.x; move_vector.x = screen->m_Curseur.x - DrawLibItem->m_Pos.x;
move_vector.y = panel->m_Parent->GetScreen()->m_Curseur.y - DrawLibItem->m_Pos.y; move_vector.y = screen->m_Curseur.y - DrawLibItem->m_Pos.y;
MoveOneStruct( DrawLibItem, move_vector ); MoveOneStruct( DrawLibItem, move_vector );
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 ); DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
...@@ -320,8 +321,9 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -320,8 +321,9 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant /* Routine de sortie de la fonction de placement de composant
*/ */
{ {
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) SCH_SCREEN* screen = (SCH_SCREEN*) Panel->GetScreen();
Panel->m_Parent->GetScreen()->GetCurItem();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */ 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 ) ...@@ -342,12 +344,11 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
DrawLibItem->m_Flags = 0; DrawLibItem->m_Flags = 0;
} }
D(printf("refresh\n");)
Panel->Refresh( TRUE ); Panel->Refresh( TRUE );
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
Panel->m_Parent->GetScreen()->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
......
...@@ -280,7 +280,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -280,7 +280,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
} }
...@@ -332,7 +332,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -332,7 +332,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_MIRROR_X_COMPONENT: // Mirror X (Component) case HK_MIRROR_X_COMPONENT: // Mirror X (Component)
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct ) if( DrawStruct )
{ {
if( DrawStruct->m_Flags == 0 ) if( DrawStruct->m_Flags == 0 )
...@@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_ORIENT_NORMAL_COMPONENT: // Orient 0, no mirror (Component) case HK_ORIENT_NORMAL_COMPONENT: // Orient 0, no mirror (Component)
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct ) if( DrawStruct )
{ {
if( DrawStruct->m_Flags == 0 ) if( DrawStruct->m_Flags == 0 )
...@@ -365,10 +365,10 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -365,10 +365,10 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit ) if( ItemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct && (DrawStruct->m_Flags ==0) ) 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 ); wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event ); wxPostEvent( this, event );
...@@ -378,7 +378,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -378,7 +378,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit ) if( ItemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct) if(DrawStruct)
{ {
EditComponentValue( EditComponentValue(
...@@ -390,7 +390,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -390,7 +390,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit ) if( ItemInEdit )
break; break;
if( DrawStruct == NULL ) if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct) if(DrawStruct)
{ {
EditComponentFootprint( EditComponentFootprint(
......
...@@ -35,10 +35,10 @@ static void ExitMoveField(WinEDA_DrawPanel * Panel, wxDC * DC) ...@@ -35,10 +35,10 @@ static void ExitMoveField(WinEDA_DrawPanel * Panel, wxDC * DC)
if(CurrentDrawItem == NULL) return; if(CurrentDrawItem == NULL) return;
wxPoint curpos; wxPoint curpos;
curpos = Panel->m_Parent->GetScreen()->m_Curseur; curpos = Panel->GetScreen()->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = StartCursor; Panel->GetScreen()->m_Curseur = StartCursor;
ShowMoveField(Panel, DC, TRUE); ShowMoveField(Panel, DC, TRUE);
Panel->m_Parent->GetScreen()->m_Curseur = curpos; Panel->GetScreen()->m_Curseur = curpos;
CurrentDrawItem->m_Flags = 0; CurrentDrawItem->m_Flags = 0;
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
......
...@@ -73,7 +73,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -73,7 +73,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon // Give an icon
SetIcon( wxIcon( libedit_xpm ) ); SetIcon( wxIcon( libedit_xpm ) );
m_CurrentScreen = ScreenLib; SetBaseScreen( ScreenLib );
GetSettings(); 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 );
if( DrawPanel ) if( DrawPanel )
...@@ -90,7 +90,6 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame() ...@@ -90,7 +90,6 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
/**********************************************/ /**********************************************/
{ {
m_Parent->m_LibeditFrame = NULL; m_Parent->m_LibeditFrame = NULL;
//m_CurrentScreen = ScreenSch; humm, is this needed?
} }
...@@ -118,7 +117,8 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -118,7 +117,8 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
msg.Printf( _( "Library \"%s\" was modified!\nDiscard changes?" ), Lib->m_Name.GetData() ); msg.Printf( _( "Library \"%s\" was modified!\nDiscard changes?" ), Lib->m_Name.GetData() );
if( !IsOK( this, msg ) ) if( !IsOK( this, msg ) )
{ {
Event.Veto(); return; Event.Veto();
return;
} }
} }
} }
......
...@@ -157,7 +157,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -157,7 +157,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_NOCONNECT_STRUCT_TYPE: case DRAW_NOCONNECT_STRUCT_TYPE:
// if( !flags ) PopMenu->Append(ID_POPUP_SCH_MOVE_ITEM_REQUEST, "Move noconnect"); // 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; break;
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
...@@ -167,17 +167,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -167,17 +167,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
if( !flags ) if( !flags )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST, ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move bus entry" ), move_xpm ); _( "Move Bus Entry" ), move_xpm );
if( GetBusEntryShape( (DrawBusEntryStruct*) DrawStruct ) == '\\' ) 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 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, ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "delete bus entry" ), delete_bus_xpm ); _( "Delete Bus Entry" ), delete_bus_xpm );
break; break;
case DRAW_MARKER_STRUCT_TYPE: 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; break;
case TYPE_SCH_TEXT: case TYPE_SCH_TEXT:
...@@ -230,9 +230,9 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -230,9 +230,9 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
default: default:
if( is_new ) 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, ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "Delete drawing" ), delete_xpm ); _( "Delete Drawing" ), delete_xpm );
break; break;
} }
...@@ -417,7 +417,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel ) ...@@ -417,7 +417,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT, ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm ); _( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL, 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, ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm ); ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
} }
...@@ -444,7 +444,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label ) ...@@ -444,7 +444,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT, ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), label2text_xpm ); _( "Change to Text" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL, 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, ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm ); ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
} }
...@@ -494,14 +494,14 @@ void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, ...@@ -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_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(), if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM ) ) 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, _( 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, ...@@ -525,9 +525,9 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
if( is_new ) if( is_new )
return; 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, _( 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(), if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) ) WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) )
...@@ -535,13 +535,13 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire, ...@@ -535,13 +535,13 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_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 ); 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: // 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) 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 ) ) || ( 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, ...@@ -567,13 +567,13 @@ void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
_( "Break Bus" ), break_bus_xpm ); _( "Break Bus" ), break_bus_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_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 ); 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: // 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) 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 ) ) || ( 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 ) ...@@ -645,14 +645,14 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
{ {
wxMenu* menu_other_block_commands = new wxMenu; wxMenu* menu_other_block_commands = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_other_block_commands, 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, wxID_COPY, _( "Save Block" ), copy_button );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_COPY_BLOCK, ADD_MENUITEM( menu_other_block_commands, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ), copyblock_xpm ); _( "Copy Block (shift + drag mouse)" ), copyblock_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DRAG_BLOCK, ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DRAG_BLOCK,
_( "Drag Block (ctrl + drag mouse)" ), move_xpm ); _( "Drag Block (ctrl + drag mouse)" ), move_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DELETE_BLOCK, 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, _( ADD_MENUITEM( menu_other_block_commands, ID_POPUP_MIRROR_Y_BLOCK, _(
"Mirror Block ||" ), mirror_H_xpm ); "Mirror Block ||" ), mirror_H_xpm );
#if 0 #if 0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -151,10 +151,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -151,10 +151,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
#endif #endif
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
/* Get config */ /* Get config */
GetSettings(); GetSettings();
g_DrawMinimunLineWidth = g_DrawMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 ); m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 );
g_PlotPSMinimunLineWidth = g_PlotPSMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 ); m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 );
...@@ -183,6 +186,12 @@ WinEDA_SchematicFrame::~WinEDA_SchematicFrame() ...@@ -183,6 +186,12 @@ WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
} }
BASE_SCREEN* WinEDA_SchematicFrame::GetBaseScreen() const
{
return GetScreen();
}
/***************/ /***************/
/* utility functions */ /* utility functions */
/***************/ /***************/
...@@ -192,7 +201,7 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet() ...@@ -192,7 +201,7 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet()
} }
BASE_SCREEN* WinEDA_SchematicFrame::GetScreen() SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
{ {
return m_CurrentSheet->LastScreen(); return m_CurrentSheet->LastScreen();
} }
......
...@@ -468,7 +468,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -468,7 +468,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
wxPoint move_vector; wxPoint move_vector;
Hierarchical_PIN_Sheet_Struct* SheetLabel; Hierarchical_PIN_Sheet_Struct* SheetLabel;
BASE_SCREEN* screen = panel->m_Parent->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*) DrawSheetStruct* Sheet = (DrawSheetStruct*)
screen->GetCurItem(); screen->GetCurItem();
...@@ -479,10 +479,8 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -479,10 +479,8 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( Sheet->m_Flags & IS_RESIZED ) if( Sheet->m_Flags & IS_RESIZED )
{ {
Sheet->m_Size.x = MAX( s_SheetMindx, Sheet->m_Size.x = MAX( s_SheetMindx, screen->m_Curseur.x - Sheet->m_Pos.x );
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.y = MAX( s_SheetMindy,
screen->m_Curseur.y - Sheet->m_Pos.y );
SheetLabel = Sheet->m_Label; SheetLabel = Sheet->m_Label;
while( SheetLabel ) while( SheetLabel )
{ {
...@@ -507,7 +505,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -507,7 +505,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/****************************************/ /****************************************/
static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC ) 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(); DrawSheetStruct* Sheet = (DrawSheetStruct*) Screen->GetCurItem();
if( Sheet == NULL ) if( Sheet == NULL )
...@@ -530,7 +528,7 @@ static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -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 */ else if( Sheet->m_Flags & IS_MOVED ) /* move en cours: on l'annule */
{ {
wxPoint curspos = Screen->m_Curseur; wxPoint curspos = Screen->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = s_OldPos; Panel->GetScreen()->m_Curseur = s_OldPos;
DeplaceSheet( Panel, DC, TRUE ); DeplaceSheet( Panel, DC, TRUE );
RedrawOneStruct( Panel, DC, Sheet, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( Panel, DC, Sheet, GR_DEFAULT_DRAWMODE );
Sheet->m_Flags = 0; Sheet->m_Flags = 0;
......
...@@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
* de deplacement * de deplacement
* Si le NetSheet est nouveau, il est pointe par NewSheetLabel * 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; DrawSheetStruct* Sheet = (DrawSheetStruct*) m_Parent;
...@@ -237,7 +237,7 @@ void WinEDA_SchematicFrame::StartMove_PinSheet( Hierarchical_PIN_Sheet_Struct* S ...@@ -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 ) static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
Hierarchical_PIN_Sheet_Struct* SheetLabel = (Hierarchical_PIN_Sheet_Struct*) Hierarchical_PIN_Sheet_Struct* SheetLabel = (Hierarchical_PIN_Sheet_Struct*)
panel->m_Parent->GetScreen()->GetCurItem(); panel->GetScreen()->GetCurItem();
if( SheetLabel == NULL ) if( SheetLabel == NULL )
return; return;
...@@ -251,13 +251,13 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -251,13 +251,13 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
SheetLabel->m_Edge = 0; SheetLabel->m_Edge = 0;
SheetLabel->m_Pos.x = Sheet->m_Pos.x; 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_Edge = 1;
SheetLabel->m_Pos.x = Sheet->m_Pos.x + Sheet->m_Size.x; 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 ) if( SheetLabel->m_Pos.y < Sheet->m_Pos.y )
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) ) if( SheetLabel->m_Pos.y > (Sheet->m_Pos.y + Sheet->m_Size.y) )
......
...@@ -383,7 +383,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -383,7 +383,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
/* Redraw the graphoc shape while moving /* Redraw the graphoc shape while moving
*/ */
{ {
BASE_SCREEN* Screen = panel->m_Parent->GetScreen(); BASE_SCREEN* Screen = panel->GetScreen();
int mx, my; int mx, my;
/* Erase shape in the old positon*/ /* Erase shape in the old positon*/
...@@ -529,7 +529,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -529,7 +529,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
int DrawMode = g_XorMode; int DrawMode = g_XorMode;
int* ptpoly; int* ptpoly;
int dx, dy; int dx, dy;
BASE_SCREEN* Screen = panel->m_Parent->GetScreen(); BASE_SCREEN* Screen = panel->GetScreen();
int mx = Screen->m_Curseur.x, int mx = Screen->m_Curseur.x,
my = Screen->m_Curseur.y; my = Screen->m_Curseur.y;
......
...@@ -69,7 +69,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -69,7 +69,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
if( m_Semaphore ) if( m_Semaphore )
SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP ); SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
m_CurrentScreen = new SCH_SCREEN( VIEWER_FRAME ); SetBaseScreen( new SCH_SCREEN( VIEWER_FRAME ) );
GetScreen()->SetZoom( 16 ); GetScreen()->SetZoom( 16 );
if( Library == NULL ) if( Library == NULL )
...@@ -110,7 +110,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -110,7 +110,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame() WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
{ {
SAFE_DELETE( m_CurrentScreen ); delete GetScreen();
SetBaseScreen( 0 );
m_Parent->m_ViewlibFrame = NULL; m_Parent->m_ViewlibFrame = NULL;
} }
......
...@@ -239,7 +239,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -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.x = screen->m_Curseur.x - screen->BlockLocate.GetRight();
screen->BlockLocate.m_MoveVector.y = screen->m_Curseur.y - screen->BlockLocate.GetBottom(); screen->BlockLocate.m_MoveVector.y = screen->m_Curseur.y - screen->BlockLocate.GetBottom();
......
...@@ -22,8 +22,9 @@ ...@@ -22,8 +22,9 @@
/**********************************************************************/ /**********************************************************************/
EDA_BaseStruct* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() { BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay()
/**********************************************************************/ /**********************************************************************/
{
return Locate( CURSEUR_OFF_GRILLE ); return Locate( CURSEUR_OFF_GRILLE );
} }
...@@ -72,22 +73,22 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -72,22 +73,22 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{ {
case EDA_PANNING_UP_KEY: case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP ); OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case EDA_PANNING_DOWN_KEY: case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN ); OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case EDA_PANNING_LEFT_KEY: case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT ); OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case EDA_PANNING_RIGHT_KEY: case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT ); OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = m_CurrentScreen->m_Curseur; curpos = GetScreen()->m_Curseur;
break; break;
case EDA_ZOOM_IN_FROM_MOUSE: case EDA_ZOOM_IN_FROM_MOUSE:
......
This diff is collapsed.
...@@ -23,7 +23,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -23,7 +23,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
* quand un outil est deja selectionn� * quand un outil est deja selectionn�
*/ */
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; wxString msg;
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
...@@ -84,7 +84,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -84,7 +84,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
*/ */
{ {
int id = event.GetId(); 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]; GERBER_Descr* gerber_layer = g_GERBER_Descr_List[layer];
wxPoint pos; wxPoint pos;
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
...@@ -114,11 +114,11 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -114,11 +114,11 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
} }
/* ne devrait pas etre execute, sauf bug */ /* 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; GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
m_CurrentScreen->BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->BlockLocate.m_State = STATE_NO_BLOCK;
m_CurrentScreen->BlockLocate.m_BlockDrawStruct = NULL; GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
} }
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
...@@ -267,21 +267,21 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -267,21 +267,21 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY; GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
m_CurrentScreen->BlockLocate.SetMessageBlock( this ); GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
case ID_POPUP_ZOOM_BLOCK: case ID_POPUP_ZOOM_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM; GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM;
m_CurrentScreen->BlockLocate.SetMessageBlock( this ); GetScreen()->BlockLocate.SetMessageBlock( this );
m_CurrentScreen->BlockLocate.SetMessageBlock( this ); GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
case ID_POPUP_DELETE_BLOCK: case ID_POPUP_DELETE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_DELETE; GetScreen()->BlockLocate.m_Command = BLOCK_DELETE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this ); GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
......
...@@ -41,10 +41,13 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) ...@@ -41,10 +41,13 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
case ID_MENU_INC_LAYER_AND_APPEND_FILE: case ID_MENU_INC_LAYER_AND_APPEND_FILE:
case ID_INC_LAYER_AND_APPEND_FILE: case ID_INC_LAYER_AND_APPEND_FILE:
{ {
int layer = GetPCBScreen()->m_Active_Layer; int origLayer = GetScreen()->m_Active_Layer;
((PCB_SCREEN*)GetScreen())->m_Active_Layer++;
GetScreen()->m_Active_Layer++;
if( !LoadOneGerberFile( wxEmptyString, &dc, 0 ) ) if( !LoadOneGerberFile( wxEmptyString, &dc, 0 ) )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = layer; GetScreen()->m_Active_Layer = origLayer;
SetToolbars(); SetToolbars();
} }
break; break;
......
This diff is collapsed.
...@@ -74,8 +74,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -74,8 +74,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
m_Pcb->m_NbSegmZone = 0; m_Pcb->m_NbSegmZone = 0;
/* Init parametres de gestion des ecrans PAD et PCB */ /* Init parametres de gestion des ecrans PAD et PCB */
m_CurrentScreen = ActiveScreen = ScreenPcb; SetBaseScreen( ActiveScreen = ScreenPcb );
GetPCBScreen()->Init(); GetScreen()->Init();
return TRUE; return TRUE;
} }
...@@ -104,7 +104,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query ) ...@@ -104,7 +104,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
{ {
BOARD_ITEM* PtStruct; BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext; BOARD_ITEM* PtNext;
int layer = GetPCBScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
if( all_layers ) if( all_layers )
layer = -1; layer = -1;
...@@ -189,7 +189,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query ) ...@@ -189,7 +189,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
void WinEDA_GerberFrame::Erase_Current_Layer( bool query ) void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/*********************************************************/ /*********************************************************/
{ {
int layer = GetPCBScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
wxString msg; wxString msg;
msg.Printf( _( "Delete Layer %d" ), layer + 1 ); msg.Printf( _( "Delete Layer %d" ), layer + 1 );
......
...@@ -34,7 +34,7 @@ static int distance( int seuil ); ...@@ -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 /* Fonction de localisation generale
...@@ -48,7 +48,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc ) ...@@ -48,7 +48,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
int layer; int layer;
/* Localistion des pistes et vias, avec priorite aux vias */ /* 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 ); Track = Locate_Pistes( m_Pcb->m_Track, -1, typeloc );
if( Track != NULL ) if( Track != NULL )
{ {
...@@ -80,7 +80,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc ) ...@@ -80,7 +80,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
} }
if( ( TrackLocate = Locate_Zone( (TRACK*) m_Pcb->m_Zone, 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 ); TrackLocate->Display_Infos( this );
return TrackLocate; return TrackLocate;
......
...@@ -20,9 +20,9 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -20,9 +20,9 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
* The menu already has a list of zoom commands. * The menu already has a list of zoom commands.
*/ */
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; 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 DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu
......
...@@ -126,7 +126,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -126,7 +126,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
wxPoint pos; wxPoint pos;
int error = 0; int error = 0;
layer = GetPCBScreen()->m_Active_Layer; layer = GetScreen()->m_Active_Layer;
if( g_GERBER_Descr_List[layer] == NULL ) if( g_GERBER_Descr_List[layer] == NULL )
{ {
......
...@@ -107,7 +107,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool, ...@@ -107,7 +107,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool,
track->Insert( frame->m_Pcb, NULL ); 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_Width = diametre;
track->m_Start = track->m_End = pos; track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y ); NEGATE( track->m_Start.y );
...@@ -140,7 +140,7 @@ static void Append_1_Flash_GERBER( int Dcode_index, ...@@ -140,7 +140,7 @@ static void Append_1_Flash_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL ); 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_Width = width;
track->m_Start = track->m_End = pos; track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y ); NEGATE( track->m_Start.y );
...@@ -181,7 +181,7 @@ static void Append_1_Line_GERBER( int Dcode_index, ...@@ -181,7 +181,7 @@ static void Append_1_Line_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL ); 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_Width = largeur;
track->m_Start = startpoint; track->m_Start = startpoint;
NEGATE( track->m_Start.y ); NEGATE( track->m_Start.y );
...@@ -220,7 +220,7 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index, ...@@ -220,7 +220,7 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL ); track->Insert( frame->m_Pcb, NULL );
track->m_Shape = S_ARC; track->m_Shape = S_ARC;
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer ); track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = largeur; track->m_Width = largeur;
if( multiquadrant ) if( multiquadrant )
...@@ -741,7 +741,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -741,7 +741,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
edge_poly->Insert( frame->m_Pcb, last ); 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_Width = 1;
edge_poly->m_Start = m_PreviousPos; edge_poly->m_Start = m_PreviousPos;
NEGATE( edge_poly->m_Start.y ); NEGATE( edge_poly->m_Start.y );
......
...@@ -200,7 +200,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -200,7 +200,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
if( GetScreen() ) if( GetScreen() )
{ {
layer = GetPCBScreen()->m_Active_Layer; layer = GetScreen()->m_Active_Layer;
gerber_layer = g_GERBER_Descr_List[layer]; gerber_layer = g_GERBER_Descr_List[layer];
} }
...@@ -313,7 +313,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -313,7 +313,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
m_SelLayerBox = new WinEDAChoiceBox( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER, m_SelLayerBox = new WinEDAChoiceBox( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER,
wxDefaultPosition, wxSize( 150, -1 ), choices ); 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->AddControl( m_SelLayerBox );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -26,6 +26,21 @@ public: ...@@ -26,6 +26,21 @@ public:
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE ); SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN(); ~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 virtual wxString GetClass() const
{ {
return wxT( "SCH_SCREEN" ); return wxT( "SCH_SCREEN" );
...@@ -34,7 +49,8 @@ public: ...@@ -34,7 +49,8 @@ public:
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies) 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. */ void RemoveFromDrawList( SCH_ITEM* DrawStruct ); /* remove DrawStruct from EEDrawList. */
bool CheckIfOnDrawList( SCH_ITEM* st ); bool CheckIfOnDrawList( SCH_ITEM* st );
void AddToDrawList( SCH_ITEM* DrawStruct ); void AddToDrawList( SCH_ITEM* DrawStruct );
......
...@@ -23,7 +23,7 @@ class SCH_ITEM; ...@@ -23,7 +23,7 @@ class SCH_ITEM;
/* classe representant un ecran graphique de dessin */ /* classe representant un ecran graphique de dessin */
/****************************************************/ /****************************************************/
class WinEDA_DrawPanel : public EDA_DRAW_PANEL class WinEDA_DrawPanel : public wxScrolledWindow
{ {
public: public:
int m_Ident; int m_Ident;
...@@ -59,8 +59,10 @@ public: ...@@ -59,8 +59,10 @@ public:
// Constructor and destructor // Constructor and destructor
WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, const wxSize& size ); WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, const wxSize& size );
~WinEDA_DrawPanel() { } ~WinEDA_DrawPanel() { }
/****************************/ /****************************/
virtual BASE_SCREEN* GetScreen() { return m_Parent->GetScreen(); } BASE_SCREEN* GetScreen();
void PrepareGraphicContext( wxDC* DC ); void PrepareGraphicContext( wxDC* DC );
wxPoint CalcAbsolutePosition( const wxPoint& rel_pos ); wxPoint CalcAbsolutePosition( const wxPoint& rel_pos );
...@@ -140,6 +142,7 @@ public: ...@@ -140,6 +142,7 @@ public:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/**************************/ /**************************/
/* class DrawBlockStruct */ /* class DrawBlockStruct */
/**************************/ /**************************/
...@@ -264,6 +267,14 @@ public: ...@@ -264,6 +267,14 @@ public:
BASE_SCREEN( int idscreen, KICAD_T aType = SCREEN_STRUCT_TYPE ); BASE_SCREEN( int idscreen, KICAD_T aType = SCREEN_STRUCT_TYPE );
~BASE_SCREEN(); ~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 */ void InitDatas(); /* Inits completes des variables */
wxSize ReturnPageSize(); wxSize ReturnPageSize();
int GetInternalUnits(); int GetInternalUnits();
...@@ -289,15 +300,6 @@ public: ...@@ -289,15 +300,6 @@ public:
int IsSave() { return m_FlagSave & 1; } 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>---------------------------------------------------------- //----<zoom stuff>----------------------------------------------------------
/** /**
* Function GetZoom * Function GetZoom
......
...@@ -236,6 +236,14 @@ public: ...@@ -236,6 +236,14 @@ public:
*/ */
BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); } 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 /* Return true if a microvia can be put on board
* A microvia ia a small via restricted to 2 near neighbour layers * 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 * because its is hole is made by laser which can penetrate only one layer
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
/* fonction de placement */ /* fonction de placement */
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); virtual void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
/** /**
* Function Save * Function Save
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
public: public:
DrawPickedStruct( SCH_ITEM * pickedstruct = NULL ); DrawPickedStruct( SCH_ITEM * pickedstruct = NULL );
~DrawPickedStruct(); ~DrawPickedStruct();
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { }; void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void DeleteWrapperList(); void DeleteWrapperList();
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; } DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
......
...@@ -28,6 +28,7 @@ enum fl_rot_cmp { ...@@ -28,6 +28,7 @@ enum fl_rot_cmp {
CMP_MIROIR_Y = 0x200 // miroir selon axe Y CMP_MIROIR_Y = 0x200 // miroir selon axe Y
}; };
class WinEDA_SchematicFrame : public WinEDA_DrawFrame class WinEDA_SchematicFrame : public WinEDA_DrawFrame
{ {
public: public:
...@@ -47,6 +48,9 @@ public: ...@@ -47,6 +48,9 @@ public:
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
void Save_Config( wxWindow* displayframe ); void Save_Config( wxWindow* displayframe );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
...@@ -62,7 +66,11 @@ public: ...@@ -62,7 +66,11 @@ public:
EDA_BaseStruct* DrawStruct ); EDA_BaseStruct* DrawStruct );
DrawSheetPath* GetSheet(); DrawSheetPath* GetSheet();
virtual BASE_SCREEN* GetScreen();
SCH_SCREEN* GetScreen() const;
BASE_SCREEN* GetBaseScreen() const;
virtual void SetScreen( SCH_SCREEN* screen ); virtual void SetScreen( SCH_SCREEN* screen );
virtual wxString GetScreenDesc(); virtual wxString GetScreenDesc();
...@@ -161,7 +169,7 @@ private: ...@@ -161,7 +169,7 @@ private:
bool PutInUndoList = FALSE ); bool PutInUndoList = FALSE );
// Text ,label, glabel // 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 EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ); void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ); void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
...@@ -296,7 +304,7 @@ public: ...@@ -296,7 +304,7 @@ public:
void SetToolbars(); void SetToolbars();
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); 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 ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
private: private:
...@@ -406,7 +414,7 @@ public: ...@@ -406,7 +414,7 @@ public:
void ClickOnLibList( wxCommandEvent& event ); void ClickOnLibList( wxCommandEvent& event );
void ClickOnCmpList( wxCommandEvent& event ); void ClickOnCmpList( wxCommandEvent& event );
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
private: private:
void SelectCurrentLibrary(); void SelectCurrentLibrary();
......
...@@ -82,6 +82,7 @@ public: ...@@ -82,6 +82,7 @@ public:
*/ */
void SetBOARD( BOARD* aBoard ); void SetBOARD( BOARD* aBoard );
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
...@@ -93,7 +94,10 @@ public: ...@@ -93,7 +94,10 @@ public:
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar(); 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(); int BestZoom();
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
...@@ -740,10 +744,9 @@ public: ...@@ -740,10 +744,9 @@ public:
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
PCB_SCREEN* GetPCBScreen(){ return (PCB_SCREEN*)GetScreen(); }
EDA_BaseStruct* GerberGeneralLocateAndDisplay(); BOARD_ITEM* GerberGeneralLocateAndDisplay();
EDA_BaseStruct* Locate( int typeloc ); BOARD_ITEM* Locate( int typeloc );
void SetToolbars(); void SetToolbars();
......
This diff is collapsed.
This diff is collapsed.
...@@ -118,7 +118,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ...@@ -118,7 +118,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
lay_tmp_TOP = Route_Layer_TOP; lay_tmp_TOP = Route_Layer_TOP;
OldPasRoute = g_GridRoutingSize; OldPasRoute = g_GridRoutingSize;
g_GridRoutingSize = m_CurrentScreen->GetGrid().x; g_GridRoutingSize = GetScreen()->GetGrid().x;
// Ensure g_GridRoutingSize has a reasonnable value: // Ensure g_GridRoutingSize has a reasonnable value:
if( g_GridRoutingSize < 10 ) if( g_GridRoutingSize < 10 )
...@@ -282,10 +282,10 @@ end_of_tst: ...@@ -282,10 +282,10 @@ end_of_tst:
break; break;
/* placement du module */ /* placement du module */
CurrPosition = m_CurrentScreen->m_Curseur; CurrPosition = GetScreen()->m_Curseur;
m_CurrentScreen->m_Curseur = PosOK; GetScreen()->m_Curseur = PosOK;
Place_Module( Module, DC ); Place_Module( Module, DC );
m_CurrentScreen->m_Curseur = CurrPosition; GetScreen()->m_Curseur = CurrPosition;
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit(); Module->SetRectangleExinscrit();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment