Commit 721d878f authored by dickelbeck's avatar dickelbeck

GetScreen() work, menu capitalization, beautifying

parent 25d04032
......@@ -5,16 +5,31 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+all
* Made a little more sense out of the GetScreen() problem by making it
non-virtual, and having the two types of frame classes (eeschema's and pcbnew's)
each return their respective types of screens {SCH,PCB}_SCREEN*.
* Added GetBaseScreen() as the virtual function which always returns BASE_SCREEN*.
* Made WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint Mouse ){ dummy }
* Added WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint Mouse );
* Moved to void <class>::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) from
void <class>::Place( WinEDA_DrawFrame* frame, wxDC* DC ) so that these
functions can use the new SCH_SCREEN* WinEDA_SchematicFrame::GetScreen()
function (the non-virtual one that returns SCH_SCREEN* not BASE_SCREEN*).
* Made some menus conformant to UIpolicies.txt regarding uppercase.
* Beautified 5-10 files.
2008-Apr-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
very small bug in display component info removed
very small bug in display component info removed
+pcbnew
+cvpcb
removed bug: forgotten paths when adding lib files when not in the default lib path
(same problem as in eeschema, solved in 2008-Apr-09 Update)
(same problem as in eeschema, solved in 2008-Apr-09 Update)
2008-Apr-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
......
......@@ -131,7 +131,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
* Init the Block infos: command type, initial position, and other variables..
*/
{
DrawBlockStruct* Block = & GetScreen()->BlockLocate;
DrawBlockStruct* Block = & GetBaseScreen()->BlockLocate;
if( (Block->m_Command != BLOCK_IDLE)
|| ( Block->m_State != STATE_NO_BLOCK) )
......@@ -169,7 +169,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
if( Block->m_BlockDrawStruct == NULL ) /* No data to paste */
{
DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetBaseScreen()->BlockLocate.m_Command = BLOCK_IDLE;
DrawPanel->ManageCurseur = NULL;
return TRUE;
}
......
......@@ -42,7 +42,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event )
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
{
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
if( GetBaseScreen()->BlockLocate.m_Command != BLOCK_IDLE )
DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
DrawPanel->m_PanelDefaultCursor ) );
......
......@@ -321,7 +321,7 @@ wxString WinEDA_DrawFrame::GetScreenDesc()
{
wxString msg;
msg << GetScreen()->m_ScreenNumber << wxT( "/" ) <<
GetScreen()->m_NumberOfScreen;
msg << GetBaseScreen()->m_ScreenNumber << wxT( "/" )
<< GetBaseScreen()->m_NumberOfScreen;
return msg;
}
This diff is collapsed.
......@@ -53,7 +53,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
m_Pcb = new BOARD( NULL, this );
m_CurrentScreen = new PCB_SCREEN( CVPCB_DISPLAY_FRAME );
SetBaseScreen( new PCB_SCREEN( CVPCB_DISPLAY_FRAME ) );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
......@@ -66,10 +66,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
/******************************************/
WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
/******************************************/
// Destructor
{
delete m_CurrentScreen;
delete GetBaseScreen();
SetBaseScreen( 0 );
delete m_Pcb;
......@@ -177,14 +176,14 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{
wxSize delta;
int flagcurseur = 0;
int zoom = m_CurrentScreen->GetZoom();
int zoom = GetScreen()->GetZoom();
wxPoint curpos, oldpos;
curpos = DrawPanel->CursorRealPosition( Mouse );
oldpos = m_CurrentScreen->m_Curseur;
oldpos = GetScreen()->m_Curseur;
delta.x = m_CurrentScreen->GetGrid().x / zoom;
delta.y = m_CurrentScreen->GetGrid().y / zoom;
delta.x = GetScreen()->GetGrid().x / zoom;
delta.y = GetScreen()->GetGrid().y / zoom;
if( delta.x <= 0 )
delta.x = 1;
if( delta.y <= 0 )
......@@ -197,13 +196,13 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F1:
OnZoom( ID_ZOOM_IN_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case WXK_F2:
OnZoom( ID_ZOOM_OUT_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case WXK_F3:
......@@ -214,11 +213,11 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_F4:
OnZoom( ID_ZOOM_CENTER_KEY );
flagcurseur = 2;
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case ' ':
m_CurrentScreen->m_O_Curseur = m_CurrentScreen->m_Curseur;
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break;
case WXK_NUMPAD8: /* cursor moved up */
......@@ -251,26 +250,26 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
}
}
m_CurrentScreen->m_Curseur = curpos;
GetScreen()->m_Curseur = curpos;
/* Put cursor on grid */
PutOnGrid( &m_CurrentScreen->m_Curseur );
PutOnGrid( &GetScreen()->m_Curseur );
if( m_CurrentScreen->IsRefreshReq() )
if( GetScreen()->IsRefreshReq() )
{
flagcurseur = 2;
RedrawActiveWindow( DC, TRUE );
}
if( (oldpos.x != m_CurrentScreen->m_Curseur.x)
|| (oldpos.y != m_CurrentScreen->m_Curseur.y) )
if( (oldpos.x != GetScreen()->m_Curseur.x)
|| (oldpos.y != GetScreen()->m_Curseur.y) )
{
if( flagcurseur != 2 )
{
curpos = m_CurrentScreen->m_Curseur;
m_CurrentScreen->m_Curseur = oldpos;
curpos = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
m_CurrentScreen->m_Curseur = curpos;
GetScreen()->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
}
......
......@@ -479,7 +479,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{
DrawBlockStruct* PtBlock;
DrawPickedStruct* PickedList;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
PtBlock = &panel->GetScreen()->BlockLocate;
GRSetDrawMode( DC, g_XorMode );
......
......@@ -50,7 +50,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent,
/* Mark items 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):
* - Commons are always marked
* - Specific graphic shapes must agree with the current displayed part and convert
......@@ -435,7 +435,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*/
{
DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
LibEDA_BaseStruct* item;
wxPoint move_offset;
......@@ -594,7 +594,7 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
( (LibDrawText*) item )->m_Pos.x += offset.x;
( (LibDrawText*) item )->m_Pos.y += offset.y;
break;
default:
;
}
......@@ -704,7 +704,7 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
SETMIRROR( ( (LibDrawText*) item )->m_Pos.x );
break;
default:
;
}
......
......@@ -370,7 +370,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
*/
{
EDA_DrawLineStruct* CurrentLine =
(EDA_DrawLineStruct*) panel->m_Parent->GetScreen()->GetCurItem();
(EDA_DrawLineStruct*) panel->GetScreen()->GetCurItem();
EDA_DrawLineStruct* segment;
int color;
......@@ -390,7 +390,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
}
}
wxPoint endpos = panel->m_Parent->GetScreen()->m_Curseur;
wxPoint endpos = panel->GetScreen()->m_Curseur;
if( g_HVLines ) /* Coerce the line to vertical or horizontal one: */
{
ComputeBreakPoint( CurrentLine, endpos );
......@@ -463,11 +463,11 @@ static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool eras
*/
{
DrawPolylineStruct* NewPoly =
(DrawPolylineStruct*) panel->m_Parent->GetScreen()->GetCurItem();
(DrawPolylineStruct*) panel->GetScreen()->GetCurItem();
int color;
wxPoint endpos;
endpos = panel->m_Parent->GetScreen()->m_Curseur;
endpos = panel->GetScreen()->m_Curseur;
color = ReturnLayerColor( NewPoly->GetLayer() );
GRSetDrawMode( DC, g_XorMode );
......
......@@ -56,7 +56,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* Dessin du Segment "BusEntry" lors des deplacements du curseur
*/
{
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem();
if( BusEntry == NULL )
......
......@@ -218,13 +218,13 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
/****************************************************************/
void DrawSheetStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/****************************************************************/
{
/* Placement en liste des structures si nouveau composant:*/
if( m_Flags & IS_NEW )
{
if( !( (WinEDA_SchematicFrame*) frame )->EditSheet( this, DC ) )
if( !frame->EditSheet( this, DC ) )
{
frame->GetScreen()->SetCurItem( NULL );
frame->DrawPanel->ManageCurseur = NULL;
......
......@@ -40,13 +40,13 @@ public:
Hierarchical_PIN_Sheet_Struct* Next()
{ return (Hierarchical_PIN_Sheet_Struct*) Pnext; }
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -99,7 +99,7 @@ public:
*/
bool Save( FILE* aFile ) const;
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC );
......
......@@ -42,7 +42,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
/***************************************************************/
void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***************************************************************/
/* place the struct in EEDrawList.
......@@ -52,12 +52,12 @@ void SCH_ITEM::Place( WinEDA_DrawFrame* frame, wxDC* DC )
{
if( m_Flags & IS_NEW )
{
SCH_SCREEN* screen = (SCH_SCREEN*) frame->GetScreen();
SCH_SCREEN* screen = frame->GetScreen();
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
screen->AddToDrawList( this );
g_ItemToRepeat = this;
if( frame->m_Ident == SCHEMATIC_FRAME )
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_NEW );
frame->SaveCopyInUndoList( this, IS_NEW );
}
m_Flags = 0;
......
......@@ -94,7 +94,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
/***************************************************************/
void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_TEXT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***************************************************************/
{
/* save old text in undo list */
......@@ -104,7 +104,7 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
......
......@@ -101,7 +101,7 @@ public:
void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundingBox();
/**
......
......@@ -418,7 +418,7 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
/***********************************************************************/
void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void SCH_COMPONENT::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/***********************************************************************/
{
/* save old text in undo list */
......@@ -430,7 +430,7 @@ void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
frame->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
......
......@@ -57,7 +57,7 @@ public:
void PartTextCopy( PartTextStruct* target );
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundaryBox() const;
bool IsVoid();
......@@ -136,13 +136,13 @@ public:
bool Save( FILE* aFile ) const;
SCH_COMPONENT* GenCopy();
void SetRotationMiroir( int type );
int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord );
void Display_Infos( WinEDA_DrawFrame* frame );
void ClearAnnotation();
EDA_Rect GetBoundaryBox() const;
EDA_Rect GetBoundingBox();
void SetRotationMiroir( int type );
int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord );
void Display_Infos( WinEDA_DrawFrame* frame );
void ClearAnnotation();
EDA_Rect GetBoundaryBox() const;
EDA_Rect GetBoundingBox();
const wxString& ReturnFieldName( int aFieldNdx ) const;
......@@ -164,7 +164,7 @@ public:
void SwapData( SCH_COMPONENT* copyitem );
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
//returns a unique ID, in the form of a path.
......
......@@ -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;
SCH_SCREEN* screen = (SCH_SCREEN*)GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
wxSize delta;
SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
curpos = screen->m_MousePosition;
oldpos = screen->m_Curseur;
......@@ -323,7 +323,7 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
curpos = screen->m_Curseur;
screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = curpos;
screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )
......
This diff is collapsed.
......@@ -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;
......
......@@ -179,7 +179,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/*************************************************************************/
EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
SCH_TEXT* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
/*************************************************************************/
/* Routine to create new text struct (GraphicText, label or Glabel).
......@@ -278,8 +278,8 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
/* Abort function for the command move text */
{
SCH_SCREEN* screen = (SCH_SCREEN*) Panel->m_Parent->GetScreen();
SCH_ITEM* Struct = (SCH_ITEM*) screen->GetCurItem();
BASE_SCREEN* screen = Panel->GetScreen();
SCH_ITEM* Struct = (SCH_ITEM*) screen->GetCurItem();
g_ItemToRepeat = NULL;
Panel->ManageCurseur = NULL;
......
......@@ -142,7 +142,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask
wxBeginBusyCursor();
ActiveScreen = screen = m_Parent->GetScreen();
ActiveScreen = screen = m_Parent->GetBaseScreen();
RedrawStructList( this, DC, screen->EEDrawList, GR_COPY );
if( Print_Sheet_Ref )
......
......@@ -255,8 +255,9 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
panel->m_Parent->GetScreen()->GetCurItem();
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
/* Effacement du composant */
if( erase )
......@@ -264,8 +265,8 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
}
move_vector.x = panel->m_Parent->GetScreen()->m_Curseur.x - DrawLibItem->m_Pos.x;
move_vector.y = panel->m_Parent->GetScreen()->m_Curseur.y - DrawLibItem->m_Pos.y;
move_vector.x = screen->m_Curseur.x - DrawLibItem->m_Pos.x;
move_vector.y = screen->m_Curseur.y - DrawLibItem->m_Pos.y;
MoveOneStruct( DrawLibItem, move_vector );
DrawStructsInGhost( panel, DC, DrawLibItem, 0, 0 );
......@@ -320,8 +321,9 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant
*/
{
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
Panel->m_Parent->GetScreen()->GetCurItem();
SCH_SCREEN* screen = (SCH_SCREEN*) Panel->GetScreen();
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) screen->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
{
......@@ -342,12 +344,11 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
DrawLibItem->m_Flags = 0;
}
D(printf("refresh\n");)
Panel->Refresh( TRUE );
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
Panel->m_Parent->GetScreen()->SetCurItem( NULL );
screen->SetCurItem( NULL );
}
......
......@@ -280,7 +280,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct == NULL )
break;
}
......@@ -332,7 +332,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_MIRROR_X_COMPONENT: // Mirror X (Component)
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct )
{
if( DrawStruct->m_Flags == 0 )
......@@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_ORIENT_NORMAL_COMPONENT: // Orient 0, no mirror (Component)
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct )
{
if( DrawStruct->m_Flags == 0 )
......@@ -365,10 +365,10 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct && (DrawStruct->m_Flags ==0) )
{
((SCH_SCREEN*)GetScreen())->SetCurItem( DrawStruct );
GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct );
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
......@@ -378,7 +378,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct)
{
EditComponentValue(
......@@ -390,7 +390,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if( ItemInEdit )
break;
if( DrawStruct == NULL )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
DrawStruct = LocateSmallestComponent( GetScreen() );
if(DrawStruct)
{
EditComponentFootprint(
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
long style ) :
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, parent, title, pos, size, style )
{
m_FrameName = wxT( "LibeditFrame" );
......@@ -73,7 +73,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon
SetIcon( wxIcon( libedit_xpm ) );
m_CurrentScreen = ScreenLib;
SetBaseScreen( ScreenLib );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel )
......@@ -90,7 +90,6 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
/**********************************************/
{
m_Parent->m_LibeditFrame = NULL;
//m_CurrentScreen = ScreenSch; humm, is this needed?
}
......@@ -100,14 +99,14 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
{
LibraryStruct* Lib;
if( GetScreen()->IsModify() )
if( GetScreen()->IsModify() )
{
if( !IsOK( this, _( "Component was modified!\nDiscard changes?" ) ) )
{
Event.Veto(); return;
}
else
GetScreen()->ClrModify();
GetScreen()->ClrModify();
}
for( Lib = g_LibraryList; Lib != NULL; Lib = Lib->m_Pnext )
......@@ -118,7 +117,8 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
msg.Printf( _( "Library \"%s\" was modified!\nDiscard changes?" ), Lib->m_Name.GetData() );
if( !IsOK( this, msg ) )
{
Event.Veto(); return;
Event.Veto();
return;
}
}
}
......@@ -261,8 +261,8 @@ int WinEDA_LibeditFrame::BestZoom()
}
else
{
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
}
size = DrawPanel->GetClientSize();
......@@ -275,12 +275,12 @@ int WinEDA_LibeditFrame::BestZoom()
if( CurrentLibEntry )
{
GetScreen()->m_Curseur = BoundaryBox.Centre();
GetScreen()->m_Curseur = BoundaryBox.Centre();
}
else
{
GetScreen()->m_Curseur.x = 0;
GetScreen()->m_Curseur.y = 0;
GetScreen()->m_Curseur.x = 0;
GetScreen()->m_Curseur.y = 0;
}
return bestzoom;
......@@ -339,7 +339,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
switch( id )
{
case ID_LIBEDIT_SAVE_CURRENT_LIB:
if( GetScreen()->IsModify() )
if( GetScreen()->IsModify() )
{
if( IsOK( this, _( "Include last component changes?" ) ) )
SaveOnePartInMemory();
......@@ -608,7 +608,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
}
CurrentDrawItem = NULL;
GetScreen()->SetModify();
GetScreen()->SetModify();
DrawPanel->CursorOn( &dc );
break;
......@@ -656,7 +656,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
{
EditField( &dc, (LibDrawField*) CurrentDrawItem );
}
DrawPanel->MouseToCursorSchema();
DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc );
break;
......
......@@ -157,7 +157,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_NOCONNECT_STRUCT_TYPE:
// if( !flags ) PopMenu->Append(ID_POPUP_SCH_MOVE_ITEM_REQUEST, "Move noconnect");
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete noconn" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Noconn" ), delete_xpm );
break;
case DRAW_JUNCTION_STRUCT_TYPE:
......@@ -167,17 +167,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_BUSENTRY_STRUCT_TYPE:
if( !flags )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM_REQUEST,
_( "Move bus entry" ), move_xpm );
_( "Move Bus Entry" ), move_xpm );
if( GetBusEntryShape( (DrawBusEntryStruct*) DrawStruct ) == '\\' )
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "set bus entry /" ) );
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "Set Bus Entry /" ) );
else
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "set bus entry \\" ) );
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "Set Bus Entry \\" ) );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "delete bus entry" ), delete_bus_xpm );
_( "Delete Bus Entry" ), delete_bus_xpm );
break;
case DRAW_MARKER_STRUCT_TYPE:
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
break;
case TYPE_SCH_TEXT:
......@@ -230,9 +230,9 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
default:
if( is_new )
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE,
_( "Delete drawing" ), delete_xpm );
_( "Delete Drawing" ), delete_xpm );
break;
}
......@@ -417,7 +417,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global label" ), label2glabel_xpm );
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
......@@ -444,7 +444,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global label" ), label2glabel_xpm );
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
......@@ -494,14 +494,14 @@ void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
}
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete junction" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Junction" ), delete_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM ) )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _(
"Delete connection" ), delete_connection_xpm );
"Delete Connection" ), delete_connection_xpm );
}
}
......@@ -525,9 +525,9 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
if( is_new )
return;
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _(
"Delete connection" ), delete_connection_xpm );
"Delete Connection" ), delete_connection_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) )
......@@ -535,13 +535,13 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add label" ), add_line_label_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm );
// Place Global label command only if the cursor is over one end of the Wire:
if( ( pos.x == Wire->m_Start.x && pos.y == Wire->m_Start.y)
|| ( pos.x == Wire->m_End.x && pos.y == Wire->m_End.y ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add global label" ), add_glabel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
......@@ -567,13 +567,13 @@ void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
_( "Break Bus" ), break_bus_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add label" ), add_line_label_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm );
// Place Global label command only if the cursor is over one end of the Bus:
if( ( pos.x == Bus->m_Start.x && pos.y == Bus->m_Start.y)
|| ( pos.x == Bus->m_End.x && pos.y == Bus->m_End.y ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add global label" ), add_glabel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
......@@ -645,14 +645,14 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
{
wxMenu* menu_other_block_commands = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_other_block_commands,
-1, _( "Other block commands" ), right_xpm );
-1, _( "Other Block Commands" ), right_xpm );
ADD_MENUITEM( menu_other_block_commands, wxID_COPY, _( "Save Block" ), copy_button );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ), copyblock_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DRAG_BLOCK,
_( "Drag Block (ctrl + drag mouse)" ), move_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_DELETE_BLOCK,
_( "Del. Block (shift+ctrl + drag mouse)" ), delete_xpm );
_( "Delelet Block (shift+ctrl + drag mouse)" ), delete_xpm );
ADD_MENUITEM( menu_other_block_commands, ID_POPUP_MIRROR_Y_BLOCK, _(
"Mirror Block ||" ), mirror_H_xpm );
#if 0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -151,10 +151,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
#endif
g_ItemToRepeat = NULL;
/* Get config */
GetSettings();
g_DrawMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 );
g_PlotPSMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 );
......@@ -183,6 +186,12 @@ WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
}
BASE_SCREEN* WinEDA_SchematicFrame::GetBaseScreen() const
{
return GetScreen();
}
/***************/
/* utility functions */
/***************/
......@@ -192,7 +201,7 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet()
}
BASE_SCREEN* WinEDA_SchematicFrame::GetScreen()
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
{
return m_CurrentSheet->LastScreen();
}
......@@ -399,17 +408,17 @@ int WinEDA_SchematicFrame::BestZoom()
int bestzoom;
wxSize size;
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
size = DrawPanel->GetClientSize();
ii = dx / size.x;
jj = dy / size.y;
bestzoom = MAX( ii, jj ) + 1;
size = DrawPanel->GetClientSize();
ii = dx / size.x;
jj = dy / size.y;
bestzoom = MAX( ii, jj ) + 1;
GetScreen()->SetZoom( ii );
GetScreen()->m_Curseur.x = dx / 2;
GetScreen()->m_Curseur.y = dy / 2;
GetScreen()->SetZoom( ii );
GetScreen()->m_Curseur.x = dx / 2;
GetScreen()->m_Curseur.y = dy / 2;
return bestzoom;
}
......
......@@ -468,7 +468,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
Hierarchical_PIN_Sheet_Struct* SheetLabel;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*)
screen->GetCurItem();
......@@ -479,10 +479,8 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( Sheet->m_Flags & IS_RESIZED )
{
Sheet->m_Size.x = MAX( s_SheetMindx,
screen->m_Curseur.x - Sheet->m_Pos.x );
Sheet->m_Size.y = MAX( s_SheetMindy,
screen->m_Curseur.y - Sheet->m_Pos.y );
Sheet->m_Size.x = MAX( s_SheetMindx, screen->m_Curseur.x - Sheet->m_Pos.x );
Sheet->m_Size.y = MAX( s_SheetMindy, screen->m_Curseur.y - Sheet->m_Pos.y );
SheetLabel = Sheet->m_Label;
while( SheetLabel )
{
......@@ -507,7 +505,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/****************************************/
static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
{
SCH_SCREEN* Screen = (SCH_SCREEN*) Panel->m_Parent->GetScreen();
SCH_SCREEN* Screen = (SCH_SCREEN*) Panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*) Screen->GetCurItem();
if( Sheet == NULL )
......@@ -530,7 +528,7 @@ static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
else if( Sheet->m_Flags & IS_MOVED ) /* move en cours: on l'annule */
{
wxPoint curspos = Screen->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = s_OldPos;
Panel->GetScreen()->m_Curseur = s_OldPos;
DeplaceSheet( Panel, DC, TRUE );
RedrawOneStruct( Panel, DC, Sheet, GR_DEFAULT_DRAWMODE );
Sheet->m_Flags = 0;
......
......@@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
* de deplacement
* Si le NetSheet est nouveau, il est pointe par NewSheetLabel
*/
void Hierarchical_PIN_Sheet_Struct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
void Hierarchical_PIN_Sheet_Struct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
{
DrawSheetStruct* Sheet = (DrawSheetStruct*) m_Parent;
......@@ -237,7 +237,7 @@ void WinEDA_SchematicFrame::StartMove_PinSheet( Hierarchical_PIN_Sheet_Struct* S
static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
Hierarchical_PIN_Sheet_Struct* SheetLabel = (Hierarchical_PIN_Sheet_Struct*)
panel->m_Parent->GetScreen()->GetCurItem();
panel->GetScreen()->GetCurItem();
if( SheetLabel == NULL )
return;
......@@ -251,13 +251,13 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
SheetLabel->m_Edge = 0;
SheetLabel->m_Pos.x = Sheet->m_Pos.x;
if( panel->m_Parent->GetScreen()->m_Curseur.x > ( Sheet->m_Pos.x + (Sheet->m_Size.x / 2) ) )
if( panel->GetScreen()->m_Curseur.x > ( Sheet->m_Pos.x + (Sheet->m_Size.x / 2) ) )
{
SheetLabel->m_Edge = 1;
SheetLabel->m_Pos.x = Sheet->m_Pos.x + Sheet->m_Size.x;
}
SheetLabel->m_Pos.y = panel->m_Parent->GetScreen()->m_Curseur.y;
SheetLabel->m_Pos.y = panel->GetScreen()->m_Curseur.y;
if( SheetLabel->m_Pos.y < Sheet->m_Pos.y )
SheetLabel->m_Pos.y = Sheet->m_Pos.y;
if( SheetLabel->m_Pos.y > (Sheet->m_Pos.y + Sheet->m_Size.y) )
......
......@@ -100,7 +100,7 @@ bodygraphics_PropertiesAccept( wxCommandEvent& event )
}
CurrentLibEntry->SortDrawItems();
m_Parent->GetScreen()->SetModify();
m_Parent->GetScreen()->SetModify();
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
......@@ -150,7 +150,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
else
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
SAFE_DELETE( CurrentDrawItem );
SAFE_DELETE( CurrentDrawItem );
}
else
{
......@@ -224,8 +224,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawArc* Arc = new LibDrawArc();
CurrentDrawItem = Arc;
ArcStartX = ArcEndX = GetScreen()->m_Curseur.x;
ArcStartY = ArcEndY = -( GetScreen()->m_Curseur.y );
ArcStartX = ArcEndX = GetScreen()->m_Curseur.x;
ArcStartY = ArcEndY = -( GetScreen()->m_Curseur.y );
StateDrawArc = 1;
Arc->m_Fill = FlSymbol_Fill;
Arc->m_Width = g_LibSymbolDefaultLineWidth;
......@@ -237,8 +237,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawCircle* Circle = new LibDrawCircle();
CurrentDrawItem = Circle;
Circle->m_Pos.x = GetScreen()->m_Curseur.x;
Circle->m_Pos.y = -( GetScreen()->m_Curseur.y );
Circle->m_Pos.x = GetScreen()->m_Curseur.x;
Circle->m_Pos.y = -( GetScreen()->m_Curseur.y );
Circle->m_Fill = FlSymbol_Fill;
Circle->m_Width = g_LibSymbolDefaultLineWidth;
}
......@@ -249,8 +249,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawSquare* Square = new LibDrawSquare();
CurrentDrawItem = Square;
Square->m_Pos.x = GetScreen()->m_Curseur.x;
Square->m_Pos.y = -( GetScreen()->m_Curseur.y );
Square->m_Pos.x = GetScreen()->m_Curseur.x;
Square->m_Pos.y = -( GetScreen()->m_Curseur.y );
Square->m_End = Square->m_Pos;
Square->m_Fill = FlSymbol_Fill;
Square->m_Width = g_LibSymbolDefaultLineWidth;
......@@ -265,8 +265,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
polyline->n = 2;
ptpoly = (int*) MyZMalloc( 4 * sizeof(int) );
polyline->PolyList = ptpoly;
ptpoly[0] = ptpoly[2] = GetScreen()->m_Curseur.x;
ptpoly[1] = ptpoly[3] = -( GetScreen()->m_Curseur.y );
ptpoly[0] = ptpoly[2] = GetScreen()->m_Curseur.x;
ptpoly[1] = ptpoly[3] = -( GetScreen()->m_Curseur.y );
polyline->m_Fill = FlSymbol_Fill;
polyline->m_Width = g_LibSymbolDefaultLineWidth;
}
......@@ -277,8 +277,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
LibDrawSegment* Segment = new LibDrawSegment();
CurrentDrawItem = Segment;
Segment->m_Pos.x = GetScreen()->m_Curseur.x;
Segment->m_Pos.y = -( GetScreen()->m_Curseur.y );
Segment->m_Pos.x = GetScreen()->m_Curseur.x;
Segment->m_Pos.y = -( GetScreen()->m_Curseur.y );
Segment->m_End = Segment->m_Pos;
Segment->m_Width = g_LibSymbolDefaultLineWidth;
}
......@@ -291,12 +291,12 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
CurrentDrawItem = Text;
Text->m_Size.x = Text->m_Size.y = g_LastTextSize;
Text->m_Horiz = g_LastTextOrient;
Text->m_Pos.x = GetScreen()->m_Curseur.x;
Text->m_Pos.y = -( GetScreen()->m_Curseur.y );
Text->m_Pos.x = GetScreen()->m_Curseur.x;
Text->m_Pos.y = -( GetScreen()->m_Curseur.y );
EditSymbolText( NULL, Text );
if( Text->m_Text.IsEmpty() )
{
SAFE_DELETE( Text );
SAFE_DELETE( Text );
CurrentDrawItem = NULL;
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......@@ -362,7 +362,7 @@ void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC )
case COMPONENT_POLYLINE_DRAW_TYPE:
{
wxPoint pos = GetScreen()->m_Curseur;
wxPoint pos = GetScreen()->m_Curseur;
( (LibDrawPolyline*) CurrentDrawItem )->AddPoint( pos );
}
break;
......@@ -383,7 +383,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
/* Redraw the graphoc shape while moving
*/
{
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx, my;
/* Erase shape in the old positon*/
......@@ -481,7 +481,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
SetCursor( wxCURSOR_HAND );
CurrentDrawItem->m_Flags |= IS_MOVED;
StartCursor = GetScreen()->m_Curseur;
StartCursor = GetScreen()->m_Curseur;
switch( CurrentDrawItem->Type() )
{
......@@ -513,7 +513,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol( wxDC* DC )
;
}
ItemPreviousPos = GetScreen()->m_Curseur;
ItemPreviousPos = GetScreen()->m_Curseur;
DrawPanel->ManageCurseur = RedrawWhileMovingCursor;
DrawPanel->ForceCloseManageCurseur = AbortSymbolTraceOn;
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
......@@ -529,7 +529,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
int DrawMode = g_XorMode;
int* ptpoly;
int dx, dy;
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx = Screen->m_Curseur.x,
my = Screen->m_Curseur.y;
......@@ -720,7 +720,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
CurrentDrawItem->m_Flags = 0;
CurrentDrawItem = NULL;
GetScreen()->SetModify();
GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......@@ -832,11 +832,11 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
{
Poly->n--;
ptpoly = Poly->PolyList + ( 2 * (Poly->n - 1) );
if( (ptpoly[0] != GetScreen()->m_Curseur.x)
|| (ptpoly[1] != -GetScreen()->m_Curseur.y) )
if( (ptpoly[0] != GetScreen()->m_Curseur.x)
|| (ptpoly[1] != -GetScreen()->m_Curseur.y) )
{
ptpoly[0] = GetScreen()->m_Curseur.x;
ptpoly[1] = -( GetScreen()->m_Curseur.y);
ptpoly[0] = GetScreen()->m_Curseur.x;
ptpoly[1] = -( GetScreen()->m_Curseur.y);
break;
}
}
......
......@@ -69,7 +69,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
if( m_Semaphore )
SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
m_CurrentScreen = new SCH_SCREEN( VIEWER_FRAME );
SetBaseScreen( new SCH_SCREEN( VIEWER_FRAME ) );
GetScreen()->SetZoom( 16 );
if( Library == NULL )
......@@ -110,7 +110,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
{
SAFE_DELETE( m_CurrentScreen );
delete GetScreen();
SetBaseScreen( 0 );
m_Parent->m_ViewlibFrame = NULL;
}
......
This diff is collapsed.
......@@ -22,8 +22,9 @@
/**********************************************************************/
EDA_BaseStruct* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() {
BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay()
/**********************************************************************/
{
return Locate( CURSEUR_OFF_GRILLE );
}
......@@ -72,22 +73,22 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
{
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_DOWN_KEY:
OnZoom( ID_ZOOM_PANNING_DOWN );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_LEFT_KEY:
OnZoom( ID_ZOOM_PANNING_LEFT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_PANNING_RIGHT_KEY:
OnZoom( ID_ZOOM_PANNING_RIGHT );
curpos = m_CurrentScreen->m_Curseur;
curpos = GetScreen()->m_Curseur;
break;
case EDA_ZOOM_IN_FROM_MOUSE:
......@@ -136,7 +137,7 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
/* Recalcul de la position du curseur schema */
GetScreen()->m_Curseur = curpos;
/* Placement sur la grille generale */
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,
wxPoint pos;
int error = 0;
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
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