Commit 515f5fbe authored by Dick Hollenbeck's avatar Dick Hollenbeck

*) Introduce "invoke_a_dialog.h" to information hide between top frame

   and various DIALOG classes called from top frames.  See comments in
   {eeschema,pcbnew}/invoke_a_dialog.h.
*) Move some dialog classes into *.cpp files from *.h files.
*) void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event ) was opening the modeless
   ERC dialog more than once if icon was clicked more than once.
*) Remove BOM stuff.
parent 0c5d9fa2
/**
* @file BOM_lister.h
*/
/* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _BOM_LISTER_H_
#define _BOM_LISTER_H_
#include <netlist.h>
// A helper class to build item lists for BOM,
// and write lists on files
class BOM_LISTER
{
private:
BOM_LABEL_LIST m_labelList; // a list of global and hierarchical labels
SCH_REFERENCE_LIST m_cmplist; // a flat list of components in the full hierarchy
FILE* m_outFile; // the output file for BOM generation
char m_separatorSymbol; // the separator used for csv files ( usually \t ; or , )
bool m_outputFmtCsv; // true to create Csv files, false to create text lists
bool m_includeSubComponents; // true to list each part
// of a multiple part per package component
// false to list only once this kind of component
bool m_csvForm; // true to print less verbose component list
// false to print more verbose component list
bool m_groupReferences; // true to group in list by reference (when possible,
// i.e. when other fields have the same value
// false to list one reference per line
bool m_printLocation; // true to print component location in list by reference
std::vector <int> m_fieldIDactive; // list of field IDs to print
public:
BOM_LISTER()
{
m_outFile = NULL;
m_separatorSymbol = '\t';
m_outputFmtCsv = false;
m_includeSubComponents = false;
m_csvForm = true;
m_printLocation = false;
m_groupReferences = false;
}
// Accessors:
void SetGroupReferences( bool aGroupRef )
{
m_groupReferences = aGroupRef;
}
void SetPrintLocation( bool aPrintLoc )
{
m_printLocation = aPrintLoc;
}
void SetIncludeSubCmp( bool aIncludeSubCmp )
{
m_includeSubComponents = aIncludeSubCmp;
}
/**
* Function SetCvsFormOn
* prepare parameters to create a BOM list in comma separated value (cvs)
* @param aSeparator = the character used as "csv" separator
*/
void SetCvsFormOn( char aSeparator )
{
m_csvForm = true;
m_separatorSymbol = aSeparator;
}
/**
* Function SetCvsFormOff
* prepare parameters to create a BOM list in full text readable mode
* (not csv format)
*/
void SetCvsFormOff()
{
m_csvForm = false;
}
void AddFieldIdToPrintList( int aFieldId );
void ClearFieldIdPrintList() { m_fieldIDactive.clear(); }
/**
* Function CreateCsvBOMListByValues
* print the list of components, grouped by values:
* One line by value. The format is something like:
* value;quantity;references;other fields
* 18pF;2;"C404 C405";SM0402
* 22nF/25V;4;"C128 C168 C228 C268";SM0402
* @param aFile = the file to write to (will be closed)
*/
void CreateCsvBOMListByValues( FILE* aFile );
/**
* Function PrintGlobalAndHierarchicalLabelsList
* print the list of global and hierarchical labels by sheet or by name
* @param aSortBySheet = true to print by sheet name order
* false to print by label name order
* @param aFile = the file to write to (will be NOT closed)
*/
void PrintGlobalAndHierarchicalLabelsList( FILE* aFile, bool aSortBySheet );
/**
* Function PrintComponentsListByReferenceHumanReadable
* print a BOM list in human readable form
* @param aFile = the file to write to (will be NOT closed)
*/
bool PrintComponentsListByReferenceHumanReadable( FILE* aFile );
/**
* Function PrintComponentsListByReferenceCsvForm
* print the list of components ordered by references. Generate 2 formats:
* - full component list in csv form
* - "short" component list in csv form, grouped by common fields values
* (mainly component value)
* @param aFile = the file to write to (will be NOT closed)
*/
bool PrintComponentsListByReferenceCsvForm( FILE* aFile );
/**
* Function PrintComponentsListByValue
* print the list of components, sorted by value, one line per component
* not useable for csv format (use CreateCsvBOMListByValues instead)
* @param aFile = the file to write to (will be NOT closed)
*/
int PrintComponentsListByValue( FILE* aFile );
private:
/**
* Helper function isFieldPrintable
* @return true if the field aFieldId should be printed.
* @param aFieldId = the field Id (FOOTPRIN, FIELD4 ...)
*/
bool isFieldPrintable( int aFieldId );
/**
* Helper function buildGlobalAndHierarchicalLabelsList
* Populate m_labelList with global and hierarchical labels
* and sheet pins labels
*/
void buildGlobalAndHierarchicalLabelsList();
/**
* Helper function returnFieldsString
* @return a string containing all selected fields texts,
* @param aComponent = the schematic component
* separated by the csv separator symbol
*/
const wxString returnFieldsString( SCH_COMPONENT* aComponent );
/**
* Helper function returnURLItemLocation
* @param aPathName = the full sheet name of item
* @param aPosition = a position (in internal units) to print
* @return a formated string to print the full location:
* /sheet name/( X Y position)
*/
const wxString returnURLItemLocation( const wxString& aPathName,
wxPoint aPosition );
};
#endif // _BOM_LISTER_H_
......@@ -12,7 +12,7 @@ include_directories(
set(EESCHEMA_DLGS
dialogs/dialog_color_config.cpp
dialogs/annotate_dialog.cpp
dialogs/dialog_annotate.cpp
dialogs/dialog_annotate_base.cpp
dialogs/dialog_lib_edit_text.cpp
dialogs/dialog_lib_edit_text_base.cpp
......
This diff is collapsed.
......@@ -33,75 +33,132 @@
#include <wxEeschemaStruct.h>
#include <class_drawpanel.h>
#include <annotate_dialog.h>
#include <invoke_a_dialog.h>
#include <dialog_annotate_base.h>
#define KEY_ANNOTATE_SORT_OPTION wxT( "AnnotateSortOption" )
#define KEY_ANNOTATE_ALGO_OPTION wxT( "AnnotateAlgoOption" )
#define KEY_ANNOTATE_AUTOCLOSE_OPTION wxT( "AnnotateAutoCloseOption" )
#define KEY_ANNOTATE_USE_SILENTMODE wxT( "AnnotateSilentMode" )
class wxConfig;
/**
* Class DIALOG_ANNOTATE
*/
class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
{
public:
DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent );
private:
SCH_EDIT_FRAME* m_Parent;
wxConfig* m_Config;
/// Initialises member variables
void InitValues();
void OnCancelClick( wxCommandEvent& event );
void OnClearAnnotationCmpClick( wxCommandEvent& event );
void OnApplyClick( wxCommandEvent& event );
// User functions:
bool GetLevel();
bool GetResetItems();
/**
* Function GetSortOrder
* @return 0 if annotation by X position,
* 1 if annotation by Y position,
* 2 if annotation by value
*/
int GetSortOrder();
/**
* Function GetAnnotateAlgo
* @return 0 if annotation using first not used Id value
* 1 if annotation using first not used Id value inside sheet num * 100 to sheet num * 100 + 99
* 2 if annotation using first nhot used Id value inside sheet num * 1000 to sheet num * 1000 + 999
*/
int GetAnnotateAlgo();
bool GetAnnotateAutoCloseOpt()
{
return m_cbAutoCloseDlg->GetValue();
}
bool GetAnnotateSilentMode()
{
return m_cbUseSilentMode->GetValue();
}
};
#define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption")
#define KEY_ANNOTATE_ALGO_OPTION wxT("AnnotateAlgoOption")
#define KEY_ANNOTATE_AUTOCLOSE_OPTION wxT("AnnotateAutoCloseOption")
#define KEY_ANNOTATE_USE_SILENTMODE wxT("AnnotateSilentMode")
DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
: DIALOG_ANNOTATE_BASE( parent )
{
m_Parent = parent;
InitValues();
Layout();
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
Centre();
}
/*********************************/
void DIALOG_ANNOTATE::InitValues()
/*********************************/
{
m_Config = wxGetApp().GetSettings();
SetFocus(); // needed to close dialog by escape key
if( m_Config )
{
long option;
m_Config->Read(KEY_ANNOTATE_SORT_OPTION, &option, 0l);
m_Config->Read( KEY_ANNOTATE_SORT_OPTION, &option, 0l );
switch( option )
{
default:
case 0:
m_rbSortBy_X_Position->SetValue(1);
break;
case 1:
m_rbSortBy_Y_Position->SetValue(1);
break;
case 2:
m_rbUseIncremental->SetValue(1);
break;
}
default:
case 0:
m_rbSortBy_X_Position->SetValue( 1 );
break;
case 1:
m_rbSortBy_Y_Position->SetValue( 1 );
break;
case 2:
m_rbUseIncremental->SetValue( 1 );
break;
}
m_Config->Read(KEY_ANNOTATE_ALGO_OPTION, &option, 0l);
m_Config->Read( KEY_ANNOTATE_ALGO_OPTION, &option, 0l );
switch( option )
{
default:
case 0:
m_rbUseIncremental->SetValue(1);
break;
case 1:
m_rbUseSheetNum->SetValue(1);
break;
case 2:
m_rbStartSheetNumLarge->SetValue(1);
break;
default:
case 0:
m_rbUseIncremental->SetValue( 1 );
break;
case 1:
m_rbUseSheetNum->SetValue( 1 );
break;
case 2:
m_rbStartSheetNumLarge->SetValue( 1 );
break;
}
m_Config->Read(KEY_ANNOTATE_AUTOCLOSE_OPTION, &option, 0l);
m_Config->Read( KEY_ANNOTATE_AUTOCLOSE_OPTION, &option, 0l );
if( option )
m_cbAutoCloseDlg->SetValue(1);
m_cbAutoCloseDlg->SetValue( 1 );
m_Config->Read(KEY_ANNOTATE_USE_SILENTMODE, &option, 0l);
m_Config->Read( KEY_ANNOTATE_USE_SILENTMODE, &option, 0l );
if( option )
m_cbUseSilentMode->SetValue(1);
m_cbUseSilentMode->SetValue( 1 );
}
annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) );
......@@ -111,19 +168,17 @@ void DIALOG_ANNOTATE::InitValues()
}
/*********************************************************/
void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
/*********************************************************/
{
int response;
wxString message;
int response;
wxString message;
if( m_Config )
{
m_Config->Write(KEY_ANNOTATE_SORT_OPTION, GetSortOrder());
m_Config->Write(KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo());
m_Config->Write(KEY_ANNOTATE_AUTOCLOSE_OPTION, GetAnnotateAutoCloseOpt());
m_Config->Write(KEY_ANNOTATE_USE_SILENTMODE, GetAnnotateSilentMode());
m_Config->Write( KEY_ANNOTATE_SORT_OPTION, GetSortOrder() );
m_Config->Write( KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo() );
m_Config->Write( KEY_ANNOTATE_AUTOCLOSE_OPTION, GetAnnotateAutoCloseOpt() );
m_Config->Write( KEY_ANNOTATE_USE_SILENTMODE, GetAnnotateSilentMode() );
}
// Display a message info in verbose mode,
......@@ -152,7 +207,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
{
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL)
if( response == wxCANCEL )
return;
}
......@@ -176,13 +231,11 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
}
/************************************************************************/
void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
/************************************************************************/
{
int response;
int response;
wxString message;
wxString message;
if( GetLevel() )
message = _( "Clear the existing annotation for the entire schematic?" );
else
......@@ -191,19 +244,17 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL)
if( response == wxCANCEL )
return;
m_Parent->DeleteAnnotation( GetLevel() ? false : true );
m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(false);
m_btnClear->Enable( false );
}
/************************************************************/
void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event )
/************************************************************/
{
if( IsModal() )
EndModal( wxID_CANCEL );
......@@ -215,44 +266,46 @@ void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event )
}
/**************************************/
bool DIALOG_ANNOTATE::GetLevel( void )
/**************************************/
bool DIALOG_ANNOTATE::GetLevel()
{
return m_rbEntireSchematic->GetValue();
}
/******************************************/
bool DIALOG_ANNOTATE::GetResetItems( void )
/******************************************/
bool DIALOG_ANNOTATE::GetResetItems()
{
return m_rbResetAnnotation->GetValue();
}
int DIALOG_ANNOTATE::GetSortOrder( void )
/**
* @return 0 if annotation by X position,
* 1 if annotation by Y position,
* 2 if annotation by value
*/
int DIALOG_ANNOTATE::GetSortOrder()
{
if ( m_rbSortBy_X_Position->GetValue() )
if( m_rbSortBy_X_Position->GetValue() )
return 0;
if ( m_rbSortBy_Y_Position->GetValue() )
if( m_rbSortBy_Y_Position->GetValue() )
return 1;
return 2;
}
int DIALOG_ANNOTATE::GetAnnotateAlgo( void )
/**
* @return 0 if annotation using first not used Id value
* 1 if annotation using first not used Id value inside sheet num * 100 to sheet num * 100 + 99
* 2 if annotation using first nhot used Id value inside sheet num * 1000 to sheet num * 1000 + 999
*/
int DIALOG_ANNOTATE::GetAnnotateAlgo()
{
if ( m_rbUseIncremental->GetValue() )
if( m_rbUseIncremental->GetValue() )
return 0;
if ( m_rbUseSheetNum->GetValue() )
if( m_rbUseSheetNum->GetValue() )
return 1;
return 2;
}
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller )
{
DIALOG_ANNOTATE dlg( aCaller );
return dlg.ShowModal();
}
This diff is collapsed.
/**
* @file dialog_build_BOM.h
*/
/* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _DIALOG_BUILD_BOM_H_
#define _DIALOG_BUILD_BOM_H_
#include <dialog_build_BOM_base.h>
class EDA_DRAW_FRAME;
class SCH_COMPONENT;
class wxConfig;
class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
{
private:
EDA_DRAW_FRAME* m_parent;
wxConfig* m_config;
wxString m_listFileName; // The full filename of the file report.
private:
void OnRadioboxSelectFormatSelected( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void SavePreferences();
void Init();
void Create_BOM_Lists( int aTypeFile,
bool aIncludeSubComponents,
char aExportSeparatorSymbol,
bool aRunBrowser );
void CreatePartsAndLabelsFullList( bool aIncludeSubComponents );
/**
* Function CreateSpreadSheetPartsFullList
* prints a list of components, in a form which can be imported by a
* spreadsheet. Form is:
* reference; cmp value; \<footprint\>; \<field1\>; ...;
* Components are sorted by reference
* @param aIncludeSubComponents = true to print sub components
* @param aPrintLocation = true to print components location
* (only possible when aIncludeSubComponents == true)
* @param aGroupRefs = true to group components references, when other fieds
* have the same value
*/
void CreateSpreadSheetPartsFullList( bool aIncludeSubComponents,
bool aPrintLocation,
bool aGroupRefs );
/**
* Function CreateSpreadSheetPartsShortList
* prints a list of components, in a form which can be imported by a spreadsheet.
* components having the same value and the same footprint
* are grouped on the same line
* Form is:
* value; number of components; list of references; \<footprint\>; \<field1\>; ...;
* list is sorted by values
*/
void CreateSpreadSheetPartsShortList();
bool IsFieldChecked( int aFieldId );
public:
DIALOG_BUILD_BOM( EDA_DRAW_FRAME* parent );
// ~DIALOG_BUILD_BOM() {};
};
#endif // _DIALOG_BUILD_BOM_H_
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_build_BOM_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_BUILD_BOM_BASE::DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
wxStaticBoxSizer* sbListOptionsSizer;
sbListOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("List items:") ), wxVERTICAL );
m_ListCmpbyRefItems = new wxCheckBox( this, wxID_ANY, _("Components by reference"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListCmpbyRefItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListSubCmpItems = new wxCheckBox( this, wxID_ANY, _("Sub components (i.e. U2A, U2B ...)"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListSubCmpItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListCmpbyValItems = new wxCheckBox( this, wxID_ANY, _("Components by value"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListCmpbyValItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_GenListLabelsbyVal = new wxCheckBox( this, wxID_ANY, _("Hierarchical pins by name"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_GenListLabelsbyVal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_GenListLabelsbySheet = new wxCheckBox( this, wxID_ANY, _("Hierarchical pins by sheet"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_GenListLabelsbySheet, 0, wxALL, 5 );
sbOptionsSizer->Add( sbListOptionsSizer, 0, wxEXPAND, 5 );
wxString m_OutputFormCtrlChoices[] = { _("List"), _("List for spreadsheet import (by ref)"), _("List for spreadsheet import (by grouped ref)"), _("List for spreadsheet import (by value)") };
int m_OutputFormCtrlNChoices = sizeof( m_OutputFormCtrlChoices ) / sizeof( wxString );
m_OutputFormCtrl = new wxRadioBox( this, ID_RADIOBOX_SELECT_FORMAT, _("Output format:"), wxDefaultPosition, wxDefaultSize, m_OutputFormCtrlNChoices, m_OutputFormCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutputFormCtrl->SetSelection( 1 );
sbOptionsSizer->Add( m_OutputFormCtrl, 0, wxEXPAND|wxTOP, 5 );
wxString m_OutputSeparatorCtrlChoices[] = { _("Tab"), _(";"), _(",") };
int m_OutputSeparatorCtrlNChoices = sizeof( m_OutputSeparatorCtrlChoices ) / sizeof( wxString );
m_OutputSeparatorCtrl = new wxRadioBox( this, wxID_ANY, _("Field separator for spreadsheet import:"), wxDefaultPosition, wxDefaultSize, m_OutputSeparatorCtrlNChoices, m_OutputSeparatorCtrlChoices, 1, wxRA_SPECIFY_ROWS );
m_OutputSeparatorCtrl->SetSelection( 0 );
sbOptionsSizer->Add( m_OutputSeparatorCtrl, 0, wxEXPAND|wxTOP, 5 );
m_GetListBrowser = new wxCheckBox( this, wxID_ANY, _("Launch list browser"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptionsSizer->Add( m_GetListBrowser, 0, wxALL|wxEXPAND, 5 );
bSizerUpper->Add( sbOptionsSizer, 3, wxALL|wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbAddToListSelectionSizer;
sbAddToListSelectionSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Add to list:") ), wxVERTICAL );
m_AddLocationField = new wxCheckBox( this, wxID_ANY, _("Component location"), wxDefaultPosition, wxDefaultSize, 0 );
sbAddToListSelectionSizer->Add( m_AddLocationField, 0, wxALL, 5 );
wxStaticBoxSizer* sbFixedFieldsSizer;
sbFixedFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("System Fields:") ), wxVERTICAL );
m_AddDatasheetField = new wxCheckBox( this, wxID_ANY, _("Datasheet"), wxDefaultPosition, wxDefaultSize, 0 );
sbFixedFieldsSizer->Add( m_AddDatasheetField, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_AddFootprintField = new wxCheckBox( this, wxID_ANY, _("Footprint"), wxDefaultPosition, wxDefaultSize, 0 );
sbFixedFieldsSizer->Add( m_AddFootprintField, 0, wxALL|wxEXPAND, 5 );
sbAddToListSelectionSizer->Add( sbFixedFieldsSizer, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbUsersFiledsSizer;
sbUsersFiledsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Users fields:") ), wxVERTICAL );
m_AddField1 = new wxCheckBox( this, wxID_ANY, _("Field 1"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField1, 0, wxEXPAND|wxALL, 5 );
m_AddField2 = new wxCheckBox( this, wxID_ANY, _("Field 2"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField3 = new wxCheckBox( this, wxID_ANY, _("Field 3"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField3, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField4 = new wxCheckBox( this, wxID_ANY, _("Field 4"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField4, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField5 = new wxCheckBox( this, wxID_ANY, _("Field 5"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField5, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField6 = new wxCheckBox( this, wxID_ANY, _("Field 6"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField6, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField7 = new wxCheckBox( this, wxID_ANY, _("Field 7"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField7, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField8 = new wxCheckBox( this, wxID_ANY, _("Field 8"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField8, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbAddToListSelectionSizer->Add( sbUsersFiledsSizer, 0, wxEXPAND|wxTOP, 5 );
m_AddAllFields = new wxCheckBox( this, wxID_ANY, _("All existing user fields"), wxDefaultPosition, wxDefaultSize, 0 );
sbAddToListSelectionSizer->Add( m_AddAllFields, 0, wxALL, 5 );
bRightSizer->Add( sbAddToListSelectionSizer, 1, wxEXPAND, 5 );
bSizerUpper->Add( bRightSizer, 2, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bSizerUpper, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bMainSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
m_OutputFormCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this );
}
DIALOG_BUILD_BOM_BASE::~DIALOG_BUILD_BOM_BASE()
{
// Disconnect Events
m_OutputFormCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this );
}
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_BUILD_BOM_BASE_H__
#define __DIALOG_BUILD_BOM_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_BUILD_BOM_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_BUILD_BOM_BASE : public DIALOG_SHIM
{
private:
protected:
enum
{
ID_RADIOBOX_SELECT_FORMAT = 1000
};
wxCheckBox* m_ListCmpbyRefItems;
wxCheckBox* m_ListSubCmpItems;
wxCheckBox* m_ListCmpbyValItems;
wxCheckBox* m_GenListLabelsbyVal;
wxCheckBox* m_GenListLabelsbySheet;
wxRadioBox* m_OutputFormCtrl;
wxRadioBox* m_OutputSeparatorCtrl;
wxCheckBox* m_GetListBrowser;
wxCheckBox* m_AddLocationField;
wxCheckBox* m_AddDatasheetField;
wxCheckBox* m_AddFootprintField;
wxCheckBox* m_AddField1;
wxCheckBox* m_AddField2;
wxCheckBox* m_AddField3;
wxCheckBox* m_AddField4;
wxCheckBox* m_AddField5;
wxCheckBox* m_AddField6;
wxCheckBox* m_AddField7;
wxCheckBox* m_AddField8;
wxCheckBox* m_AddAllFields;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnRadioboxSelectFormatSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("List of Materials"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_BUILD_BOM_BASE();
};
#endif //__DIALOG_BUILD_BOM_BASE_H__
......@@ -35,6 +35,7 @@
#include <appl_wxstruct.h>
#include <class_sch_screen.h>
#include <wxEeschemaStruct.h>
#include <invoke_a_dialog.h>
#include <general.h>
#include <netlist.h>
......@@ -45,6 +46,7 @@
#include <dialog_erc.h>
#include <dialog_erc_listbox.h>
#include <erc.h>
#include <id.h>
bool DIALOG_ERC::m_writeErcFile = false;
......@@ -57,7 +59,10 @@ END_EVENT_TABLE()
DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC_BASE( parent )
DIALOG_ERC_BASE(
parent,
ID_DIALOG_ERC // parent looks for this ID explicitly
)
{
m_parent = parent;
Init();
......@@ -564,3 +569,14 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
}
}
}
wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
{
// This is a modeless dialog, so new it rather than instantiating on stack.
DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
dlg->Show( true );
return dlg; // wxDialog is information hiding about DIALOG_ERC.
}
......@@ -50,7 +50,6 @@
#include <sch_sheet.h>
#include <dialog_helpers.h>
#include <dialog_netlist.h>
#include <dialogs/annotate_dialog.h>
#include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h>
......
......@@ -16,7 +16,35 @@
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <dialog_print_using_printer.h>
#include <invoke_a_dialog.h>
#include <dialog_print_using_printer_base.h>
/**
* Class DIALOG_PRINT_USING_PRINTER
* offers to print a schematic dialog.
*
* Derived from DIALOG_PRINT_USING_PRINTER_base created by wxFormBuilder
*/
class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE
{
public:
DIALOG_PRINT_USING_PRINTER( SCH_EDIT_FRAME* aParent );
SCH_EDIT_FRAME* GetParent() const;
private:
void OnCloseWindow( wxCloseEvent& event );
void OnInitDialog( wxInitDialogEvent& event );
void OnPageSetup( wxCommandEvent& event );
void OnPrintPreview( wxCommandEvent& event );
void OnPrintButtonClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ){ Close(); }
void GetPrintOptions();
};
/**
......@@ -415,3 +443,11 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
aScreen->m_DrawOrg = old_org;
aScreen->SetZoom( oldZoom );
}
int InvokeDialogPrintUsingPrinter( SCH_EDIT_FRAME* aCaller )
{
DIALOG_PRINT_USING_PRINTER dlg( aCaller );
return dlg.ShowModal();
}
#ifndef _DIALOG_PRINT_USING_PRINTER_H_
#define _DIALOG_PRINT_USING_PRINTER_H_
#include <dialog_print_using_printer_base.h>
/**
* Print schematic dialog.
*
* Class derived from DIALOG_PRINT_USING_PRINTER_base created by wxFormBuilder
*/
class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE
{
public:
DIALOG_PRINT_USING_PRINTER( SCH_EDIT_FRAME* aParent );
~DIALOG_PRINT_USING_PRINTER() {};
SCH_EDIT_FRAME* GetParent() const;
private:
void OnCloseWindow( wxCloseEvent& event );
void OnInitDialog( wxInitDialogEvent& event );
void OnPageSetup( wxCommandEvent& event );
void OnPrintPreview( wxCommandEvent& event );
void OnPrintButtonClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ){ Close(); }
void GetPrintOptions();
};
#endif // _DIALOG_PRINT_USING_PRINTER_H_
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -21,51 +23,44 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _ANNOTATE_DIALOG_H_
#define _ANNOTATE_DIALOG_H_
// This header is an insolation layer between top most frames and any number of
// DIALOG classes which can be called from a frame window.
// It is a place to put invocation functions for [modal] dialogs, with benefits:
//
// 1) The information about each dialog class is not exposed to the frame.
// So therefore the DIALOG class can often be kept out of a header file entirely.
//
// 2) The information about the calling frame is not necessarily exposed to
// to the called dialog class, at least not in here.
// The actual InvokeDialog<class>() function is usually coded at the bottom of the
// DIALOG_<class>.cpp file.
#include <dialog_annotate_base.h>
#ifndef INVOKE_A_DIALOG_H_
#define INVOKE_A_DIALOG_H_
class wxFrame;
class wxDialog;
// Often this is not used in the prototypes, since wxFrame is good enough and would
// represent maximum information hiding.
class SCH_EDIT_FRAME;
class wxConfig;
/*!
* DIALOG_ANNOTATE class declaration
*/
/// Create and show DIALOG_ANNOTATE and return whatever
/// DIALOG_ANNOTATE::ShowModal() returns.
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller );
class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
{
private:
SCH_EDIT_FRAME * m_Parent;
wxConfig* m_Config;
/// Create the modeless DIALOG_ERC and show it, return something to
/// destroy or close it. The dialog will have ID_DIALOG_ERC from id.h
wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller );
public:
DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent );
~DIALOG_ANNOTATE(){};
/// Create and show DIALOG_PRINT_USING_PRINTER and return whatever
/// DIALOG_PRINT_USING_PRINTER::ShowModal() returns.
int InvokeDialogPrintUsingPrinter( SCH_EDIT_FRAME* aCaller );
private:
/// Initialises member variables
void InitValues();
void OnCancelClick( wxCommandEvent& event );
void OnClearAnnotationCmpClick( wxCommandEvent& event );
void OnApplyClick( wxCommandEvent& event );
// User functions:
bool GetLevel( void );
bool GetResetItems( void );
int GetSortOrder( void );
int GetAnnotateAlgo( void );
bool GetAnnotateAutoCloseOpt()
{
return m_cbAutoCloseDlg->GetValue();
}
bool GetAnnotateSilentMode()
{
return m_cbUseSilentMode->GetValue();
}
};
#endif
// _ANNOTATE_DIALOG_H_
#endif // INVOKE_A_DIALOG_H_
......@@ -51,10 +51,7 @@
#include <eeschema_config.h>
#include <sch_sheet.h>
#include <dialogs/annotate_dialog.h>
#include <dialogs/dialog_build_BOM.h>
#include <dialogs/dialog_erc.h>
#include <dialogs/dialog_print_using_printer.h>
#include <invoke_a_dialog.h>
#include <dialogs/dialog_schematic_find.h>
#include <wx/display.h>
......@@ -200,6 +197,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* aParent, const wxString& aTitle,
m_findReplaceData = new wxFindReplaceData( wxFR_DOWN );
m_undoItem = NULL;
m_hasAutoSave = true;
SetForceHVLines( true );
SetDefaultLabelSize( DEFAULT_SIZE_TEXT );
......@@ -244,8 +242,6 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* aParent, const wxString& aTitle,
EDA_PANEINFO mesg;
mesg.MessageToolbarPane();
if( m_mainToolBar )
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
......@@ -602,19 +598,19 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
void SCH_EDIT_FRAME::OnAnnotate( wxCommandEvent& event )
{
DIALOG_ANNOTATE* dlg = new DIALOG_ANNOTATE( this );
dlg->ShowModal();
dlg->Destroy();
InvokeDialogAnnotate( this );
}
void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
{
DIALOG_ERC* dlg = new DIALOG_ERC( this );
// See if its already open...
wxWindow* erc = FindWindowById( ID_DIALOG_ERC, this );
dlg->Show( true );
// dlg->Destroy();
if( erc )
erc->Raise(); // bring it to the top if already open.
else
InvokeDialogERC( this );
}
......@@ -827,9 +823,8 @@ void SCH_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
{
wxFileName fn;
DIALOG_PRINT_USING_PRINTER dlg( this );
dlg.ShowModal();
InvokeDialogPrintUsingPrinter( this );
fn = g_RootSheet->GetScreen()->GetFileName();
......
......@@ -241,11 +241,13 @@ enum main_id
ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
ID_TB_OPTIONS_SHOW_PADS_SKETCH,
// zoom commands for non center zooming
ID_OFFCENTER_ZOOM_IN,
ID_OFFCENTER_ZOOM_OUT,
ID_DIALOG_ERC, ///< eeschema ERC modeless dialog ID
ID_END_LIST
};
......
......@@ -115,52 +115,52 @@ enum SCH_SEARCH_T {
class SCH_EDIT_FRAME : public SCH_BASE_FRAME
{
private:
SCH_SHEET_PATH* m_CurrentSheet; ///< which sheet we are presently working on.
wxString m_DefaultSchematicFileName;
int m_TextFieldSize;
PARAM_CFG_ARRAY m_projectFileParams;
PARAM_CFG_ARRAY m_configSettings;
wxPageSetupDialogData m_pageSetupData;
wxFindReplaceData* m_findReplaceData;
wxPoint m_previewPosition;
wxSize m_previewSize;
wxPoint m_printDialogPosition;
wxSize m_printDialogSize;
bool m_printMonochrome; ///< Print monochrome instead of grey scale.
bool m_printSheetReference;
DIALOG_SCH_FIND* m_dlgFindReplace;
wxPoint m_findDialogPosition;
wxSize m_findDialogSize;
wxArrayString m_findStringHistoryList;
wxArrayString m_replaceStringHistoryList;
BLOCK_SELECTOR m_blockItems; ///< List of selected items.
SCH_ITEM* m_itemToRepeat; ///< Last item to insert by the repeat command.
int m_repeatLabelDelta; ///< Repeat label number increment step.
SCH_COLLECTOR m_collectedItems; ///< List of collected items.
SCH_FIND_COLLECTOR m_foundItems; ///< List of find/replace items.
SCH_ITEM* m_undoItem; ///< Copy of the current item being edited.
wxString m_simulatorCommand; ///< Command line used to call the circuit
///< simulator (gnucap, spice, ...)
wxString m_netListerCommand; ///< Command line to call a custom net list
///< generator.
bool m_forceHVLines; ///< force H or V directions for wires, bus, line
int m_defaultLabelSize; ///< size of a new label
SCH_SHEET_PATH* m_CurrentSheet; ///< which sheet we are presently working on.
wxString m_DefaultSchematicFileName;
int m_TextFieldSize;
PARAM_CFG_ARRAY m_projectFileParams;
PARAM_CFG_ARRAY m_configSettings;
wxPageSetupDialogData m_pageSetupData;
wxFindReplaceData* m_findReplaceData;
wxPoint m_previewPosition;
wxSize m_previewSize;
wxPoint m_printDialogPosition;
wxSize m_printDialogSize;
bool m_printMonochrome; ///< Print monochrome instead of grey scale.
bool m_printSheetReference;
DIALOG_SCH_FIND* m_dlgFindReplace;
wxPoint m_findDialogPosition;
wxSize m_findDialogSize;
wxArrayString m_findStringHistoryList;
wxArrayString m_replaceStringHistoryList;
BLOCK_SELECTOR m_blockItems; ///< List of selected items.
SCH_ITEM* m_itemToRepeat; ///< Last item to insert by the repeat command.
int m_repeatLabelDelta; ///< Repeat label number increment step.
SCH_COLLECTOR m_collectedItems; ///< List of collected items.
SCH_FIND_COLLECTOR m_foundItems; ///< List of find/replace items.
SCH_ITEM* m_undoItem; ///< Copy of the current item being edited.
wxString m_simulatorCommand; ///< Command line used to call the circuit
///< simulator (gnucap, spice, ...)
wxString m_netListerCommand; ///< Command line to call a custom net list
///< generator.
bool m_forceHVLines; ///< force H or V directions for wires, bus, line
int m_defaultLabelSize; ///< size of a new label
/// An index to the last find item in the found items list #m_foundItems.
int m_foundItemIndex;
int m_foundItemIndex;
/// Flag to indicate show hidden pins.
bool m_showAllPins;
bool m_showAllPins;
/// The name of the format to use when generating a net list.
wxString m_netListFormat;
wxString m_netListFormat;
/// Add X prefix to componen referencess when generating spice net lists.
bool m_addReferencPrefix;
bool m_addReferencPrefix;
wxString m_userLibraryPath;
wxString m_userLibraryPath;
wxArrayString m_componentLibFiles;
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
// This header is an insolation layer between top most frames and any number of
// DIALOG classes which can be called from a frame window.
// It is a place to put invocation functions for [modal] dialogs, with benefits:
//
// 1) The information about each dialog class is not exposed to the frame.
// So therefore the DIALOG class can often be kept out of a header file entirely.
//
// 2) The information about the calling frame is not necessarily exposed to
// to the called dialog class, at least not in here.
// The actual InvokeDialog<class>() function is usually coded at the bottom of the
// DIALOG_<class>.cpp file.
#ifndef INVOKE_A_DIALOG_H_
#define INVOKE_A_DIALOG_H_
class wxFrame;
class wxDialog;
// Often this is not used in the prototypes, since wxFrame is good enough and would
// represent maximum information hiding.
class PCB_EDIT_FRAME;
/* template: junk it after some are added:
/// Create and show DIALOG_ANNOTATE and return whatever
/// DIALOG_ANNOTATE::ShowModal() returns.
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller );
/// Create the modeless DIALOG_ERC and show it, return something to
/// destroy or close it. The dialog will have ID_DIALOG_ERC from id.h
wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller );
/// Create and show DIALOG_PRINT_USING_PRINTER and return whatever
/// DIALOG_PRINT_USING_PRINTER::ShowModal() returns.
int InvokeDialogPrintUsingPrinter( SCH_EDIT_FRAME* aCaller );
*/
#endif // INVOKE_A_DIALOG_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment