Commit ceeb27cf authored by charras's avatar charras

eeschema: solved: incorrect draw origin setup for viewlib and libedit

parent e29d89c7
...@@ -110,7 +110,7 @@ SCH_SCREEN::SCH_SCREEN( KICAD_T type ) : BASE_SCREEN( type ) ...@@ -110,7 +110,7 @@ SCH_SCREEN::SCH_SCREEN( KICAD_T type ) : BASE_SCREEN( type )
SetGrid( wxSize( 50, 50 ) ); /* pas de la grille */ SetGrid( wxSize( 50, 50 ) ); /* pas de la grille */
m_UndoRedoCountMax = 10; m_UndoRedoCountMax = 10;
m_RefCount = 0; m_RefCount = 0;
m_Center = false; m_Center = false; // Suitable for schematic only. for libedit and viewlib, must be set to true
InitDatas(); InitDatas();
} }
......
...@@ -72,6 +72,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -72,6 +72,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon // Give an icon
SetIcon( wxIcon( libedit_xpm ) ); SetIcon( wxIcon( libedit_xpm ) );
SetBaseScreen( g_ScreenLib ); SetBaseScreen( g_ScreenLib );
GetScreen()->m_Center = true; // set to true to have the coordinates origine -0,0) centered on screen
GetSettings(); GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel ) if( DrawPanel )
...@@ -79,6 +80,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -79,6 +80,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateVToolbar(); ReCreateVToolbar();
DisplayLibInfos(); DisplayLibInfos();
BestZoom();
Show( TRUE ); Show( TRUE );
} }
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
/* viewlib_frame.cpp - fonctions des classes du type WinEDA_ViewlibFrame */ /* viewlib_frame.cpp - fonctions des classes du type WinEDA_ViewlibFrame */
/*************************************************************************/ /*************************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -23,41 +19,39 @@ ...@@ -23,41 +19,39 @@
/* class WinEDA_ViewlibFrame */ /* class WinEDA_ViewlibFrame */
/*****************************/ /*****************************/
BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow )
EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow ) EVT_SIZE( WinEDA_ViewlibFrame::OnSize )
EVT_SIZE( WinEDA_ViewlibFrame::OnSize ) EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate )
EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate )
EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT, EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA_DrawFrame::Process_Zoom ) WinEDA_DrawFrame::Process_Zoom )
EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) WinEDA_ViewlibFrame::ExportToSchematicLibraryPart )
EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList ) EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList )
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList ) EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList )
END_EVENT_TABLE() END_EVENT_TABLE()
/****************/ /******************************************************************************/
/* Constructeur */
/****************/
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
LibraryStruct* Library, LibraryStruct* Library,
wxSemaphore* semaphore ) : wxSemaphore* semaphore ) :
WinEDA_DrawFrame( father, VIEWER_FRAME, parent, _( "Library browser" ), WinEDA_DrawFrame( father, VIEWER_FRAME, parent, _( "Library browser" ),
wxDefaultPosition, wxDefaultSize ) wxDefaultPosition, wxDefaultSize )
/******************************************************************************/
{ {
m_FrameName = wxT( "ViewlibFrame" ); m_FrameName = wxT( "ViewlibFrame" );
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE to dispaly Axis
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee m_Draw_Grid = TRUE; // TRUE to display grid
// Give an icon // Give an icon
SetIcon( wxIcon( library_browse_xpm ) ); SetIcon( wxIcon( library_browse_xpm ) );
...@@ -69,7 +63,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -69,7 +63,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP ); SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
SetBaseScreen( new SCH_SCREEN() ); SetBaseScreen( new SCH_SCREEN() );
GetScreen()->SetZoom( 16 ); GetScreen()->m_Center = true; // set to true to have the coordinates origine -0,0) centered on screen
if( Library == NULL ) if( Library == NULL )
{ {
...@@ -78,8 +72,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -78,8 +72,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
m_LibList = new wxListBox( this, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ), m_LibList = new wxListBox( this, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ),
m_LibListSize, 0, NULL, wxLB_HSCROLL ); m_LibListSize, 0, NULL, wxLB_HSCROLL );
m_LibList->SetFont( *g_DialogFont ); m_LibList->SetFont( *g_DialogFont );
m_LibList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Library background listbox color (white) m_LibList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Library background listbox color (white)
m_LibList->SetForegroundColour( wxColour( 0, 0, 0 ) ); // Library foreground listbox color (black) m_LibList->SetForegroundColour( wxColour( 0, 0, 0 ) ); // Library foreground listbox color (black)
} }
else else
g_CurrentViewLibraryName = Library->m_Name; g_CurrentViewLibraryName = Library->m_Name;
...@@ -89,8 +83,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -89,8 +83,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
m_CmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST, wxPoint( m_LibListSize.x, 0 ), m_CmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST, wxPoint( m_LibListSize.x, 0 ),
m_CmpListSize, 0, NULL, wxLB_HSCROLL ); m_CmpListSize, 0, NULL, wxLB_HSCROLL );
m_CmpList->SetFont( *g_DialogFont ); m_CmpList->SetFont( *g_DialogFont );
m_CmpList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Component background listbox color (white) m_CmpList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Component background listbox color (white)
m_CmpList->SetForegroundColour( wxColour( 0, 0, 0 ) ); // Component foreground listbox color (black) m_CmpList->SetForegroundColour( wxColour( 0, 0, 0 ) ); // Component foreground listbox color (black)
GetSettings(); GetSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
...@@ -99,15 +93,14 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, ...@@ -99,15 +93,14 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
if( m_LibList ) if( m_LibList )
ReCreateListLib(); ReCreateListLib();
DisplayLibInfos(); DisplayLibInfos();
BestZoom();
Show( TRUE ); Show( TRUE );
} }
/***************/ /*******************************************/
/* Destructeur */
/***************/
WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame() WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
/*******************************************/
{ {
delete GetScreen(); delete GetScreen();
SetBaseScreen( 0 ); SetBaseScreen( 0 );
...@@ -176,9 +169,9 @@ void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv ) ...@@ -176,9 +169,9 @@ void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv )
} }
/*******************************************/ /***********************************/
int WinEDA_ViewlibFrame::BestZoom() int WinEDA_ViewlibFrame::BestZoom()
/*******************************************/ /***********************************/
{ {
int bestzoom, ii, jj; int bestzoom, ii, jj;
wxSize size, itemsize; wxSize size, itemsize;
...@@ -198,28 +191,21 @@ int WinEDA_ViewlibFrame::BestZoom() ...@@ -198,28 +191,21 @@ int WinEDA_ViewlibFrame::BestZoom()
EDA_Rect BoundaryBox = CurrentLibEntry->GetBoundaryBox( g_ViewUnit, g_ViewConvert ); EDA_Rect BoundaryBox = CurrentLibEntry->GetBoundaryBox( g_ViewUnit, g_ViewConvert );
itemsize = BoundaryBox.GetSize(); itemsize = BoundaryBox.GetSize();
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
size.x -= 60; // Pour marges haut et bas size.x -= 60; // sub a margin
ii = itemsize.x / size.x; ii = itemsize.x / size.x;
jj = itemsize.y / size.y; jj = itemsize.y / size.y;
ii = MAX( ii, jj ); bestzoom = MAX( ii, jj );
/* determination du zoom existant le plus proche */ GetScreen()->m_Curseur = BoundaryBox.Centre();
for( bestzoom = 1; bestzoom < 512; bestzoom <<= 1 )
{
if( bestzoom > ii )
break;
}
GetScreen()->m_Curseur = BoundaryBox.Centre();
return bestzoom; return bestzoom;
} }
/***************************************************/ /******************************************/
void WinEDA_ViewlibFrame::ReCreateListLib() void WinEDA_ViewlibFrame::ReCreateListLib()
/***************************************************/ /*******************************************/
{ {
const wxChar** ListNames, ** names; const wxChar** ListNames, ** names;
int ii; int ii;
...@@ -243,8 +229,8 @@ void WinEDA_ViewlibFrame::ReCreateListLib() ...@@ -243,8 +229,8 @@ void WinEDA_ViewlibFrame::ReCreateListLib()
free( ListNames ); free( ListNames );
/* Librairie courante peut etre non retrouv�e en liste /* Clear current library because it can be deleted after a config change
* (peut etre effac�e lors d'une modification de configuration) */ */
if( !found ) if( !found )
{ {
g_CurrentViewLibraryName.Empty(); g_CurrentViewLibraryName.Empty();
...@@ -269,8 +255,8 @@ void WinEDA_ViewlibFrame::ReCreateListCmp() ...@@ -269,8 +255,8 @@ void WinEDA_ViewlibFrame::ReCreateListCmp()
m_CmpList->Clear(); m_CmpList->Clear();
ii = 0; ii = 0;
g_CurrentViewComponentName.Empty(); g_CurrentViewComponentName.Empty();
g_ViewConvert = 1; /* Vue normal / convert */ g_ViewConvert = 1; /* Select normal/"de morgan" shape */
g_ViewUnit = 1; /* unit� a afficher (A, B ..) */ g_ViewUnit = 1; /* Selec unit to display for multiple parts per package */
if( Library ) if( Library )
LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE ); LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE );
while( LibEntry ) while( LibEntry )
...@@ -325,7 +311,7 @@ void WinEDA_ViewlibFrame::ClickOnCmpList( wxCommandEvent& event ) ...@@ -325,7 +311,7 @@ void WinEDA_ViewlibFrame::ClickOnCmpList( wxCommandEvent& event )
void WinEDA_ViewlibFrame::ExportToSchematicLibraryPart( wxCommandEvent& event ) void WinEDA_ViewlibFrame::ExportToSchematicLibraryPart( wxCommandEvent& event )
/****************************************************************************/ /****************************************************************************/
/* Export to schematic the current viewed component, and close the library browser /* Export the current component to schematic and close the library browser
*/ */
{ {
int ii = m_CmpList->GetSelection(); int ii = m_CmpList->GetSelection();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/****************************/ /****************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" //#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
......
...@@ -23,8 +23,8 @@ class SCH_ITEM; ...@@ -23,8 +23,8 @@ class SCH_ITEM;
class GRID_TYPE class GRID_TYPE
{ {
public: public:
int m_Id; int m_Id;
wxSize m_Size; wxSize m_Size;
}; };
...@@ -65,9 +65,9 @@ public: ...@@ -65,9 +65,9 @@ public:
int m_CursorLevel; // Index for cursor redraw in XOR mode int m_CursorLevel; // Index for cursor redraw in XOR mode
/* Cursor management (used in editing functions) */ /* Cursor management (used in editing functions) */
void (*ManageCurseur)(WinEDA_DrawPanel * panel, wxDC * DC, bool erase);/* Fonction d'affichage sur deplacement souris void (*ManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); /* Fonction d'affichage sur deplacement souris
* si erase : effacement ancien affichage */ * si erase : effacement ancien affichage */
void (*ForceCloseManageCurseur)(WinEDA_DrawPanel * panel, wxDC * DC);/* Fonction de fermeture forc� void (*ForceCloseManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC ); /* Fonction de fermeture forc�
* de la fonction ManageCurseur */ * de la fonction ManageCurseur */
public: public:
...@@ -80,42 +80,42 @@ public: ...@@ -80,42 +80,42 @@ public:
BASE_SCREEN* GetScreen(); BASE_SCREEN* GetScreen();
void PrepareGraphicContext( wxDC* DC ); void PrepareGraphicContext( wxDC* DC );
wxPoint CalcAbsolutePosition( const wxPoint& rel_pos ); wxPoint CalcAbsolutePosition( const wxPoint& rel_pos );
bool IsPointOnDisplay( wxPoint ref_pos ); bool IsPointOnDisplay( wxPoint ref_pos );
void OnPaint( wxPaintEvent& event ); void OnPaint( wxPaintEvent& event );
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
void SetBoundaryBox(); void SetBoundaryBox();
void ReDraw( wxDC* DC, bool erasebg = TRUE ); void ReDraw( wxDC* DC, bool erasebg = TRUE );
void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, bool aPrintMirrorMode ); void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, bool aPrintMirrorMode );
void DrawBackGround( wxDC* DC ); void DrawBackGround( wxDC* DC );
void m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode ); void m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode );
void OnEraseBackground( wxEraseEvent& event ); void OnEraseBackground( wxEraseEvent& event );
void OnActivate( wxActivateEvent& event ); void OnActivate( wxActivateEvent& event );
/* Mouse and keys events */ /* Mouse and keys events */
void OnMouseEvent( wxMouseEvent& event ); void OnMouseEvent( wxMouseEvent& event );
void OnMouseLeaving( wxMouseEvent& event ); void OnMouseLeaving( wxMouseEvent& event );
void OnKeyEvent( wxKeyEvent& event ); void OnKeyEvent( wxKeyEvent& event );
/*************************/ /*************************/
void EraseScreen( wxDC* DC ); void EraseScreen( wxDC* DC );
void OnScrollWin( wxCommandEvent& event ); void OnScrollWin( wxCommandEvent& event );
void OnScroll( wxScrollWinEvent& event ); void OnScroll( wxScrollWinEvent& event );
void SetZoom( int mode ); void SetZoom( int mode );
int GetZoom(); int GetZoom();
void SetGrid( const wxSize& size ); void SetGrid( const wxSize& size );
wxSize GetGrid(); wxSize GetGrid();
void AddMenuZoom( wxMenu* MasterMenu ); void AddMenuZoom( wxMenu* MasterMenu );
bool OnRightClick( wxMouseEvent& event ); bool OnRightClick( wxMouseEvent& event );
void Process_Popup_Zoom( wxCommandEvent& event ); void Process_Popup_Zoom( wxCommandEvent& event );
void OnPopupGridSelect( wxCommandEvent& event ); void OnPopupGridSelect( wxCommandEvent& event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
wxPoint CursorScreenPosition(); wxPoint CursorScreenPosition();
/** /**
* Function PostDirtyRect * Function PostDirtyRect
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
* (vertical and horizontal edges only), and it must be [,) in nature, i.e. * (vertical and horizontal edges only), and it must be [,) in nature, i.e.
* [pos, dim) == [inclusive, exclusive) * [pos, dim) == [inclusive, exclusive)
*/ */
void PostDirtyRect( EDA_Rect aRect ); void PostDirtyRect( EDA_Rect aRect );
/** /**
* Function ConvertPcbUnitsToPixelsUnits * Function ConvertPcbUnitsToPixelsUnits
...@@ -136,7 +136,7 @@ public: ...@@ -136,7 +136,7 @@ public:
* corner of draw area) according to the current scroll and zoom. * corner of draw area) according to the current scroll and zoom.
* @param aRect = the rectangle to convert * @param aRect = the rectangle to convert
*/ */
void ConvertPcbUnitsToPixelsUnits( EDA_Rect* aRect ); void ConvertPcbUnitsToPixelsUnits( EDA_Rect* aRect );
/** /**
* Function ConvertPcbUnitsToPixelsUnits * Function ConvertPcbUnitsToPixelsUnits
...@@ -144,17 +144,17 @@ public: ...@@ -144,17 +144,17 @@ public:
* relative to the current draw area (origin 0,0 is the left top visible * relative to the current draw area (origin 0,0 is the left top visible
* corner of draw area) according to the current scroll and zoom. * corner of draw area) according to the current scroll and zoom.
* @param aPosition = the position to convert * @param aPosition = the position to convert
*/ */
void ConvertPcbUnitsToPixelsUnits( wxPoint* aPosition ); void ConvertPcbUnitsToPixelsUnits( wxPoint* aPosition );
wxPoint GetScreenCenterRealPosition( void ); wxPoint GetScreenCenterRealPosition( void );
void MouseToCursorSchema(); void MouseToCursorSchema();
void MouseTo( const wxPoint& Mouse ); void MouseTo( const wxPoint& Mouse );
/* Cursor functions */ /* Cursor functions */
void Trace_Curseur( wxDC* DC, int color = WHITE ); // Draw the user cursor (grid cursor) void Trace_Curseur( wxDC* DC, int color = WHITE ); // Draw the user cursor (grid cursor)
void CursorOff( wxDC* DC ); // remove the grid cursor from the display void CursorOff( wxDC* DC ); // remove the grid cursor from the display
void CursorOn( wxDC* DC ); // display the grid cursor void CursorOn( wxDC* DC ); // display the grid cursor
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
...@@ -170,7 +170,6 @@ typedef enum { /* definition de l'etat du block */ ...@@ -170,7 +170,6 @@ typedef enum { /* definition de l'etat du block */
STATE_BLOCK_END, /* Block initialise: 2eme point defini */ STATE_BLOCK_END, /* Block initialise: 2eme point defini */
STATE_BLOCK_MOVE, /* Block en deplacement */ STATE_BLOCK_MOVE, /* Block en deplacement */
STATE_BLOCK_STOP /* Block fixe (fin de deplacement) */ STATE_BLOCK_STOP /* Block fixe (fin de deplacement) */
} BlockState; } BlockState;
/* codes des differentes commandes sur block: */ /* codes des differentes commandes sur block: */
...@@ -190,7 +189,6 @@ typedef enum { ...@@ -190,7 +189,6 @@ typedef enum {
BLOCK_SELECT_ITEMS_ONLY, BLOCK_SELECT_ITEMS_ONLY,
BLOCK_MIRROR_X, BLOCK_MIRROR_X,
BLOCK_MIRROR_Y BLOCK_MIRROR_Y
} CmdBlockType; } CmdBlockType;
...@@ -203,15 +201,15 @@ public: ...@@ -203,15 +201,15 @@ public:
* selectionnee dans le bloc */ * selectionnee dans le bloc */
int m_Color; /* Block Color */ int m_Color; /* Block Color */
wxPoint m_MoveVector; /* Move distance in move, drag, copy ... command */ wxPoint m_MoveVector; /* Move distance in move, drag, copy ... command */
wxPoint m_BlockLastCursorPosition;/* Last Mouse position in block command wxPoint m_BlockLastCursorPosition; /* Last Mouse position in block command
* = last cursor position in move commands * = last cursor position in move commands
* = 0,0 in block paste */ * = 0,0 in block paste */
public: public:
DrawBlockStruct(); DrawBlockStruct();
~DrawBlockStruct(); ~DrawBlockStruct();
void SetMessageBlock( WinEDA_DrawFrame* frame ); void SetMessageBlock( WinEDA_DrawFrame* frame );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC );
}; };
...@@ -221,28 +219,31 @@ public: ...@@ -221,28 +219,31 @@ public:
class BASE_SCREEN : public EDA_BaseStruct class BASE_SCREEN : public EDA_BaseStruct
{ {
public: public:
wxPoint m_DrawOrg; /* offsets pour tracer le circuit sur l'ecran */ wxPoint m_DrawOrg; /* offsets pour tracer le circuit sur l'ecran */
wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user units. */ wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user units. */
wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user units. */ wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user units. */
wxPoint m_MousePositionInPixels; /* Mouse cursor coordinate (off grid) in pixels. */ wxPoint m_MousePositionInPixels; /* Mouse cursor coordinate (off grid) in pixels. */
wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid) in user units. wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid) in user units.
* (coordinates from last reset position)*/ * (coordinates from last reset position)*/
wxPoint m_ScrollbarPos; // Position effective des Curseurs de scroll wxPoint m_ScrollbarPos; // Position effective des Curseurs de scroll
wxSize m_ScrollbarNumber; /* Valeur effective des Nombres de Scrool wxSize m_ScrollbarNumber; /* Valeur effective des Nombres de Scrool
* c.a.d taille en unites de scroll de la surface totale affichable */ * c.a.d taille en unites de scroll de la surface totale affichable */
wxPoint m_StartVisu; // Coord absolues du 1er pixel visualis�a l'ecran (en nombre de pixels) wxPoint m_StartVisu; // Coord absolues du 1er pixel visualis�a l'ecran (en nombre de pixels)
wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu
* Utile pour recadrer les affichages lors de la * Utile pour recadrer les affichages lors de la
* navigation dans la hierarchie */ * navigation dans la hierarchie */
bool m_Center; // TRUE: coord algebriques, FALSE: coord >= 0 bool m_Center; /* fix the coordinate (0,0) position on screen : if TRUE (0,0) in centered on screen
* TRUE: when coordiantaes can be < 0 and > 0 all but schematic
* FALSE: when coordinates can be only >= 0 Schematic
*/
bool m_FirstRedraw; bool m_FirstRedraw;
/* Gestion des editions */ /* Gestion des editions */
SCH_ITEM * EEDrawList; /* Object list (main data) for schematic */ SCH_ITEM* EEDrawList; /* Object list (main data) for schematic */
EDA_BaseStruct * m_UndoList; /* Object list for the undo command (old data) */ EDA_BaseStruct* m_UndoList; /* Object list for the undo command (old data) */
EDA_BaseStruct * m_RedoList; /* Object list for the redo command (old data) */ EDA_BaseStruct* m_RedoList; /* Object list for the redo command (old data) */
int m_UndoRedoCountMax; /* undo/Redo command Max depth */ int m_UndoRedoCountMax; /* undo/Redo command Max depth */
/* block control */ /* block control */
DrawBlockStruct BlockLocate; /* Bock description for block commands */ DrawBlockStruct BlockLocate; /* Bock description for block commands */
...@@ -271,13 +272,13 @@ private: ...@@ -271,13 +272,13 @@ private:
/* Valeurs du pas de grille et du zoom */ /* Valeurs du pas de grille et du zoom */
public: public:
wxSize m_Grid; /* Current grid. */ wxSize m_Grid; /* Current grid. */
GridArray m_GridList; GridArray m_GridList;
bool m_UserGridIsON; bool m_UserGridIsON;
int m_Diviseur_Grille; int m_Diviseur_Grille;
int* m_ZoomList; /* Liste des coefficients standard de zoom */ int* m_ZoomList; /* Liste des coefficients standard de zoom */
int m_Zoom; /* coeff de ZOOM */ int m_Zoom; /* coeff de ZOOM */
public: public:
BASE_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE ); BASE_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE );
...@@ -322,38 +323,39 @@ public: ...@@ -322,38 +323,39 @@ public:
//----<zoom stuff>---------------------------------------------------------- //----<zoom stuff>----------------------------------------------------------
/** /**
* Function GetZoom * Function GetZoom
* returns the current zoom factor * returns the current zoom factor
*/ */
int GetZoom() const; int GetZoom() const;
/** /**
* Function SetZoom * Function SetZoom
* adjusts the current zoom factor * adjusts the current zoom factor
*/ */
void SetZoom( int coeff ); void SetZoom( int coeff );
/** /**
* Function SetZoomList * Function SetZoomList
* sets the list of zoom factors. * sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero terminated * @param aZoomList An array of zoom factors in ascending order, zero terminated
*/ */
void SetZoomList( const int* zoomlist ); void SetZoomList( const int* zoomlist );
void SetNextZoom(); /* ajuste le prochain coeff de zoom */ void SetNextZoom(); /* ajuste le prochain coeff de zoom */
void SetPreviousZoom(); /* ajuste le precedent coeff de zoom */ void SetPreviousZoom(); /* ajuste le precedent coeff de zoom */
void SetFirstZoom(); /* ajuste le coeff de zoom a 1*/ void SetFirstZoom(); /* ajuste le coeff de zoom a 1*/
void SetLastZoom(); /* ajuste le coeff de zoom au max */ void SetLastZoom(); /* ajuste le coeff de zoom au max */
//----<grid stuff>---------------------------------------------------------- //----<grid stuff>----------------------------------------------------------
wxSize GetGrid(); /* retourne la grille */ wxSize GetGrid(); /* retourne la grille */
void SetGrid( const wxSize& size ); void SetGrid( const wxSize& size );
void SetGrid( int ); void SetGrid( int );
void SetGridList( GridArray& sizelist ); void SetGridList( GridArray& sizelist );
void AddGrid( const GRID_TYPE& grid ); void AddGrid( const GRID_TYPE& grid );
void AddGrid( const wxSize& size, int id ); void AddGrid( const wxSize& size, int id );
void AddGrid( const wxRealPoint& size, int units, int id ); void AddGrid( const wxRealPoint& size, int units, int id );
/** /**
...@@ -380,7 +382,9 @@ public: ...@@ -380,7 +382,9 @@ public:
return wxT( "BASE_SCREEN" ); return wxT( "BASE_SCREEN" );
} }
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
...@@ -389,8 +393,8 @@ public: ...@@ -389,8 +393,8 @@ public:
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif
#endif
}; };
......
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