Commit 721d878f authored by dickelbeck's avatar dickelbeck

GetScreen() work, menu capitalization, beautifying

parent 25d04032
......@@ -5,18 +5,33 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+all
* Made a little more sense out of the GetScreen() problem by making it
non-virtual, and having the two types of frame classes (eeschema's and pcbnew's)
each return their respective types of screens {SCH,PCB}_SCREEN*.
* Added GetBaseScreen() as the virtual function which always returns BASE_SCREEN*.
* Made WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint Mouse ){ dummy }
* Added WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint Mouse );
* Moved to void <class>::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) from
void <class>::Place( WinEDA_DrawFrame* frame, wxDC* DC ) so that these
functions can use the new SCH_SCREEN* WinEDA_SchematicFrame::GetScreen()
function (the non-virtual one that returns SCH_SCREEN* not BASE_SCREEN*).
* Made some menus conformant to UIpolicies.txt regarding uppercase.
* Beautified 5-10 files.
2008-Apr-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
very small bug in display component info removed
+pcbnew
+cvpcb
removed bug: forgotten paths when adding lib files when not in the default lib path
(same problem as in eeschema, solved in 2008-Apr-09 Update)
2008-Apr-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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();
......@@ -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,11 +217,11 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
/***********************************************************************/
void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
/***********************************************************************/
{
wxSize delta;
SCH_SCREEN* screen = (SCH_SCREEN*)GetScreen();
SCH_SCREEN* screen = GetScreen();
int zoom = screen->GetZoom();
wxPoint curpos, oldpos;
int hotkey = 0;
......@@ -323,7 +323,7 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
curpos = screen->m_Curseur;
screen->m_Curseur = oldpos;
DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = curpos;
screen->m_Curseur = curpos;
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )
......
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,7 +278,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
/* Abort function for the command move text */
{
SCH_SCREEN* screen = (SCH_SCREEN*) Panel->m_Parent->GetScreen();
BASE_SCREEN* screen = Panel->GetScreen();
SCH_ITEM* Struct = (SCH_ITEM*) screen->GetCurItem();
g_ItemToRepeat = NULL;
......
......@@ -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(
......
......@@ -35,10 +35,10 @@ static void ExitMoveField(WinEDA_DrawPanel * Panel, wxDC * DC)
if(CurrentDrawItem == NULL) return;
wxPoint curpos;
curpos = Panel->m_Parent->GetScreen()->m_Curseur;
Panel->m_Parent->GetScreen()->m_Curseur = StartCursor;
curpos = Panel->GetScreen()->m_Curseur;
Panel->GetScreen()->m_Curseur = StartCursor;
ShowMoveField(Panel, DC, TRUE);
Panel->m_Parent->GetScreen()->m_Curseur = curpos;
Panel->GetScreen()->m_Curseur = curpos;
CurrentDrawItem->m_Flags = 0;
CurrentDrawItem = NULL;
......
......@@ -73,7 +73,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon
SetIcon( wxIcon( libedit_xpm ) );
m_CurrentScreen = ScreenLib;
SetBaseScreen( ScreenLib );
GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel )
......@@ -90,7 +90,6 @@ WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
/**********************************************/
{
m_Parent->m_LibeditFrame = NULL;
//m_CurrentScreen = ScreenSch; humm, is this needed?
}
......@@ -118,7 +117,8 @@ void WinEDA_LibeditFrame::OnCloseWindow( wxCloseEvent& Event )
msg.Printf( _( "Library \"%s\" was modified!\nDiscard changes?" ), Lib->m_Name.GetData() );
if( !IsOK( this, msg ) )
{
Event.Veto(); return;
Event.Veto();
return;
}
}
}
......
......@@ -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();
}
......
......@@ -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) )
......
......@@ -383,7 +383,7 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
/* Redraw the graphoc shape while moving
*/
{
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx, my;
/* Erase shape in the old positon*/
......@@ -529,7 +529,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
int DrawMode = g_XorMode;
int* ptpoly;
int dx, dy;
BASE_SCREEN* Screen = panel->m_Parent->GetScreen();
BASE_SCREEN* Screen = panel->GetScreen();
int mx = Screen->m_Curseur.x,
my = Screen->m_Curseur.y;
......
......@@ -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;
}
......
......@@ -239,7 +239,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
}
}
if( panel->m_Parent->GetScreen()->BlockLocate.m_State != STATE_BLOCK_STOP )
if( panel->GetScreen()->BlockLocate.m_State != STATE_BLOCK_STOP )
{
screen->BlockLocate.m_MoveVector.x = screen->m_Curseur.x - screen->BlockLocate.GetRight();
screen->BlockLocate.m_MoveVector.y = screen->m_Curseur.y - screen->BlockLocate.GetBottom();
......
......@@ -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:
......
This diff is collapsed.
......@@ -23,7 +23,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
* quand un outil est deja selectionn�
*/
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg;
if( m_ID_current_state == 0 )
......@@ -84,7 +84,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
*/
{
int id = event.GetId();
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
GERBER_Descr* gerber_layer = g_GERBER_Descr_List[layer];
wxPoint pos;
wxClientDC dc( DrawPanel );
......@@ -114,11 +114,11 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
/* ne devrait pas etre execute, sauf bug */
if( m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE )
if( GetScreen()->BlockLocate.m_Command != BLOCK_IDLE )
{
m_CurrentScreen->BlockLocate.m_Command = BLOCK_IDLE;
m_CurrentScreen->BlockLocate.m_State = STATE_NO_BLOCK;
m_CurrentScreen->BlockLocate.m_BlockDrawStruct = NULL;
GetScreen()->BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->BlockLocate.m_BlockDrawStruct = NULL;
}
if( m_ID_current_state == 0 )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
......@@ -267,21 +267,21 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_COPY_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_COPY;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
DrawPanel->m_AutoPAN_Request = FALSE;
HandleBlockEnd( &dc );
break;
case ID_POPUP_ZOOM_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_ZOOM;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
case ID_POPUP_DELETE_BLOCK:
GetScreen()->BlockLocate.m_Command = BLOCK_DELETE;
m_CurrentScreen->BlockLocate.SetMessageBlock( this );
GetScreen()->BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
......
......@@ -41,10 +41,13 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
case ID_MENU_INC_LAYER_AND_APPEND_FILE:
case ID_INC_LAYER_AND_APPEND_FILE:
{
int layer = GetPCBScreen()->m_Active_Layer;
((PCB_SCREEN*)GetScreen())->m_Active_Layer++;
int origLayer = GetScreen()->m_Active_Layer;
GetScreen()->m_Active_Layer++;
if( !LoadOneGerberFile( wxEmptyString, &dc, 0 ) )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = layer;
GetScreen()->m_Active_Layer = origLayer;
SetToolbars();
}
break;
......
This diff is collapsed.
......@@ -74,8 +74,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
m_Pcb->m_NbSegmZone = 0;
/* Init parametres de gestion des ecrans PAD et PCB */
m_CurrentScreen = ActiveScreen = ScreenPcb;
GetPCBScreen()->Init();
SetBaseScreen( ActiveScreen = ScreenPcb );
GetScreen()->Init();
return TRUE;
}
......@@ -104,7 +104,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
{
BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext;
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
if( all_layers )
layer = -1;
......@@ -189,7 +189,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/*********************************************************/
{
int layer = GetPCBScreen()->m_Active_Layer;
int layer = GetScreen()->m_Active_Layer;
wxString msg;
msg.Printf( _( "Delete Layer %d" ), layer + 1 );
......
......@@ -34,7 +34,7 @@ static int distance( int seuil );
/*************************************************************/
EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
/*************************************************************/
/* Fonction de localisation generale
......@@ -48,7 +48,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
int layer;
/* Localistion des pistes et vias, avec priorite aux vias */
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
Track = Locate_Pistes( m_Pcb->m_Track, -1, typeloc );
if( Track != NULL )
{
......@@ -80,7 +80,7 @@ EDA_BaseStruct* WinEDA_GerberFrame::Locate( int typeloc )
}
if( ( TrackLocate = Locate_Zone( (TRACK*) m_Pcb->m_Zone,
GetPCBScreen()->m_Active_Layer, typeloc ) ) != NULL )
GetScreen()->m_Active_Layer, typeloc ) ) != NULL )
{
TrackLocate->Display_Infos( this );
return TrackLocate;
......
......@@ -20,9 +20,9 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
* The menu already has a list of zoom commands.
*/
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu
......
......@@ -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 )
{
......
......@@ -107,7 +107,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = diametre;
track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y );
......@@ -140,7 +140,7 @@ static void Append_1_Flash_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = width;
track->m_Start = track->m_End = pos;
NEGATE( track->m_Start.y );
......@@ -181,7 +181,7 @@ static void Append_1_Line_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = largeur;
track->m_Start = startpoint;
NEGATE( track->m_Start.y );
......@@ -220,7 +220,7 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
track->Insert( frame->m_Pcb, NULL );
track->m_Shape = S_ARC;
track->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
track->SetLayer( frame->GetScreen()->m_Active_Layer );
track->m_Width = largeur;
if( multiquadrant )
......@@ -741,7 +741,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
edge_poly->Insert( frame->m_Pcb, last );
edge_poly->SetLayer( frame->GetPCBScreen()->m_Active_Layer );
edge_poly->SetLayer( frame->GetScreen()->m_Active_Layer );
edge_poly->m_Width = 1;
edge_poly->m_Start = m_PreviousPos;
NEGATE( edge_poly->m_Start.y );
......
......@@ -200,7 +200,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
if( GetScreen() )
{
layer = GetPCBScreen()->m_Active_Layer;
layer = GetScreen()->m_Active_Layer;
gerber_layer = g_GERBER_Descr_List[layer];
}
......@@ -313,7 +313,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
m_SelLayerBox = new WinEDAChoiceBox( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER,
wxDefaultPosition, wxSize( 150, -1 ), choices );
m_SelLayerBox->SetSelection( GetPCBScreen()->m_Active_Layer );
m_SelLayerBox->SetSelection( GetScreen()->m_Active_Layer );
m_HToolBar->AddControl( m_SelLayerBox );
m_HToolBar->AddSeparator();
......
......@@ -26,6 +26,21 @@ public:
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN();
/**
* Function GetCurItem
* returns the currently selected SCH_ITEM, overriding BASE_SCREEN::GetCurItem().
* @return SCH_ITEM* - the one selected, or NULL.
*/
SCH_ITEM* GetCurItem() const { return (SCH_ITEM*) BASE_SCREEN::GetCurItem(); }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from SCH_ITEM
*/
void SetCurItem( SCH_ITEM* aItem ) { BASE_SCREEN::SetCurItem( aItem ); }
virtual wxString GetClass() const
{
return wxT( "SCH_SCREEN" );
......@@ -34,7 +49,8 @@ public:
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies)
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void RemoveFromDrawList( SCH_ITEM* DrawStruct ); /* remove DrawStruct from EEDrawList. */
bool CheckIfOnDrawList( SCH_ITEM* st );
void AddToDrawList( SCH_ITEM* DrawStruct );
......
......@@ -23,7 +23,7 @@ class SCH_ITEM;
/* classe representant un ecran graphique de dessin */
/****************************************************/
class WinEDA_DrawPanel : public EDA_DRAW_PANEL
class WinEDA_DrawPanel : public wxScrolledWindow
{
public:
int m_Ident;
......@@ -59,8 +59,10 @@ public:
// Constructor and destructor
WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, const wxSize& size );
~WinEDA_DrawPanel() { }
/****************************/
virtual BASE_SCREEN* GetScreen() { return m_Parent->GetScreen(); }
BASE_SCREEN* GetScreen();
void PrepareGraphicContext( wxDC* DC );
wxPoint CalcAbsolutePosition( const wxPoint& rel_pos );
......@@ -140,6 +142,7 @@ public:
DECLARE_EVENT_TABLE()
};
/**************************/
/* class DrawBlockStruct */
/**************************/
......@@ -264,6 +267,14 @@ public:
BASE_SCREEN( int idscreen, KICAD_T aType = SCREEN_STRUCT_TYPE );
~BASE_SCREEN();
/**
* Function setCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from EDA_BaseStruct
*/
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
void InitDatas(); /* Inits completes des variables */
wxSize ReturnPageSize();
int GetInternalUnits();
......@@ -289,15 +300,6 @@ public:
int IsSave() { return m_FlagSave & 1; }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param current Any object derived from EDA_BaseStruct
*/
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
//----<zoom stuff>----------------------------------------------------------
/**
* Function GetZoom
......
......@@ -236,6 +236,14 @@ public:
*/
BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); }
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* @param aItem Any object derived from BOARD_ITEM
*/
void SetCurItem( BOARD_ITEM* aItem ) { BASE_SCREEN::SetCurItem( aItem ); }
/* Return true if a microvia can be put on board
* A microvia ia a small via restricted to 2 near neighbour layers
* because its is hole is made by laser which can penetrate only one layer
......
......@@ -56,7 +56,7 @@ public:
/* fonction de placement */
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
virtual void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
/**
* Function Save
......@@ -84,7 +84,7 @@ public:
public:
DrawPickedStruct( SCH_ITEM * pickedstruct = NULL );
~DrawPickedStruct();
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void DeleteWrapperList();
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
......
......@@ -28,6 +28,7 @@ enum fl_rot_cmp {
CMP_MIROIR_Y = 0x200 // miroir selon axe Y
};
class WinEDA_SchematicFrame : public WinEDA_DrawFrame
{
public:
......@@ -47,6 +48,9 @@ public:
void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void Process_Config( wxCommandEvent& event );
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
void Save_Config( wxWindow* displayframe );
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
......@@ -62,7 +66,11 @@ public:
EDA_BaseStruct* DrawStruct );
DrawSheetPath* GetSheet();
virtual BASE_SCREEN* GetScreen();
SCH_SCREEN* GetScreen() const;
BASE_SCREEN* GetBaseScreen() const;
virtual void SetScreen( SCH_SCREEN* screen );
virtual wxString GetScreenDesc();
......@@ -161,7 +169,7 @@ private:
bool PutInUndoList = FALSE );
// Text ,label, glabel
EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
SCH_TEXT* CreateNewText( wxDC* DC, int type );
void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
......@@ -296,7 +304,7 @@ public:
void SetToolbars();
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
private:
......@@ -406,7 +414,7 @@ public:
void ClickOnLibList( wxCommandEvent& event );
void ClickOnCmpList( wxCommandEvent& event );
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
private:
void SelectCurrentLibrary();
......
......@@ -82,6 +82,7 @@ public:
*/
void SetBOARD( BOARD* aBoard );
// General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
......@@ -93,7 +94,10 @@ public:
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar();
virtual BASE_SCREEN* GetScreen() { return (BASE_SCREEN*) m_CurrentScreen; }
PCB_SCREEN* GetScreen() const { return (PCB_SCREEN*) WinEDA_DrawFrame::GetBaseScreen(); }
BASE_SCREEN* GetBaseScreen() const;
int BestZoom();
void Show3D_Frame( wxCommandEvent& event );
......@@ -740,10 +744,9 @@ public:
int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
PCB_SCREEN* GetPCBScreen(){ return (PCB_SCREEN*)GetScreen(); }
EDA_BaseStruct* GerberGeneralLocateAndDisplay();
EDA_BaseStruct* Locate( int typeloc );
BOARD_ITEM* GerberGeneralLocateAndDisplay();
BOARD_ITEM* Locate( int typeloc );
void SetToolbars();
......
This diff is collapsed.
This diff is collapsed.
......@@ -118,7 +118,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
lay_tmp_TOP = Route_Layer_TOP;
OldPasRoute = g_GridRoutingSize;
g_GridRoutingSize = m_CurrentScreen->GetGrid().x;
g_GridRoutingSize = GetScreen()->GetGrid().x;
// Ensure g_GridRoutingSize has a reasonnable value:
if( g_GridRoutingSize < 10 )
......@@ -282,10 +282,10 @@ end_of_tst:
break;
/* placement du module */
CurrPosition = m_CurrentScreen->m_Curseur;
m_CurrentScreen->m_Curseur = PosOK;
CurrPosition = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = PosOK;
Place_Module( Module, DC );
m_CurrentScreen->m_Curseur = CurrPosition;
GetScreen()->m_Curseur = CurrPosition;
Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit();
......
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