mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-19 12:31:41 +00:00
GetScreen() work, menu capitalization, beautifying
This commit is contained in:
parent
25d0403221
commit
721d878fcf
change_log.txt
common
cvpcb
eeschema
block.cppblock_libedit.cppbus-wire-junction.cppbusentry.cppclass_drawsheet.cppclass_drawsheet.hclass_screen.cppclass_text-label.cppclass_text-label.hcomponent_class.cppcomponent_class.hcontrole.cppdialog_options.cppedit_component_in_schematic.cppedit_label.cppeeredraw.cppgetpart.cpphotkeys.cpplibfield.cpplibframe.cpponrightclick.cpppinedit.cppplothpgl.cppschedit.cppschframe.cppsheet.cppsheetlab.cppsymbdraw.cppviewlib_frame.cpp
gerbview
block.cppcontrole.cppdcode.cppedit.cppfiles.cppgerberframe.cppinitpcb.cpplocate.cpponrightclick.cppreadgerb.cpprs274d.cpptool_gerber.cpp
include
class_screen.hdrawpanel_wxstruct.hpcbstruct.hsch_item_struct.hwxEeschemaStruct.hwxPcbStruct.hwxstruct.h
pcbnew
automove.cppautoplac.cppbasepcbframe.cppblock.cppblock_module_editor.cppclass_board.cppclass_edge_mod.cppclass_pad.cppclean.cppcontrole.cppcotation.cppdialog_drc.cppedit.cppgen_modules_placefile.cppgen_self.hgendrill.cppioascii.cpplibrairi.cpploadcmp.cppmodedit.cppmodedit_onclick.cppmoduleframe.cppmodules.cppmuonde.cppnetlist.cpponrightclick.cpppcbframe.cpppcbtexte.cppplothpgl.cppplotps.cpprouter.cppsel_layer.cppswap_layers.cpptracepcb.cppxchgmod.cpp
share
@ -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;
|
||||
}
|
||||
|
250
cvpcb/cvstruct.h
250
cvpcb/cvstruct.h
@ -1,7 +1,7 @@
|
||||
/***********************************************************/
|
||||
/* wxstruct.h: */
|
||||
/* descriptions des principales classes derivees utilisees */
|
||||
/***********************************************************/
|
||||
/***********************************************************/
|
||||
/* wxstruct.h: */
|
||||
/* descriptions des principales classes derivees utilisees */
|
||||
/***********************************************************/
|
||||
|
||||
#ifndef CVSTRUCT_H
|
||||
#define CVSTRUCT_H
|
||||
@ -21,191 +21,191 @@ class STORECMP;
|
||||
|
||||
#define LIST_BOX_TYPE wxListView
|
||||
|
||||
/******************************************************/
|
||||
/* classe derivee pour la Fenetre principale de cvpcb */
|
||||
/******************************************************/
|
||||
/******************************************************/
|
||||
/* classe derivee pour la Fenetre principale de cvpcb */
|
||||
/******************************************************/
|
||||
|
||||
class WinEDA_CvpcbFrame: public WinEDA_BasicFrame
|
||||
class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
|
||||
{
|
||||
public:
|
||||
|
||||
FootprintListBox * m_FootprintList;
|
||||
ListBoxCmp * m_ListCmp;
|
||||
WinEDA_DisplayFrame * DrawFrame;
|
||||
WinEDA_Toolbar * m_HToolBar; // Toolbar horizontal haut d'ecran
|
||||
FootprintListBox* m_FootprintList;
|
||||
ListBoxCmp* m_ListCmp;
|
||||
WinEDA_DisplayFrame* DrawFrame;
|
||||
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
|
||||
|
||||
private:
|
||||
wxMenu * m_FilesMenu;
|
||||
wxMenu* m_FilesMenu;
|
||||
|
||||
// Constructor and destructor
|
||||
// Constructor and destructor
|
||||
public:
|
||||
WinEDA_CvpcbFrame(WinEDA_App * parent, const wxString & title,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE);
|
||||
~WinEDA_CvpcbFrame();
|
||||
WinEDA_CvpcbFrame( WinEDA_App * parent, const wxString &title,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||
~WinEDA_CvpcbFrame();
|
||||
|
||||
void OnLeftClick(wxListEvent & event);
|
||||
void OnLeftDClick(wxListEvent & event);
|
||||
void OnSelectComponent(wxListEvent & event);
|
||||
void OnLeftClick( wxListEvent& event );
|
||||
void OnLeftDClick( wxListEvent& event );
|
||||
void OnSelectComponent( wxListEvent& event );
|
||||
|
||||
void Update_Config(wxCommandEvent& event);/* enregistrement de la config */
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent & Event);
|
||||
void OnSize(wxSizeEvent& SizeEvent);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void ReCreateHToolbar();
|
||||
virtual void ReCreateMenuBar();
|
||||
void SetLanguage(wxCommandEvent& event);
|
||||
void AddFontSelectionMenu(wxMenu * main_menu);
|
||||
void ProcessFontPreferences(wxCommandEvent& event);
|
||||
void Update_Config( wxCommandEvent& event ); /* enregistrement de la config */
|
||||
void OnQuit( wxCommandEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
void OnSize( wxSizeEvent& SizeEvent );
|
||||
void OnChar( wxKeyEvent& event );
|
||||
void ReCreateHToolbar();
|
||||
virtual void ReCreateMenuBar();
|
||||
void SetLanguage( wxCommandEvent& event );
|
||||
void AddFontSelectionMenu( wxMenu* main_menu );
|
||||
void ProcessFontPreferences( wxCommandEvent& event );
|
||||
|
||||
void ToFirstNA(wxCommandEvent& event);
|
||||
void ToPreviousNA(wxCommandEvent& event);
|
||||
void DelAssociations(wxCommandEvent& event);
|
||||
void SaveQuitCvpcb(wxCommandEvent& event);
|
||||
void LoadNetList(wxCommandEvent& event);
|
||||
void ConfigCvpcb(wxCommandEvent& event);
|
||||
void DisplayModule(wxCommandEvent& event);
|
||||
void AssocieModule(wxCommandEvent& event);
|
||||
void WriteStuffList(wxCommandEvent & event);
|
||||
void DisplayDocFile(wxCommandEvent & event);
|
||||
void OnSelectFilteringFootprint(wxCommandEvent & event);
|
||||
void SetNewPkg(const wxString & package);
|
||||
void BuildCmpListBox();
|
||||
void BuildFootprintListBox();
|
||||
void CreateScreenCmp();
|
||||
void CreateConfigWindow();
|
||||
int SaveNetList(const wxString & FullFileName);
|
||||
int SaveComponentList(const wxString & FullFileName);
|
||||
bool ReadInputNetList(const wxString & FullFileName);
|
||||
void ReadNetListe();
|
||||
int rdpcad();
|
||||
int ReadSchematicNetlist();
|
||||
int ReadFootprintFilterList( FILE * f);
|
||||
int ReadViewlogicWirList();
|
||||
int ReadViewlogicNetList();
|
||||
void ToFirstNA( wxCommandEvent& event );
|
||||
void ToPreviousNA( wxCommandEvent& event );
|
||||
void DelAssociations( wxCommandEvent& event );
|
||||
void SaveQuitCvpcb( wxCommandEvent& event );
|
||||
void LoadNetList( wxCommandEvent& event );
|
||||
void ConfigCvpcb( wxCommandEvent& event );
|
||||
void DisplayModule( wxCommandEvent& event );
|
||||
void AssocieModule( wxCommandEvent& event );
|
||||
void WriteStuffList( wxCommandEvent& event );
|
||||
void DisplayDocFile( wxCommandEvent& event );
|
||||
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
||||
void SetNewPkg( const wxString& package );
|
||||
void BuildCmpListBox();
|
||||
void BuildFootprintListBox();
|
||||
void CreateScreenCmp();
|
||||
void CreateConfigWindow();
|
||||
int SaveNetList( const wxString& FullFileName );
|
||||
int SaveComponentList( const wxString& FullFileName );
|
||||
bool ReadInputNetList( const wxString& FullFileName );
|
||||
void ReadNetListe();
|
||||
int rdpcad();
|
||||
int ReadSchematicNetlist();
|
||||
int ReadFootprintFilterList( FILE* f );
|
||||
int ReadViewlogicWirList();
|
||||
int ReadViewlogicNetList();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/* ListBox derivee pour l'affichage des listes */
|
||||
/***********************************************/
|
||||
class ListBoxBase: public LIST_BOX_TYPE
|
||||
class ListBoxBase : public LIST_BOX_TYPE
|
||||
{
|
||||
public:
|
||||
WinEDA_CvpcbFrame * m_Parent;
|
||||
WinEDA_CvpcbFrame* m_Parent;
|
||||
|
||||
public:
|
||||
|
||||
ListBoxBase(WinEDA_CvpcbFrame * parent, wxWindowID id,
|
||||
const wxPoint& loc, const wxSize& size);
|
||||
ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id,
|
||||
const wxPoint &loc, const wxSize &size );
|
||||
|
||||
~ListBoxBase();
|
||||
~ListBoxBase();
|
||||
|
||||
int GetSelection();
|
||||
void OnSize(wxSizeEvent& event);
|
||||
int GetSelection();
|
||||
void OnSize( wxSizeEvent& event );
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
/* ListBox derivee pour l'affichage de la liste des Modules */
|
||||
/************************************************************/
|
||||
|
||||
class FootprintListBox: public ListBoxBase
|
||||
class FootprintListBox : public ListBoxBase
|
||||
{
|
||||
private:
|
||||
wxArrayString m_FullFootprintList;
|
||||
wxArrayString m_FilteredFootprintList;
|
||||
wxArrayString m_FullFootprintList;
|
||||
wxArrayString m_FilteredFootprintList;
|
||||
public:
|
||||
wxArrayString * m_ActiveFootprintList;
|
||||
bool m_UseFootprintFullList;
|
||||
wxArrayString* m_ActiveFootprintList;
|
||||
bool m_UseFootprintFullList;
|
||||
|
||||
public:
|
||||
FootprintListBox(WinEDA_CvpcbFrame * parent,
|
||||
wxWindowID id, const wxPoint& loc, const wxSize& size,
|
||||
int nbitems, wxString choice[]);
|
||||
~FootprintListBox();
|
||||
FootprintListBox( WinEDA_CvpcbFrame * parent,
|
||||
wxWindowID id, const wxPoint &loc, const wxSize &size,
|
||||
int nbitems, wxString choice[] );
|
||||
~FootprintListBox();
|
||||
|
||||
int GetCount();
|
||||
void SetSelection(unsigned index, bool State = TRUE);
|
||||
void SetString(unsigned linecount, const wxString & text);
|
||||
void AppendLine(const wxString & text);
|
||||
void SetFootprintFullList();
|
||||
void SetFootprintFilteredList(STORECMP * Component);
|
||||
void SetActiveFootprintList(bool FullList, bool Redraw = FALSE);
|
||||
int GetCount();
|
||||
void SetSelection( unsigned index, bool State = TRUE );
|
||||
void SetString( unsigned linecount, const wxString& text );
|
||||
void AppendLine( const wxString& text );
|
||||
void SetFootprintFullList();
|
||||
void SetFootprintFilteredList( STORECMP* Component );
|
||||
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
|
||||
|
||||
wxString GetSelectedFootprint();
|
||||
wxString OnGetItemText(long item, long column) const;
|
||||
void OnLeftClick(wxListEvent & event);
|
||||
void OnLeftDClick(wxListEvent & event);
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxString GetSelectedFootprint();
|
||||
wxString OnGetItemText( long item, long column ) const;
|
||||
void OnLeftClick( wxListEvent& event );
|
||||
void OnLeftDClick( wxListEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
/***************************************************************/
|
||||
/* ListBox derivee pour l'affichage de la liste des Composants */
|
||||
/***************************************************************/
|
||||
|
||||
class ListBoxCmp: public ListBoxBase
|
||||
class ListBoxCmp : public ListBoxBase
|
||||
{
|
||||
public:
|
||||
wxArrayString m_ComponentList;
|
||||
WinEDA_CvpcbFrame * m_Parent;
|
||||
wxArrayString m_ComponentList;
|
||||
WinEDA_CvpcbFrame* m_Parent;
|
||||
|
||||
public:
|
||||
|
||||
ListBoxCmp(WinEDA_CvpcbFrame * parent, wxWindowID id,
|
||||
const wxPoint& loc, const wxSize& size,
|
||||
int nbitems, wxString choice[]);
|
||||
ListBoxCmp( WinEDA_CvpcbFrame * parent, wxWindowID id,
|
||||
const wxPoint &loc, const wxSize &size,
|
||||
int nbitems, wxString choice[] );
|
||||
|
||||
~ListBoxCmp();
|
||||
~ListBoxCmp();
|
||||
|
||||
void Clear();
|
||||
int GetCount();
|
||||
wxString OnGetItemText(long item, long column) const;
|
||||
void SetSelection(unsigned index, bool State = TRUE);
|
||||
void SetString(unsigned linecount, const wxString & text);
|
||||
void AppendLine(const wxString & text);
|
||||
void Clear();
|
||||
int GetCount();
|
||||
wxString OnGetItemText( long item, long column ) const;
|
||||
void SetSelection( unsigned index, bool State = TRUE );
|
||||
void SetString( unsigned linecount, const wxString& text );
|
||||
void AppendLine( const wxString& text );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************/
|
||||
/* class WWinEDA_DisplayFrame: public WinEDA_DrawFrame */
|
||||
/*******************************************************/
|
||||
/*******************************************************/
|
||||
/* class WWinEDA_DisplayFrame: public WinEDA_DrawFrame */
|
||||
/*******************************************************/
|
||||
|
||||
class WinEDA_DisplayFrame: public WinEDA_BasePcbFrame
|
||||
class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
|
||||
{
|
||||
public:
|
||||
|
||||
public:
|
||||
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App *parent,
|
||||
const wxString & title,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE);
|
||||
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App * parent,
|
||||
const wxString &title,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||
|
||||
~WinEDA_DisplayFrame();
|
||||
~WinEDA_DisplayFrame();
|
||||
|
||||
void OnCloseWindow(wxCloseEvent & Event);
|
||||
void Process_Special_Functions(wxCommandEvent& event);
|
||||
void RedrawActiveWindow(wxDC * DC, bool EraseBg);
|
||||
void ReCreateHToolbar();
|
||||
void ReCreateVToolbar();
|
||||
void RecreateMenuBar();
|
||||
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
|
||||
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
|
||||
bool OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
|
||||
void SetToolbars();
|
||||
void GeneralControle( wxDC* DC, wxPoint Mouse );
|
||||
void InstallOptionsDisplay(wxCommandEvent& event);
|
||||
MODULE * Get_Module(const wxString & CmpName);
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
void Process_Special_Functions( wxCommandEvent& event );
|
||||
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
||||
void ReCreateHToolbar();
|
||||
void ReCreateVToolbar();
|
||||
void RecreateMenuBar();
|
||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
||||
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
||||
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
||||
void SetToolbars();
|
||||
void GeneralControle( wxDC* DC, wxPoint Mouse );
|
||||
void InstallOptionsDisplay( wxCommandEvent& event );
|
||||
MODULE* Get_Module( const wxString& CmpName );
|
||||
|
||||
void Process_Settings(wxCommandEvent& event);
|
||||
void Show3D_Frame(wxCommandEvent& event);
|
||||
void Process_Settings( wxCommandEvent& event );
|
||||
void Show3D_Frame( wxCommandEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
#endif //#ifndef CVSTRUCT_H
|
||||
|
||||
#endif //#ifndef CVSTRUCT_H
|
||||
|
@ -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 )
|
||||
|
@ -1,17 +1,18 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Name: dialog_options.cpp
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
// Author: jean-pierre Charras
|
||||
// Modified by:
|
||||
// Modified by:
|
||||
// Created: 31/01/2006 13:27:33
|
||||
// RCS-ID:
|
||||
// RCS-ID:
|
||||
// Copyright: GNU Licence
|
||||
// Licence: GNU
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Generated by DialogBlocks (unregistered), 31/01/2006 13:27:33
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
|
||||
#pragma implementation "dialog_options.h"
|
||||
#endif
|
||||
|
||||
@ -47,14 +48,14 @@
|
||||
////@end XPM images
|
||||
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
void DisplayOptionFrame(WinEDA_DrawFrame * parent, const wxPoint & framepos)
|
||||
void DisplayOptionFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos )
|
||||
/**************************************************************************/
|
||||
{
|
||||
WinEDA_SetOptionsFrame * frame =
|
||||
new WinEDA_SetOptionsFrame(parent);
|
||||
frame->ShowModal(); frame->Destroy();
|
||||
WinEDA_SetOptionsFrame* frame =
|
||||
new WinEDA_SetOptionsFrame( parent );
|
||||
|
||||
frame->ShowModal(); frame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
@ -71,9 +72,9 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_SetOptionsFrame, wxDialog )
|
||||
BEGIN_EVENT_TABLE( WinEDA_SetOptionsFrame, wxDialog )
|
||||
|
||||
////@begin WinEDA_SetOptionsFrame event table entries
|
||||
EVT_BUTTON( wxID_OK, WinEDA_SetOptionsFrame::OnOkClick )
|
||||
EVT_BUTTON( wxID_OK, WinEDA_SetOptionsFrame::OnOkClick )
|
||||
|
||||
EVT_BUTTON( wxID_CANCEL, WinEDA_SetOptionsFrame::OnCancelClick )
|
||||
EVT_BUTTON( wxID_CANCEL, WinEDA_SetOptionsFrame::OnCancelClick )
|
||||
|
||||
////@end WinEDA_SetOptionsFrame event table entries
|
||||
|
||||
@ -83,236 +84,336 @@ END_EVENT_TABLE()
|
||||
* WinEDA_SetOptionsFrame constructors
|
||||
*/
|
||||
|
||||
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( )
|
||||
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame()
|
||||
{
|
||||
}
|
||||
|
||||
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( WinEDA_DrawFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
||||
|
||||
WinEDA_SetOptionsFrame::WinEDA_SetOptionsFrame( WinEDA_DrawFrame* parent,
|
||||
wxWindowID id,
|
||||
const wxString& caption,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style )
|
||||
{
|
||||
m_Parent = parent;
|
||||
Create(parent, id, caption, pos, size, style);
|
||||
|
||||
/* Init options */
|
||||
if ( m_Parent->GetScreen() )
|
||||
{
|
||||
switch( m_Parent->GetScreen()->GetGrid().x )
|
||||
{
|
||||
case 50:
|
||||
m_SelGridSize->SetSelection(0);
|
||||
break;
|
||||
m_Parent = parent;
|
||||
Create( parent, id, caption, pos, size, style );
|
||||
|
||||
case 25:
|
||||
m_SelGridSize->SetSelection(1);
|
||||
break;
|
||||
BASE_SCREEN* screen = m_Parent->GetBaseScreen();
|
||||
|
||||
case 10:
|
||||
m_SelGridSize->SetSelection(2);
|
||||
break;
|
||||
/* Init options */
|
||||
if( screen )
|
||||
{
|
||||
switch( screen->GetGrid().x )
|
||||
{
|
||||
case 50:
|
||||
m_SelGridSize->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case 5:
|
||||
m_SelGridSize->SetSelection(3);
|
||||
break;
|
||||
case 25:
|
||||
m_SelGridSize->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_SelGridSize->SetSelection(4);
|
||||
break;
|
||||
case 10:
|
||||
m_SelGridSize->SetSelection( 2 );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_SelGridSize->SetSelection(5);
|
||||
break;
|
||||
case 5:
|
||||
m_SelGridSize->SetSelection( 3 );
|
||||
break;
|
||||
|
||||
default:
|
||||
DisplayError(this, wxT("WinEDA_SetOptionsFrame: Grid value not handle"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Adjust the current selections and options: */
|
||||
m_ShowGridOpt->SetValue(m_Parent->m_Draw_Grid);
|
||||
m_AutoPANOpt->SetValue(m_Parent->DrawPanel-> m_AutoPAN_Enable);
|
||||
m_SelShowPins->SetSelection( g_ShowAllPins ? TRUE : FALSE);
|
||||
m_Selunits->SetSelection( g_UnitMetric ? 0 : 1);
|
||||
m_SelDirWires->SetSelection( g_HVLines ? 0 : 1);
|
||||
m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1);
|
||||
wxString msg;
|
||||
msg = ReturnStringFromValue( g_UnitMetric,g_RepeatStep.x, m_Parent->m_InternalUnits);
|
||||
m_DeltaStepCtrl_X->SetValue( msg );
|
||||
wxString title = _("Delta Step X") + ReturnUnitSymbol(g_UnitMetric);
|
||||
case 2:
|
||||
m_SelGridSize->SetSelection( 4 );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_SelGridSize->SetSelection( 5 );
|
||||
break;
|
||||
|
||||
default:
|
||||
DisplayError( this, wxT( "WinEDA_SetOptionsFrame: Grid value not handle" ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Adjust the current selections and options: */
|
||||
m_ShowGridOpt->SetValue( m_Parent->m_Draw_Grid );
|
||||
m_AutoPANOpt->SetValue( m_Parent->DrawPanel->m_AutoPAN_Enable );
|
||||
m_SelShowPins->SetSelection( g_ShowAllPins ? TRUE : FALSE );
|
||||
m_Selunits->SetSelection( g_UnitMetric ? 0 : 1 );
|
||||
m_SelDirWires->SetSelection( g_HVLines ? 0 : 1 );
|
||||
m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1 );
|
||||
|
||||
wxString msg;
|
||||
msg = ReturnStringFromValue( g_UnitMetric, g_RepeatStep.x, m_Parent->m_InternalUnits );
|
||||
m_DeltaStepCtrl_X->SetValue( msg );
|
||||
|
||||
wxString title = _( "Delta Step X" ) + ReturnUnitSymbol( g_UnitMetric );
|
||||
m_DeltaStepXTitle->SetLabel( title );
|
||||
|
||||
msg = ReturnStringFromValue( g_UnitMetric,g_RepeatStep.y, m_Parent->m_InternalUnits);
|
||||
m_DeltaStepCtrl_Y->SetValue( msg );
|
||||
title = _("Delta Step Y") + ReturnUnitSymbol(g_UnitMetric);
|
||||
msg = ReturnStringFromValue( g_UnitMetric, g_RepeatStep.y, m_Parent->m_InternalUnits );
|
||||
m_DeltaStepCtrl_Y->SetValue( msg );
|
||||
title = _( "Delta Step Y" ) + ReturnUnitSymbol( g_UnitMetric );
|
||||
m_DeltaStepYTitle->SetLabel( title );
|
||||
|
||||
m_DeltaLabelCtrl->SetValue( g_RepeatDeltaLabel );
|
||||
|
||||
m_DeltaLabelCtrl->SetValue( g_RepeatDeltaLabel );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* WinEDA_SetOptionsFrame creator
|
||||
*/
|
||||
|
||||
bool WinEDA_SetOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
||||
bool WinEDA_SetOptionsFrame::Create( wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxString& caption,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style )
|
||||
{
|
||||
////@begin WinEDA_SetOptionsFrame member initialisation
|
||||
m_DrawOptionsSizer = NULL;
|
||||
m_ShowGridOpt = NULL;
|
||||
m_SelGridSize = NULL;
|
||||
m_SelShowPins = NULL;
|
||||
m_AutoPANOpt = NULL;
|
||||
m_Selunits = NULL;
|
||||
m_AutoPANOpt = NULL;
|
||||
m_Selunits = NULL;
|
||||
m_LabelSizeCtrlSizer = NULL;
|
||||
m_SelDirWires = NULL;
|
||||
m_SelDirWires = NULL;
|
||||
m_Show_Page_Limits = NULL;
|
||||
m_DeltaStepXTitle = NULL;
|
||||
m_DeltaStepCtrl_X = NULL;
|
||||
m_DeltaStepYTitle = NULL;
|
||||
m_DeltaStepCtrl_Y = NULL;
|
||||
m_DeltaIncTitle = NULL;
|
||||
m_DeltaLabelCtrl = NULL;
|
||||
m_DeltaStepXTitle = NULL;
|
||||
m_DeltaStepCtrl_X = NULL;
|
||||
m_DeltaStepYTitle = NULL;
|
||||
m_DeltaStepCtrl_Y = NULL;
|
||||
m_DeltaIncTitle = NULL;
|
||||
m_DeltaLabelCtrl = NULL;
|
||||
|
||||
////@end WinEDA_SetOptionsFrame member initialisation
|
||||
|
||||
////@begin WinEDA_SetOptionsFrame creation
|
||||
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
|
||||
SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS );
|
||||
wxDialog::Create( parent, id, caption, pos, size, style );
|
||||
|
||||
CreateControls();
|
||||
if (GetSizer())
|
||||
if( GetSizer() )
|
||||
{
|
||||
GetSizer()->SetSizeHints(this);
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
Centre();
|
||||
|
||||
////@end WinEDA_SetOptionsFrame creation
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Control creation for WinEDA_SetOptionsFrame
|
||||
*/
|
||||
|
||||
void WinEDA_SetOptionsFrame::CreateControls()
|
||||
{
|
||||
SetFont(*g_DialogFont);
|
||||
{
|
||||
SetFont( *g_DialogFont );
|
||||
|
||||
////@begin WinEDA_SetOptionsFrame content construction
|
||||
// Generated by DialogBlocks, 23/02/2007 10:59:46 (unregistered)
|
||||
|
||||
WinEDA_SetOptionsFrame* itemDialog1 = this;
|
||||
|
||||
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
itemDialog1->SetSizer(itemBoxSizer2);
|
||||
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
itemDialog1->SetSizer( itemBoxSizer2 );
|
||||
|
||||
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Draw Options:"));
|
||||
m_DrawOptionsSizer = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
|
||||
itemBoxSizer3->Add(m_DrawOptionsSizer, 0, wxGROW|wxALL, 5);
|
||||
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_ShowGridOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Show grid"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_ShowGridOpt->SetValue(false);
|
||||
m_DrawOptionsSizer->Add(m_ShowGridOpt, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
|
||||
"Draw Options:" ) );
|
||||
|
||||
m_DrawOptionsSizer = new wxStaticBoxSizer( itemStaticBoxSizer4Static,
|
||||
wxVERTICAL );
|
||||
|
||||
itemBoxSizer3->Add( m_DrawOptionsSizer, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_ShowGridOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _(
|
||||
"Show grid" ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxCHK_2STATE );
|
||||
|
||||
m_ShowGridOpt->SetValue( false );
|
||||
m_DrawOptionsSizer->Add( m_ShowGridOpt, 0, wxALIGN_LEFT | wxALL, 5 );
|
||||
|
||||
wxString m_SelGridSizeStrings[] = {
|
||||
_("Normal (50 mils)"),
|
||||
_("Small (25 mils)"),
|
||||
_("Very small (10 mils)"),
|
||||
_("Special (5 mils)"),
|
||||
_("Special (2 mils)"),
|
||||
_("Special (1 mil)")
|
||||
_( "Normal (50 mils)" ),
|
||||
_( "Small (25 mils)" ),
|
||||
_( "Very small (10 mils)" ),
|
||||
_( "Special (5 mils)" ),
|
||||
_( "Special (2 mils)" ),
|
||||
_( "Special (1 mil)" )
|
||||
};
|
||||
m_SelGridSize = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Grid Size"), wxDefaultPosition, wxDefaultSize, 6, m_SelGridSizeStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_SelGridSize->SetSelection(0);
|
||||
itemBoxSizer3->Add(m_SelGridSize, 0, wxGROW|wxALL, 5);
|
||||
m_SelGridSize = new wxRadioBox( itemDialog1, ID_RADIOBOX, _(
|
||||
"Grid Size" ), wxDefaultPosition, wxDefaultSize, 6,
|
||||
m_SelGridSizeStrings, 1, wxRA_SPECIFY_COLS );
|
||||
|
||||
m_SelGridSize->SetSelection( 0 );
|
||||
itemBoxSizer3->Add( m_SelGridSize, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxString m_SelShowPinsStrings[] = {
|
||||
_("Normal"),
|
||||
_("Show alls")
|
||||
_( "Normal" ),
|
||||
_( "Show alls" )
|
||||
};
|
||||
m_SelShowPins = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Show pins"), wxDefaultPosition, wxDefaultSize, 2, m_SelShowPinsStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_SelShowPins->SetSelection(0);
|
||||
itemBoxSizer3->Add(m_SelShowPins, 0, wxGROW|wxALL, 5);
|
||||
m_SelShowPins = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _(
|
||||
"Show pins" ), wxDefaultPosition,
|
||||
wxDefaultSize, 2, m_SelShowPinsStrings, 1,
|
||||
wxRA_SPECIFY_COLS );
|
||||
|
||||
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
m_SelShowPins->SetSelection( 0 );
|
||||
itemBoxSizer3->Add( m_SelShowPins, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_AutoPANOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_AutoPANOpt->SetValue(false);
|
||||
m_AutoPANOpt->SetForegroundColour(wxColour(0, 0, 255));
|
||||
itemBoxSizer8->Add(m_AutoPANOpt, 0, wxGROW|wxALL, 5);
|
||||
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
itemBoxSizer2->Add( itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
m_AutoPANOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _(
|
||||
"Auto PAN" ), wxDefaultPosition, wxDefaultSize,
|
||||
wxCHK_2STATE );
|
||||
|
||||
m_AutoPANOpt->SetValue( false );
|
||||
m_AutoPANOpt->SetForegroundColour( wxColour( 0, 0, 255 ) );
|
||||
itemBoxSizer8->Add( m_AutoPANOpt, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxString m_SelunitsStrings[] = {
|
||||
_("millimeter"),
|
||||
_("inches")
|
||||
_( "millimeter" ),
|
||||
_( "inches" )
|
||||
};
|
||||
m_Selunits = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Units"), wxDefaultPosition, wxDefaultSize, 2, m_SelunitsStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_Selunits->SetSelection(0);
|
||||
itemBoxSizer8->Add(m_Selunits, 0, wxGROW|wxALL, 5);
|
||||
m_Selunits = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _(
|
||||
"Units" ), wxDefaultPosition, wxDefaultSize, 2,
|
||||
m_SelunitsStrings, 1, wxRA_SPECIFY_COLS );
|
||||
|
||||
m_LabelSizeCtrlSizer = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer8->Add(m_LabelSizeCtrlSizer, 0, wxGROW|wxALL, 5);
|
||||
m_Selunits->SetSelection( 0 );
|
||||
itemBoxSizer8->Add( m_Selunits, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_LabelSizeCtrlSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
itemBoxSizer8->Add( m_LabelSizeCtrlSizer, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxString m_SelDirWiresStrings[] = {
|
||||
_("Horiz/Vertical"),
|
||||
_("Any")
|
||||
_( "Horiz/Vertical" ),
|
||||
_( "Any" )
|
||||
};
|
||||
m_SelDirWires = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _("Wires - Bus orient"), wxDefaultPosition, wxDefaultSize, 2, m_SelDirWiresStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_SelDirWires->SetSelection(0);
|
||||
itemBoxSizer8->Add(m_SelDirWires, 0, wxGROW|wxALL, 5);
|
||||
m_SelDirWires = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _(
|
||||
"Wires - Bus orient" ), wxDefaultPosition, wxDefaultSize,
|
||||
2, m_SelDirWiresStrings, 1,
|
||||
wxRA_SPECIFY_COLS );
|
||||
|
||||
m_SelDirWires->SetSelection( 0 );
|
||||
itemBoxSizer8->Add( m_SelDirWires, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxString m_Show_Page_LimitsStrings[] = {
|
||||
_("Yes"),
|
||||
_("No")
|
||||
_( "Yes" ),
|
||||
_( "No" )
|
||||
};
|
||||
m_Show_Page_Limits = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 2, m_Show_Page_LimitsStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_Show_Page_Limits->SetSelection(0);
|
||||
itemBoxSizer8->Add(m_Show_Page_Limits, 0, wxGROW|wxALL, 5);
|
||||
m_Show_Page_Limits = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _(
|
||||
"Show page limits" ), wxDefaultPosition,
|
||||
wxDefaultSize, 2, m_Show_Page_LimitsStrings, 1,
|
||||
wxRA_SPECIFY_COLS );
|
||||
|
||||
wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
m_Show_Page_Limits->SetSelection( 0 );
|
||||
itemBoxSizer8->Add( m_Show_Page_Limits, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton15->SetForegroundColour(wxColour(202, 0, 0));
|
||||
itemBoxSizer14->Add(itemButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
wxBoxSizer* itemBoxSizer14 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton16->SetForegroundColour(wxColour(0, 0, 255));
|
||||
itemBoxSizer14->Add(itemButton16, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
itemBoxSizer2->Add( itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
itemBoxSizer14->Add(5, 5, 0, wxGROW|wxALL, 5);
|
||||
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_OK, _(
|
||||
"&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Auto increment params"));
|
||||
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
|
||||
itemBoxSizer14->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
itemButton15->SetForegroundColour( wxColour( 202, 0, 0 ) );
|
||||
itemBoxSizer14->Add( itemButton15, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
||||
|
||||
m_DeltaStepXTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step X"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaStepXTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_CANCEL, _(
|
||||
"&Cancel" ), wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
m_DeltaStepCtrl_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_X, 0, wxGROW|wxALL, 5);
|
||||
itemButton16->SetForegroundColour( wxColour( 0, 0, 255 ) );
|
||||
itemBoxSizer14->Add( itemButton16, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
||||
|
||||
m_DeltaStepYTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step Y"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaStepYTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||
itemBoxSizer14->Add( 5, 5, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_DeltaStepCtrl_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_Y, 0, wxGROW|wxALL, 5);
|
||||
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
|
||||
"Auto increment params" ) );
|
||||
|
||||
m_DeltaIncTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Label:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaIncTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(
|
||||
itemStaticBoxSizer18Static,
|
||||
wxVERTICAL );
|
||||
|
||||
m_DeltaLabelCtrl = new wxSpinCtrl( itemDialog1, ID_SPINCTRL, _T("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -16, 16, 0 );
|
||||
itemStaticBoxSizer18->Add(m_DeltaLabelCtrl, 0, wxGROW|wxALL, 5);
|
||||
itemBoxSizer14->Add( itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
||||
|
||||
m_DeltaStepXTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
|
||||
"Delta Step X" ),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaStepXTitle,
|
||||
0,
|
||||
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
|
||||
m_DeltaStepCtrl_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(
|
||||
"" ), wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaStepCtrl_X, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_DeltaStepYTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
|
||||
"Delta Step Y" ),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaStepYTitle,
|
||||
0,
|
||||
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
|
||||
m_DeltaStepCtrl_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(
|
||||
"" ), wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaStepCtrl_Y, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
m_DeltaIncTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
|
||||
"Delta Label:" ),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaIncTitle,
|
||||
0,
|
||||
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
|
||||
m_DeltaLabelCtrl = new wxSpinCtrl( itemDialog1, ID_SPINCTRL, _T(
|
||||
"0" ), wxDefaultPosition,
|
||||
wxDefaultSize, wxSP_ARROW_KEYS,
|
||||
-16, 16, 0 );
|
||||
|
||||
itemStaticBoxSizer18->Add( m_DeltaLabelCtrl, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
////@end WinEDA_SetOptionsFrame content construction
|
||||
|
||||
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl(this, _("Default Line Width"),g_DrawMinimunLineWidth,
|
||||
g_UnitMetric, m_DrawOptionsSizer, EESCHEMA_INTERNAL_UNIT);
|
||||
|
||||
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl(this, _("Default Label Size"),g_DefaultTextLabelSize,
|
||||
g_UnitMetric, m_LabelSizeCtrlSizer, EESCHEMA_INTERNAL_UNIT);
|
||||
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl( this, _(
|
||||
"Default Line Width" ),
|
||||
g_DrawMinimunLineWidth,
|
||||
g_UnitMetric, m_DrawOptionsSizer,
|
||||
EESCHEMA_INTERNAL_UNIT );
|
||||
|
||||
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl( this, _(
|
||||
"Default Label Size" ),
|
||||
g_DefaultTextLabelSize,
|
||||
g_UnitMetric, m_LabelSizeCtrlSizer,
|
||||
EESCHEMA_INTERNAL_UNIT );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Should we show tooltips?
|
||||
*/
|
||||
@ -322,6 +423,7 @@ bool WinEDA_SetOptionsFrame::ShowToolTips()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Get bitmap resources
|
||||
*/
|
||||
@ -330,11 +432,13 @@ wxBitmap WinEDA_SetOptionsFrame::GetBitmapResource( const wxString& name )
|
||||
{
|
||||
// Bitmap retrieval
|
||||
////@begin WinEDA_SetOptionsFrame bitmap retrieval
|
||||
wxUnusedVar(name);
|
||||
wxUnusedVar( name );
|
||||
return wxNullBitmap;
|
||||
|
||||
////@end WinEDA_SetOptionsFrame bitmap retrieval
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Get icon resources
|
||||
*/
|
||||
@ -343,21 +447,26 @@ wxIcon WinEDA_SetOptionsFrame::GetIconResource( const wxString& name )
|
||||
{
|
||||
// Icon retrieval
|
||||
////@begin WinEDA_SetOptionsFrame icon retrieval
|
||||
wxUnusedVar(name);
|
||||
wxUnusedVar( name );
|
||||
return wxNullIcon;
|
||||
|
||||
////@end WinEDA_SetOptionsFrame icon retrieval
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
||||
*/
|
||||
|
||||
void WinEDA_SetOptionsFrame::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
Accept(event);
|
||||
Accept( event );
|
||||
|
||||
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
|
||||
|
||||
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_SetOptionsFrame.
|
||||
}
|
||||
|
||||
|
||||
@ -370,73 +479,88 @@ void WinEDA_SetOptionsFrame::OnCancelClick( wxCommandEvent& event )
|
||||
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
|
||||
|
||||
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_SetOptionsFrame.
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
void WinEDA_SetOptionsFrame::Accept(wxCommandEvent& event)
|
||||
void WinEDA_SetOptionsFrame::Accept( wxCommandEvent& event )
|
||||
/**************************************************************************/
|
||||
{
|
||||
wxSize grid;
|
||||
bool setgrid = TRUE;
|
||||
wxString msg;
|
||||
|
||||
g_DrawMinimunLineWidth = m_DefaultDrawLineWidthCtrl->GetValue();
|
||||
if ( g_DrawMinimunLineWidth < 0 ) g_DrawMinimunLineWidth = 0;
|
||||
if ( g_DrawMinimunLineWidth > 100 ) g_DrawMinimunLineWidth = 100;
|
||||
|
||||
g_DefaultTextLabelSize = m_DefaultLabelSizeCtrl->GetValue();
|
||||
if ( g_DefaultTextLabelSize < 0 ) g_DefaultTextLabelSize = 0;
|
||||
if ( g_DefaultTextLabelSize > 1000 ) g_DefaultTextLabelSize = 1000;
|
||||
wxSize grid;
|
||||
bool setgrid = TRUE;
|
||||
wxString msg;
|
||||
|
||||
msg = m_DeltaStepCtrl_X->GetValue();
|
||||
g_RepeatStep.x =
|
||||
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits);
|
||||
msg = m_DeltaStepCtrl_Y->GetValue();
|
||||
g_RepeatStep.y =
|
||||
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits);
|
||||
g_DrawMinimunLineWidth = m_DefaultDrawLineWidthCtrl->GetValue();
|
||||
if( g_DrawMinimunLineWidth < 0 )
|
||||
g_DrawMinimunLineWidth = 0;
|
||||
if( g_DrawMinimunLineWidth > 100 )
|
||||
g_DrawMinimunLineWidth = 100;
|
||||
|
||||
g_RepeatDeltaLabel = m_DeltaLabelCtrl->GetValue();
|
||||
g_DefaultTextLabelSize = m_DefaultLabelSizeCtrl->GetValue();
|
||||
if( g_DefaultTextLabelSize < 0 )
|
||||
g_DefaultTextLabelSize = 0;
|
||||
if( g_DefaultTextLabelSize > 1000 )
|
||||
g_DefaultTextLabelSize = 1000;
|
||||
|
||||
if ( m_Show_Page_Limits->GetSelection() == 0 ) g_ShowPageLimits = TRUE;
|
||||
else g_ShowPageLimits = FALSE;
|
||||
msg = m_DeltaStepCtrl_X->GetValue();
|
||||
g_RepeatStep.x =
|
||||
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
||||
msg = m_DeltaStepCtrl_Y->GetValue();
|
||||
g_RepeatStep.y =
|
||||
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
||||
|
||||
if ( m_SelDirWires->GetSelection() == 0 ) g_HVLines = 1;
|
||||
else g_HVLines = 0;
|
||||
g_RepeatDeltaLabel = m_DeltaLabelCtrl->GetValue();
|
||||
|
||||
if ( m_Selunits->GetSelection() == 0 ) g_UnitMetric = 1;
|
||||
else g_UnitMetric = 0;
|
||||
if( m_Show_Page_Limits->GetSelection() == 0 )
|
||||
g_ShowPageLimits = TRUE;
|
||||
else
|
||||
g_ShowPageLimits = FALSE;
|
||||
|
||||
if ( m_SelShowPins->GetSelection() == 0 ) g_ShowAllPins = FALSE;
|
||||
else g_ShowAllPins = TRUE;
|
||||
if( m_SelDirWires->GetSelection() == 0 )
|
||||
g_HVLines = 1;
|
||||
else
|
||||
g_HVLines = 0;
|
||||
|
||||
g_ShowGrid = m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
|
||||
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
|
||||
if( m_Selunits->GetSelection() == 0 )
|
||||
g_UnitMetric = 1;
|
||||
else
|
||||
g_UnitMetric = 0;
|
||||
|
||||
m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
|
||||
switch( m_SelGridSize->GetSelection() )
|
||||
{
|
||||
default:
|
||||
setgrid = FALSE;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
grid = wxSize(50,50);
|
||||
break;
|
||||
case 1:
|
||||
grid = wxSize(25,25);
|
||||
break;
|
||||
if( m_SelShowPins->GetSelection() == 0 )
|
||||
g_ShowAllPins = FALSE;
|
||||
else
|
||||
g_ShowAllPins = TRUE;
|
||||
|
||||
case 2:
|
||||
grid = wxSize(10,10);
|
||||
break;
|
||||
}
|
||||
g_ShowGrid = m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
|
||||
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
|
||||
|
||||
if ( m_Parent->GetScreen() )
|
||||
{
|
||||
if ( setgrid ) m_Parent->GetScreen()->SetGrid(grid);
|
||||
m_Parent->GetScreen()->SetRefreshReq();
|
||||
}
|
||||
m_Parent->m_Draw_Grid = m_ShowGridOpt->GetValue();
|
||||
|
||||
switch( m_SelGridSize->GetSelection() )
|
||||
{
|
||||
default:
|
||||
setgrid = FALSE;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
grid = wxSize( 50, 50 );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
grid = wxSize( 25, 25 );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
grid = wxSize( 10, 10 );
|
||||
break;
|
||||
}
|
||||
|
||||
if( m_Parent->GetBaseScreen() )
|
||||
{
|
||||
if( setgrid )
|
||||
m_Parent->GetBaseScreen()->SetGrid( grid );
|
||||
m_Parent->GetBaseScreen()->SetRefreshReq();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* EESchema - edition des librairies: Edition des champs ( Fields ) */
|
||||
/*********************************************************************/
|
||||
|
||||
/* Fichier libfield.cpp */
|
||||
/* Fichier libfield.cpp */
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
@ -30,18 +30,18 @@ static void ExitMoveField(WinEDA_DrawPanel * Panel, wxDC * DC)
|
||||
/***********************************************************/
|
||||
{
|
||||
|
||||
Panel->ManageCurseur = NULL;
|
||||
Panel->ForceCloseManageCurseur = NULL;
|
||||
if(CurrentDrawItem == NULL) return;
|
||||
Panel->ManageCurseur = NULL;
|
||||
Panel->ForceCloseManageCurseur = NULL;
|
||||
if(CurrentDrawItem == NULL) return;
|
||||
|
||||
wxPoint curpos;
|
||||
curpos = Panel->m_Parent->GetScreen()->m_Curseur;
|
||||
Panel->m_Parent->GetScreen()->m_Curseur = StartCursor;
|
||||
ShowMoveField(Panel, DC, TRUE);
|
||||
Panel->m_Parent->GetScreen()->m_Curseur = curpos;
|
||||
CurrentDrawItem->m_Flags = 0;
|
||||
wxPoint curpos;
|
||||
curpos = Panel->GetScreen()->m_Curseur;
|
||||
Panel->GetScreen()->m_Curseur = StartCursor;
|
||||
ShowMoveField(Panel, DC, TRUE);
|
||||
Panel->GetScreen()->m_Curseur = curpos;
|
||||
CurrentDrawItem->m_Flags = 0;
|
||||
|
||||
CurrentDrawItem = NULL;
|
||||
CurrentDrawItem = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -53,23 +53,23 @@ void WinEDA_LibeditFrame::StartMoveField(wxDC * DC, LibDrawField *field)
|
||||
{
|
||||
wxPoint startPos;
|
||||
|
||||
if( (CurrentLibEntry == NULL) || ( field == NULL ) ) return;
|
||||
CurrentDrawItem = field;
|
||||
LastTextPosition = field->m_Pos;
|
||||
CurrentDrawItem->m_Flags |= IS_MOVED;
|
||||
if( (CurrentLibEntry == NULL) || ( field == NULL ) ) return;
|
||||
CurrentDrawItem = field;
|
||||
LastTextPosition = field->m_Pos;
|
||||
CurrentDrawItem->m_Flags |= IS_MOVED;
|
||||
|
||||
startPos.x = LastTextPosition.x;
|
||||
startPos.y = -LastTextPosition.y;
|
||||
DrawPanel->CursorOff(DC);
|
||||
GetScreen()->m_Curseur = startPos;
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
startPos.x = LastTextPosition.x;
|
||||
startPos.y = -LastTextPosition.y;
|
||||
DrawPanel->CursorOff(DC);
|
||||
GetScreen()->m_Curseur = startPos;
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
|
||||
DrawPanel->ManageCurseur = ShowMoveField;
|
||||
DrawPanel->ForceCloseManageCurseur = ExitMoveField;
|
||||
DrawPanel->ManageCurseur(DrawPanel, DC, TRUE);
|
||||
StartCursor = GetScreen()->m_Curseur;
|
||||
DrawPanel->ManageCurseur = ShowMoveField;
|
||||
DrawPanel->ForceCloseManageCurseur = ExitMoveField;
|
||||
DrawPanel->ManageCurseur(DrawPanel, DC, TRUE);
|
||||
StartCursor = GetScreen()->m_Curseur;
|
||||
|
||||
DrawPanel->CursorOn(DC);
|
||||
DrawPanel->CursorOn(DC);
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
@ -81,47 +81,47 @@ static void ShowMoveField(WinEDA_DrawPanel * panel, wxDC *DC, bool erase)
|
||||
int color;
|
||||
LibDrawField *Field = (LibDrawField *)CurrentDrawItem;
|
||||
|
||||
if( (CurrentLibEntry == NULL) || (Field == NULL) ) return;
|
||||
if( (CurrentLibEntry == NULL) || (Field == NULL) ) return;
|
||||
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
|
||||
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
|
||||
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
|
||||
if( erase )
|
||||
DrawGraphicText(panel, DC,
|
||||
wxPoint(LastTextPosition.x, - LastTextPosition.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
|
||||
if( erase )
|
||||
DrawGraphicText(panel, DC,
|
||||
wxPoint(LastTextPosition.x, - LastTextPosition.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
|
||||
|
||||
LastTextPosition.x = panel->GetScreen()->m_Curseur.x;
|
||||
LastTextPosition.y = - panel->GetScreen()->m_Curseur.y;
|
||||
LastTextPosition.x = panel->GetScreen()->m_Curseur.x;
|
||||
LastTextPosition.y = - panel->GetScreen()->m_Curseur.y;
|
||||
|
||||
Field->m_Pos = LastTextPosition;
|
||||
Field->m_Pos = LastTextPosition;
|
||||
|
||||
DrawGraphicText(panel, DC,
|
||||
wxPoint(LastTextPosition.x, - LastTextPosition.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawGraphicText(panel, DC,
|
||||
wxPoint(LastTextPosition.x, - LastTextPosition.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
@ -130,45 +130,45 @@ void WinEDA_LibeditFrame::PlaceField(wxDC * DC, LibDrawField *Field)
|
||||
{
|
||||
int color;
|
||||
|
||||
if(Field == NULL ) return;
|
||||
if(Field == NULL ) return;
|
||||
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
|
||||
Field->m_Flags = 0;
|
||||
Field->m_Flags = 0;
|
||||
|
||||
|
||||
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
|
||||
Field->m_Pos.x = GetScreen()->m_Curseur.x;
|
||||
Field->m_Pos.y = - GetScreen()->m_Curseur.y;
|
||||
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
|
||||
Field->m_Pos.x = GetScreen()->m_Curseur.x;
|
||||
Field->m_Pos.y = - GetScreen()->m_Curseur.y;
|
||||
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
|
||||
DrawPanel->CursorOff(DC);
|
||||
DrawPanel->CursorOff(DC);
|
||||
|
||||
GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
|
||||
DrawPanel->CursorOn(DC);
|
||||
DrawPanel->CursorOn(DC);
|
||||
|
||||
GetScreen()->SetModify();
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
CurrentDrawItem = NULL;
|
||||
GetScreen()->SetModify();
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
CurrentDrawItem = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -180,118 +180,118 @@ wxString Text;
|
||||
int color;
|
||||
wxString title = wxT("Text:");
|
||||
|
||||
if( Field == NULL) return;
|
||||
if( Field == NULL) return;
|
||||
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
title = wxT("Reference:");
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
title = wxT("Reference:");
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
title = wxT("Value:");
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
case VALUE:
|
||||
title = wxT("Value:");
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
|
||||
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
|
||||
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
|
||||
|
||||
Text = Field->m_Text;
|
||||
Get_Message(title,Text, this);
|
||||
Text.Replace( wxT(" ") , wxT("_") );
|
||||
Text = Field->m_Text;
|
||||
Get_Message(title,Text, this);
|
||||
Text.Replace( wxT(" ") , wxT("_") );
|
||||
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
|
||||
if( ! Text.IsEmpty() )
|
||||
{
|
||||
SaveCopyInUndoList(CurrentLibEntry);
|
||||
Field->m_Text = Text;
|
||||
}
|
||||
else DisplayError(this, _("No new text: no change") );
|
||||
if( ! Text.IsEmpty() )
|
||||
{
|
||||
SaveCopyInUndoList(CurrentLibEntry);
|
||||
Field->m_Text = Text;
|
||||
}
|
||||
else DisplayError(this, _("No new text: no change") );
|
||||
|
||||
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
|
||||
GetScreen()->SetModify();
|
||||
GetScreen()->SetModify();
|
||||
|
||||
if ( Field->m_FieldId == VALUE ) ReCreateHToolbar();
|
||||
if ( Field->m_FieldId == VALUE ) ReCreateHToolbar();
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
void WinEDA_LibeditFrame::RotateField(wxDC * DC, LibDrawField *Field)
|
||||
/********************************************************************/
|
||||
/* Routine de modification de l'orientation ( Horiz ou Vert. ) du champ.
|
||||
si un champ est en cours d'edition, modif de celui ci.
|
||||
sinon Modif du champ pointe par la souris
|
||||
si un champ est en cours d'edition, modif de celui ci.
|
||||
sinon Modif du champ pointe par la souris
|
||||
*/
|
||||
{
|
||||
int color;
|
||||
|
||||
if( Field == NULL) return;
|
||||
if( Field == NULL) return;
|
||||
|
||||
GetScreen()->SetModify();
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
GetScreen()->SetModify();
|
||||
switch (Field->m_FieldId)
|
||||
{
|
||||
case REFERENCE:
|
||||
color = ReturnLayerColor(LAYER_REFERENCEPART);
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
case VALUE:
|
||||
color = ReturnLayerColor(LAYER_VALUEPART);
|
||||
break;
|
||||
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
color = ReturnLayerColor(LAYER_FIELDS);
|
||||
break;
|
||||
}
|
||||
|
||||
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
|
||||
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
|
||||
|
||||
DrawPanel->CursorOff(DC);
|
||||
DrawPanel->CursorOff(DC);
|
||||
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
GRSetDrawMode(DC, g_XorMode);
|
||||
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
|
||||
if( Field->m_Orient) Field->m_Orient = 0;
|
||||
else Field->m_Orient = 1;
|
||||
if( Field->m_Orient) Field->m_Orient = 0;
|
||||
else Field->m_Orient = 1;
|
||||
|
||||
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
|
||||
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawPanel->CursorOn(DC);
|
||||
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
|
||||
color, Field->m_Text,
|
||||
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
|
||||
Field->m_Size,
|
||||
Field->m_HJustify, Field->m_VJustify, LineWidth);
|
||||
DrawPanel->CursorOn(DC);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
LibDrawField * WinEDA_LibeditFrame::LocateField(EDA_LibComponentStruct *LibEntry)
|
||||
/****************************************************************************/
|
||||
/* Localise le champ (ref ou name) pointe par la souris
|
||||
retourne:
|
||||
pointeur sur le champ (NULL= Pas de champ)
|
||||
retourne:
|
||||
pointeur sur le champ (NULL= Pas de champ)
|
||||
*/
|
||||
{
|
||||
int x0, y0, x1, y1; /* Rectangle d'encadrement des textes a localiser */
|
||||
@ -299,91 +299,91 @@ int dx, dy; /* Dimensions du texte */
|
||||
LibDrawField *Field;
|
||||
int hjustify, vjustify;
|
||||
|
||||
/* Localisation du Nom */
|
||||
x0 = LibEntry->m_Name.m_Pos.x;
|
||||
y0 = - LibEntry->m_Name.m_Pos.y;
|
||||
dx = LibEntry->m_Name.m_Size.x * LibEntry->m_Name.m_Text.Len(),
|
||||
dy = LibEntry->m_Name.m_Size.y;
|
||||
hjustify = LibEntry->m_Name.m_HJustify; vjustify = LibEntry->m_Name.m_VJustify;
|
||||
if (LibEntry->m_Name.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 += dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
/* Localisation du Nom */
|
||||
x0 = LibEntry->m_Name.m_Pos.x;
|
||||
y0 = - LibEntry->m_Name.m_Pos.y;
|
||||
dx = LibEntry->m_Name.m_Size.x * LibEntry->m_Name.m_Text.Len(),
|
||||
dy = LibEntry->m_Name.m_Size.y;
|
||||
hjustify = LibEntry->m_Name.m_HJustify; vjustify = LibEntry->m_Name.m_VJustify;
|
||||
if (LibEntry->m_Name.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 += dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return &LibEntry->m_Name;
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return &LibEntry->m_Name;
|
||||
|
||||
/* Localisation du Prefix */
|
||||
x0 = LibEntry->m_Prefix.m_Pos.x;
|
||||
y0 = - LibEntry->m_Prefix.m_Pos.y;
|
||||
dx = LibEntry->m_Prefix.m_Size.x *LibEntry->m_Prefix.m_Text.Len(),
|
||||
dy = LibEntry->m_Prefix.m_Size.y;
|
||||
hjustify = LibEntry->m_Prefix.m_HJustify; vjustify = LibEntry->m_Prefix.m_VJustify;
|
||||
if (LibEntry->m_Prefix.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 -= dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
/* Localisation du Prefix */
|
||||
x0 = LibEntry->m_Prefix.m_Pos.x;
|
||||
y0 = - LibEntry->m_Prefix.m_Pos.y;
|
||||
dx = LibEntry->m_Prefix.m_Size.x *LibEntry->m_Prefix.m_Text.Len(),
|
||||
dy = LibEntry->m_Prefix.m_Size.y;
|
||||
hjustify = LibEntry->m_Prefix.m_HJustify; vjustify = LibEntry->m_Prefix.m_VJustify;
|
||||
if (LibEntry->m_Prefix.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 -= dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return &LibEntry->m_Prefix;
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return &LibEntry->m_Prefix;
|
||||
|
||||
/* Localisation des autres fields */
|
||||
for (Field = LibEntry->Fields; Field != NULL;
|
||||
Field = (LibDrawField*)Field->Pnext)
|
||||
{
|
||||
if ( Field->m_Text.IsEmpty() ) continue;
|
||||
x0 = Field->m_Pos.x; y0 = - Field->m_Pos.y;
|
||||
dx = Field->m_Size.x * Field->m_Text.Len(),
|
||||
dy = Field->m_Size.y;
|
||||
hjustify = Field->m_HJustify; vjustify = Field->m_VJustify;
|
||||
if (Field->m_Orient) EXCHG(dx, dy);
|
||||
if (LibEntry->m_Prefix.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 -= dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return(Field);
|
||||
}
|
||||
/* Localisation des autres fields */
|
||||
for (Field = LibEntry->Fields; Field != NULL;
|
||||
Field = (LibDrawField*)Field->Pnext)
|
||||
{
|
||||
if ( Field->m_Text.IsEmpty() ) continue;
|
||||
x0 = Field->m_Pos.x; y0 = - Field->m_Pos.y;
|
||||
dx = Field->m_Size.x * Field->m_Text.Len(),
|
||||
dy = Field->m_Size.y;
|
||||
hjustify = Field->m_HJustify; vjustify = Field->m_VJustify;
|
||||
if (Field->m_Orient) EXCHG(dx, dy);
|
||||
if (LibEntry->m_Prefix.m_Orient) EXCHG(dx, dy);
|
||||
if ( hjustify == GR_TEXT_HJUSTIFY_CENTER ) x0 -= dx/2;
|
||||
else if ( hjustify == GR_TEXT_HJUSTIFY_RIGHT ) x0 -= dx;
|
||||
if ( vjustify == GR_TEXT_VJUSTIFY_CENTER ) y0 -= dy/2;
|
||||
else if ( vjustify == GR_TEXT_VJUSTIFY_BOTTOM ) y0 -= dy;
|
||||
x1 = x0 + dx; y1 = y0 + dy;
|
||||
if( (GetScreen()->m_Curseur.x >= x0) && ( GetScreen()->m_Curseur.x <= x1) &&
|
||||
(GetScreen()->m_Curseur.y >= y0) && ( GetScreen()->m_Curseur.y <= y1) )
|
||||
return(Field);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/********************************************************************************/
|
||||
LibEDA_BaseStruct* WinEDA_LibeditFrame::LocateItemUsingCursor()
|
||||
/********************************************************************************/
|
||||
{
|
||||
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
|
||||
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
|
||||
|
||||
if ( CurrentLibEntry == NULL ) return NULL;
|
||||
if ( CurrentLibEntry == NULL ) return NULL;
|
||||
|
||||
if ( (DrawEntry == NULL) || (DrawEntry->m_Flags == 0) )
|
||||
{ // Simple localisation des elements
|
||||
DrawEntry = LocatePin(GetScreen()->m_Curseur, CurrentLibEntry, CurrentUnit, CurrentConvert);
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)GetScreen(),
|
||||
GetScreen()->m_MousePosition,CurrentLibEntry,CurrentUnit,
|
||||
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
|
||||
}
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)GetScreen(), GetScreen()->m_Curseur, CurrentLibEntry,CurrentUnit,
|
||||
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
|
||||
}
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = (LibEDA_BaseStruct*)
|
||||
LocateField(CurrentLibEntry);
|
||||
}
|
||||
}
|
||||
return DrawEntry;
|
||||
if ( (DrawEntry == NULL) || (DrawEntry->m_Flags == 0) )
|
||||
{ // Simple localisation des elements
|
||||
DrawEntry = LocatePin(GetScreen()->m_Curseur, CurrentLibEntry, CurrentUnit, CurrentConvert);
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)GetScreen(),
|
||||
GetScreen()->m_MousePosition,CurrentLibEntry,CurrentUnit,
|
||||
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
|
||||
}
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)GetScreen(), GetScreen()->m_Curseur, CurrentLibEntry,CurrentUnit,
|
||||
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
|
||||
}
|
||||
if ( DrawEntry == NULL )
|
||||
{
|
||||
DrawEntry = CurrentDrawItem = (LibEDA_BaseStruct*)
|
||||
LocateField(CurrentLibEntry);
|
||||
}
|
||||
}
|
||||
return DrawEntry;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user