Commit 721d878f authored by dickelbeck's avatar dickelbeck

GetScreen() work, menu capitalization, beautifying

parent 25d04032
...@@ -5,16 +5,31 @@ Started 2007-June-11 ...@@ -5,16 +5,31 @@ 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>
......
...@@ -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 );
......
...@@ -50,7 +50,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent, ...@@ -50,7 +50,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent,
/* Mark items inside rect. /* Mark items inside rect.
* Items are inside rect when an end point is inside rect * Items are inside rect when an end point is inside rect
* *
* Rules for convert drawings and other parts ( for multi part per package): * Rules for convert drawings and other parts ( for multi part per package):
* - Commons are always marked * - Commons are always marked
* - Specific graphic shapes must agree with the current displayed part and convert * - Specific graphic shapes must agree with the current displayed part and convert
...@@ -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;
...@@ -594,7 +594,7 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset ) ...@@ -594,7 +594,7 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
( (LibDrawText*) item )->m_Pos.x += offset.x; ( (LibDrawText*) item )->m_Pos.x += offset.x;
( (LibDrawText*) item )->m_Pos.y += offset.y; ( (LibDrawText*) item )->m_Pos.y += offset.y;
break; break;
default: default:
; ;
} }
...@@ -704,7 +704,7 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset ) ...@@ -704,7 +704,7 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
SETMIRROR( ( (LibDrawText*) item )->m_Pos.x ); SETMIRROR( ( (LibDrawText*) item )->m_Pos.x );
break; break;
default: default:
; ;
} }
......
...@@ -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();
...@@ -136,13 +136,13 @@ public: ...@@ -136,13 +136,13 @@ public:
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
SCH_COMPONENT* GenCopy(); SCH_COMPONENT* GenCopy();
void SetRotationMiroir( int type ); void SetRotationMiroir( int type );
int GetRotationMiroir(); int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord ); wxPoint GetScreenCoord( const wxPoint& coord );
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
void ClearAnnotation(); void ClearAnnotation();
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
const wxString& ReturnFieldName( int aFieldNdx ) const; const wxString& ReturnFieldName( int aFieldNdx ) const;
...@@ -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,14 +217,14 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -217,14 +217,14 @@ 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;
curpos = screen->m_MousePosition; curpos = screen->m_MousePosition;
oldpos = screen->m_Curseur; oldpos = screen->m_Curseur;
...@@ -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,8 +278,8 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -278,8 +278,8 @@ 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;
Panel->ManageCurseur = NULL; Panel->ManageCurseur = 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(
......
This diff is collapsed.
...@@ -64,7 +64,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -64,7 +64,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style ) : long style ) :
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, parent, title, pos, size, style ) WinEDA_DrawFrame( father, LIBEDITOR_FRAME, parent, title, pos, size, style )
{ {
m_FrameName = wxT( "LibeditFrame" ); m_FrameName = wxT( "LibeditFrame" );
...@@ -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?
} }
...@@ -100,14 +99,14 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -100,14 +99,14 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
{ {
LibraryStruct* Lib; LibraryStruct* Lib;
if( GetScreen()->IsModify() ) if( GetScreen()->IsModify() )
{ {
if( !IsOK( this, _( "Component was modified!\nDiscard changes?" ) ) ) if( !IsOK( this, _( "Component was modified!\nDiscard changes?" ) ) )
{ {
Event.Veto(); return; Event.Veto(); return;
} }
else else
GetScreen()->ClrModify(); GetScreen()->ClrModify();
} }
for( Lib = g_LibraryList; Lib != NULL; Lib = Lib->m_Pnext ) for( Lib = g_LibraryList; Lib != NULL; Lib = Lib->m_Pnext )
...@@ -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;
} }
} }
} }
...@@ -261,8 +261,8 @@ int WinEDA_LibeditFrame::BestZoom() ...@@ -261,8 +261,8 @@ int WinEDA_LibeditFrame::BestZoom()
} }
else else
{ {
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x; dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y; dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
} }
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
...@@ -275,12 +275,12 @@ int WinEDA_LibeditFrame::BestZoom() ...@@ -275,12 +275,12 @@ int WinEDA_LibeditFrame::BestZoom()
if( CurrentLibEntry ) if( CurrentLibEntry )
{ {
GetScreen()->m_Curseur = BoundaryBox.Centre(); GetScreen()->m_Curseur = BoundaryBox.Centre();
} }
else else
{ {
GetScreen()->m_Curseur.x = 0; GetScreen()->m_Curseur.x = 0;
GetScreen()->m_Curseur.y = 0; GetScreen()->m_Curseur.y = 0;
} }
return bestzoom; return bestzoom;
...@@ -339,7 +339,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -339,7 +339,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_LIBEDIT_SAVE_CURRENT_LIB: case ID_LIBEDIT_SAVE_CURRENT_LIB:
if( GetScreen()->IsModify() ) if( GetScreen()->IsModify() )
{ {
if( IsOK( this, _( "Include last component changes?" ) ) ) if( IsOK( this, _( "Include last component changes?" ) ) )
SaveOnePartInMemory(); SaveOnePartInMemory();
...@@ -608,7 +608,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -608,7 +608,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
} }
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->CursorOn( &dc ); DrawPanel->CursorOn( &dc );
break; break;
...@@ -656,7 +656,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -656,7 +656,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
EditField( &dc, (LibDrawField*) CurrentDrawItem ); EditField( &dc, (LibDrawField*) CurrentDrawItem );
} }
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc ); DrawPanel->CursorOn( &dc );
break; break;
......
...@@ -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();
} }
...@@ -399,17 +408,17 @@ int WinEDA_SchematicFrame::BestZoom() ...@@ -399,17 +408,17 @@ int WinEDA_SchematicFrame::BestZoom()
int bestzoom; int bestzoom;
wxSize size; wxSize size;
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x; dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y; dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
ii = dx / size.x; ii = dx / size.x;
jj = dy / size.y; jj = dy / size.y;
bestzoom = MAX( ii, jj ) + 1; bestzoom = MAX( ii, jj ) + 1;
GetScreen()->SetZoom( ii ); GetScreen()->SetZoom( ii );
GetScreen()->m_Curseur.x = dx / 2; GetScreen()->m_Curseur.x = dx / 2;
GetScreen()->m_Curseur.y = dy / 2; GetScreen()->m_Curseur.y = dy / 2;
return bestzoom; return bestzoom;
} }
......
...@@ -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) )
......
...@@ -100,7 +100,7 @@ bodygraphics_PropertiesAccept( wxCommandEvent& event ) ...@@ -100,7 +100,7 @@ bodygraphics_PropertiesAccept( wxCommandEvent& event )
} }
CurrentLibEntry->SortDrawItems(); CurrentLibEntry->SortDrawItems();
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, 0, 0, DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode ); CurrentDrawItem, CurrentUnit, g_XorMode );
...@@ -150,7 +150,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -150,7 +150,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
else else
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, 0, 0, DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode ); CurrentDrawItem, CurrentUnit, g_XorMode );
SAFE_DELETE( CurrentDrawItem ); SAFE_DELETE( CurrentDrawItem );
} }
else else
{ {
...@@ -224,8 +224,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -224,8 +224,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawArc* Arc = new LibDrawArc(); LibDrawArc* Arc = new LibDrawArc();
CurrentDrawItem = Arc; CurrentDrawItem = Arc;
ArcStartX = ArcEndX = GetScreen()->m_Curseur.x; ArcStartX = ArcEndX = GetScreen()->m_Curseur.x;
ArcStartY = ArcEndY = -( GetScreen()->m_Curseur.y ); ArcStartY = ArcEndY = -( GetScreen()->m_Curseur.y );
StateDrawArc = 1; StateDrawArc = 1;
Arc->m_Fill = FlSymbol_Fill; Arc->m_Fill = FlSymbol_Fill;
Arc->m_Width = g_LibSymbolDefaultLineWidth; Arc->m_Width = g_LibSymbolDefaultLineWidth;
...@@ -237,8 +237,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -237,8 +237,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawCircle* Circle = new LibDrawCircle(); LibDrawCircle* Circle = new LibDrawCircle();
CurrentDrawItem = Circle; CurrentDrawItem = Circle;
Circle->m_Pos.x = GetScreen()->m_Curseur.x; Circle->m_Pos.x = GetScreen()->m_Curseur.x;
Circle->m_Pos.y = -( GetScreen()->m_Curseur.y ); Circle->m_Pos.y = -( GetScreen()->m_Curseur.y );
Circle->m_Fill = FlSymbol_Fill; Circle->m_Fill = FlSymbol_Fill;
Circle->m_Width = g_LibSymbolDefaultLineWidth; Circle->m_Width = g_LibSymbolDefaultLineWidth;
} }
...@@ -249,8 +249,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -249,8 +249,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawSquare* Square = new LibDrawSquare(); LibDrawSquare* Square = new LibDrawSquare();
CurrentDrawItem = Square; CurrentDrawItem = Square;
Square->m_Pos.x = GetScreen()->m_Curseur.x; Square->m_Pos.x = GetScreen()->m_Curseur.x;
Square->m_Pos.y = -( GetScreen()->m_Curseur.y ); Square->m_Pos.y = -( GetScreen()->m_Curseur.y );
Square->m_End = Square->m_Pos; Square->m_End = Square->m_Pos;
Square->m_Fill = FlSymbol_Fill; Square->m_Fill = FlSymbol_Fill;
Square->m_Width = g_LibSymbolDefaultLineWidth; Square->m_Width = g_LibSymbolDefaultLineWidth;
...@@ -265,8 +265,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -265,8 +265,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
polyline->n = 2; polyline->n = 2;
ptpoly = (int*) MyZMalloc( 4 * sizeof(int) ); ptpoly = (int*) MyZMalloc( 4 * sizeof(int) );
polyline->PolyList = ptpoly; polyline->PolyList = ptpoly;
ptpoly[0] = ptpoly[2] = GetScreen()->m_Curseur.x; ptpoly[0] = ptpoly[2] = GetScreen()->m_Curseur.x;
ptpoly[1] = ptpoly[3] = -( GetScreen()->m_Curseur.y ); ptpoly[1] = ptpoly[3] = -( GetScreen()->m_Curseur.y );
polyline->m_Fill = FlSymbol_Fill; polyline->m_Fill = FlSymbol_Fill;
polyline->m_Width = g_LibSymbolDefaultLineWidth; polyline->m_Width = g_LibSymbolDefaultLineWidth;
} }
...@@ -277,8 +277,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -277,8 +277,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawSegment* Segment = new LibDrawSegment(); LibDrawSegment* Segment = new LibDrawSegment();
CurrentDrawItem = Segment; CurrentDrawItem = Segment;
Segment->m_Pos.x = GetScreen()->m_Curseur.x; Segment->m_Pos.x = GetScreen()->m_Curseur.x;
Segment->m_Pos.y = -( GetScreen()->m_Curseur.y ); Segment->m_Pos.y = -( GetScreen()->m_Curseur.y );
Segment->m_End = Segment->m_Pos; Segment->m_End = Segment->m_Pos;
Segment->m_Width = g_LibSymbolDefaultLineWidth; Segment->m_Width = g_LibSymbolDefaultLineWidth;
} }
...@@ -291,12 +291,12 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC ) ...@@ -291,12 +291,12 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
CurrentDrawItem = Text; CurrentDrawItem = Text;
Text->m_Size.x = Text->m_Size.y = g_LastTextSize; Text->m_Size.x = Text->m_Size.y = g_LastTextSize;
Text->m_Horiz = g_LastTextOrient; Text->m_Horiz = g_LastTextOrient;
Text->m_Pos.x = GetScreen()->m_Curseur.x; Text->m_Pos.x = GetScreen()->m_Curseur.x;
Text->m_Pos.y = -( GetScreen()->m_Curseur.y ); Text->m_Pos.y = -( GetScreen()->m_Curseur.y );
EditSymbolText( NULL, Text ); EditSymbolText( NULL, Text );
if( Text->m_Text.IsEmpty() ) if( Text->m_Text.IsEmpty() )
{ {
SAFE_DELETE( Text ); SAFE_DELETE( Text );
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
...@@ -362,7 +362,7 @@ void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC ) ...@@ -362,7 +362,7 @@ void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC )
case COMPONENT_POLYLINE_DRAW_TYPE: case COMPONENT_POLYLINE_DRAW_TYPE:
{ {
wxPoint pos = GetScreen()->m_Curseur; wxPoint pos = GetScreen()->m_Curseur;
( (LibDrawPolyline*) CurrentDrawItem )->AddPoint( pos ); ( (LibDrawPolyline*) CurrentDrawItem )->AddPoint( pos );
} }
break; break;
...@@ -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*/
...@@ -481,7 +481,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC ) ...@@ -481,7 +481,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
SetCursor( wxCURSOR_HAND ); SetCursor( wxCURSOR_HAND );
CurrentDrawItem->m_Flags |= IS_MOVED; CurrentDrawItem->m_Flags |= IS_MOVED;
StartCursor = GetScreen()->m_Curseur; StartCursor = GetScreen()->m_Curseur;
switch( CurrentDrawItem->Type() ) switch( CurrentDrawItem->Type() )
{ {
...@@ -513,7 +513,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC ) ...@@ -513,7 +513,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
; ;
} }
ItemPreviousPos = GetScreen()->m_Curseur; ItemPreviousPos = GetScreen()->m_Curseur;
DrawPanel->ManageCurseur = RedrawWhileMovingCursor; DrawPanel->ManageCurseur = RedrawWhileMovingCursor;
DrawPanel->ForceCloseManageCurseur = AbortSymbolTraceOn; DrawPanel->ForceCloseManageCurseur = AbortSymbolTraceOn;
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE ); DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
...@@ -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;
...@@ -720,7 +720,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -720,7 +720,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
CurrentDrawItem->m_Flags = 0; CurrentDrawItem->m_Flags = 0;
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
...@@ -832,11 +832,11 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC ) ...@@ -832,11 +832,11 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
{ {
Poly->n--; Poly->n--;
ptpoly = Poly->PolyList + ( 2 * (Poly->n - 1) ); ptpoly = Poly->PolyList + ( 2 * (Poly->n - 1) );
if( (ptpoly[0] != GetScreen()->m_Curseur.x) if( (ptpoly[0] != GetScreen()->m_Curseur.x)
|| (ptpoly[1] != -GetScreen()->m_Curseur.y) ) || (ptpoly[1] != -GetScreen()->m_Curseur.y) )
{ {
ptpoly[0] = GetScreen()->m_Curseur.x; ptpoly[0] = GetScreen()->m_Curseur.x;
ptpoly[1] = -( GetScreen()->m_Curseur.y); ptpoly[1] = -( GetScreen()->m_Curseur.y);
break; break;
} }
} }
......
...@@ -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;
} }
......
This diff is collapsed.
...@@ -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:
...@@ -136,7 +137,7 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -136,7 +137,7 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
/* Recalcul de la position du curseur schema */ /* Recalcul de la position du curseur schema */
GetScreen()->m_Curseur = curpos; GetScreen()->m_Curseur = curpos;
/* Placement sur la grille generale */ /* Placement sur la grille generale */
PutOnGrid( &GetScreen()->m_Curseur ); PutOnGrid( &GetScreen()->m_Curseur );
......
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.
...@@ -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 )
{ {
......
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.
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