2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog_display_options.cpp
|
2010-04-16 16:28:35 +00:00
|
|
|
// Licence: GPL
|
2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wxstruct.h>
|
|
|
|
#include <common.h>
|
|
|
|
#include <cvpcb.h>
|
|
|
|
#include <class_drawpanel.h>
|
|
|
|
#include <footprint_info.h>
|
|
|
|
#include <cvstruct.h>
|
|
|
|
#include <class_DisplayFootprintsFrame.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_display_options.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2010-02-01 21:23:27 +00:00
|
|
|
void DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-04-16 16:28:35 +00:00
|
|
|
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS* OptionWindow =
|
|
|
|
new DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( this );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
OptionWindow->ShowModal();
|
|
|
|
OptionWindow->Destroy();
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent )
|
|
|
|
: DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-11-05 19:26:52 +00:00
|
|
|
m_Parent = parent;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
initDialog();
|
2011-03-25 19:16:05 +00:00
|
|
|
m_sdbSizer1OK->SetDefault();
|
2010-04-16 16:28:35 +00:00
|
|
|
GetSizer()->SetSizeHints( this );
|
2007-06-05 12:10:51 +00:00
|
|
|
Centre();
|
|
|
|
}
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
2010-04-16 16:28:35 +00:00
|
|
|
* Control creation for DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-04-16 16:28:35 +00:00
|
|
|
/* mandatory to use escape key as cancel under wxGTK. */
|
|
|
|
SetFocus();
|
2009-11-05 19:26:52 +00:00
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
m_EdgesDisplayOption->SetSelection( m_Parent->m_DisplayModEdge );
|
|
|
|
m_TextDisplayOption->SetSelection( m_Parent->m_DisplayModText );
|
|
|
|
m_IsShowPadFill->SetValue( m_Parent->m_DisplayPadFill );
|
|
|
|
m_IsShowPadNum->SetValue( m_Parent->m_DisplayPadNum );
|
2012-04-11 18:54:20 +00:00
|
|
|
m_IsMiddleButtonPan->SetValue( m_Parent->GetCanvas()->GetEnableMiddleButtonPan() );
|
|
|
|
m_IsMiddleButtonPanLimited->SetValue( m_Parent->GetCanvas()->GetMiddleButtonPanLimited() );
|
|
|
|
m_IsMiddleButtonPanLimited->Enable( m_IsMiddleButtonPan->GetValue() );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
2007-10-07 03:08:24 +00:00
|
|
|
* Update settings related to edges, text strings, and pads
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_DisplayModEdge = m_EdgesDisplayOption->GetSelection();
|
2009-11-05 19:26:52 +00:00
|
|
|
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
|
|
|
|
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
|
|
|
|
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
|
2012-04-11 18:54:20 +00:00
|
|
|
m_Parent->GetCanvas()->SetEnableMiddleButtonPan( m_IsMiddleButtonPan->GetValue() );
|
|
|
|
m_Parent->GetCanvas()->SetMiddleButtonPanLimited( m_IsMiddleButtonPanLimited->GetValue() );
|
2011-12-22 13:28:11 +00:00
|
|
|
m_Parent->GetCanvas()->Refresh();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
2007-10-07 03:08:24 +00:00
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-11-05 19:26:52 +00:00
|
|
|
UpdateObjectSettings();
|
2007-10-07 03:08:24 +00:00
|
|
|
EndModal( 1 );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
2007-10-07 03:08:24 +00:00
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnCancelClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-10-07 03:08:24 +00:00
|
|
|
EndModal( -1 );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
2007-10-07 03:08:24 +00:00
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-16 16:28:35 +00:00
|
|
|
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnApplyClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-11-05 19:26:52 +00:00
|
|
|
UpdateObjectSettings();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|