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
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
|
|
|
#include "wxstruct.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "cvpcb.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
2011-02-21 18:27:47 +00:00
|
|
|
#include "footprint_info.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "cvstruct.h"
|
2010-02-01 21:23:27 +00:00
|
|
|
#include "class_DisplayFootprintsFrame.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "dialog_display_options.h"
|
|
|
|
|
|
|
|
|
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 );
|
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();
|
|
|
|
m_Parent->DrawPanel->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
|
|
|
}
|