KiCad PCB EDA Suite
confirm.h File Reference

This file is part of the common library. More...

#include <wx/richmsgdlg.h>
#include <vector>

Go to the source code of this file.

Classes

class  KIDIALOG
 Helper class to create more flexible dialogs, including 'do not show again' checkbox handling. More...
 

Functions

int DisplayExitDialog (wxWindow *aParent, const wxString &aMessage)
 Function DisplayExitDialog displays a dialog with 3 buttons: Save and Exit Cancel Exit without save. More...
 
void DisplayError (wxWindow *parent, const wxString &aMessage, int displaytime=0)
 Function DisplayError displays an error or warning message box with aMessage. More...
 
void DisplayErrorMessage (wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
 Function DisplayErrorMessage displays an error message with aMessage. More...
 
void DisplayInfoMessage (wxWindow *parent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
 Function DisplayInfoMessage displays an informational message box with aMessage. More...
 
bool IsOK (wxWindow *aParent, const wxString &aMessage)
 Function IsOK displays a yes/no dialog with aMessage and returns the user response. More...
 
int YesNoCancelDialog (wxWindow *aParent, const wxString &aPrimaryMessage, const wxString &aSecondaryMessage, const wxString &aYesButtonText=wxEmptyString, const wxString &aNoButtonText=wxEmptyString, const wxString &aCancelButtonText=wxEmptyString)
 Function YesNoCancelDialog displays a yes/no/cancel dialog with aMessage and returns the user response. More...
 
int SelectSingleOption (wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const wxArrayString &aOptions)
 Displays a dialog with radioboxes asking the user to select an option. More...
 
std::pair< bool, wxArrayInt > SelectMultipleOptions (wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const wxArrayString &aOptions, bool aDefaultState=false)
 Displays a dialog with checkboxes asking the user to select one or more options. More...
 
std::pair< bool, wxArrayInt > SelectMultipleOptions (wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const std::vector< std::string > &aOptions, bool aDefaultState=false)
 

Detailed Description

This file is part of the common library.

See also
common.h

Definition in file confirm.h.

Function Documentation

void DisplayError ( wxWindow *  parent,
const wxString &  aMessage,
int  displaytime = 0 
)

Function DisplayError displays an error or warning message box with aMessage.

Warning
Setting displaytime does not work. Do not use it.

Definition at line 185 of file confirm.cpp.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut(), add_search_paths(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddFootprintFilter(), LIB_EDIT_FRAME::addLibraryFile(), NETLIST_EXPORTER::addPinToComponentPinList(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), LIB_EDIT_FRAME::backupFile(), PCB_EDIT_FRAME::Begin_Self(), DIALOG_TRACK_VIA_SIZE::check(), DIALOG_TRACK_VIA_PROPERTIES::check(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), create_backup_file(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DIALOG_GEN_FOOTPRINT_POSITION::CreateFiles(), LIB_EDIT_FRAME::CreateGraphicItem(), MICROWAVE_TOOL::createInductorBetween(), SPICE_SIMULATOR::CreateInstance(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), SCH_EDIT_FRAME::CreateNewText(), PCB_EDIT_FRAME::Delete_Drawings_All_Layer(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAliasOfPart(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), FOOTPRINT_EDIT_FRAME::DlgGlobalChange_PadSettings(), PCB_EDIT_FRAME::DlgGlobalChange_PadSettings(), SCH_EDIT_FRAME::doUpdatePcb(), PCB_EDIT_FRAME::Edit_Gap(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::EditAliasOfPart(), SCH_EDIT_FRAME::EditSheet(), ExecuteFile(), FOOTPRINT_EDIT_FRAME::Export_Module(), GBR_TO_PCB_EXPORTER::ExportPcb(), DIALOG_SVG_PRINT::ExportSVGFile(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::Files_io_from_id(), FootprintWriteShape(), NETLIST_EXPORTER_PSPICE::Format(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), DIALOG_SPICE_MODEL::generatePowerSource(), PCB_EDIT_FRAME::GenFootprintsReport(), genPlacementRoutingMatrix(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), GetAssociatedDocument(), DIALOG_PRINT_USING_PRINTER::GetPrintOptions(), PCB_BASE_FRAME::GlobalChange_PadSettings(), EDA_DRAW_FRAME::HandleBlockBegin(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), LIB_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), LIB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::HandleBlockPlace(), FOOTPRINT_EDIT_FRAME::Import_Module(), SCH_EDIT_FRAME::importFile(), ALIGN_DISTRIBUTE_TOOL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), EDIT_TOOL::Init(), PCB_EDIT_FRAME::ListAndSelectModuleName(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadOneSymbol(), LIB_EDIT_FRAME::loadPart(), SIM_PLOT_FRAME::menuOpenWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbook(), PCB_EDIT_FRAME::MuWaveCommand(), DIALOG_ENV_VAR_CONFIG::OnAddButton(), DIALOG_CONFIG_EQUFILES::OnAddFiles(), DIALOG_DESIGN_RULES::OnAddNetclassClick(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), LIB_EDIT_FRAME::OnCreateNewPart(), LIB_EDIT_FRAME::OnExportPart(), LIB_EDIT_FRAME::OnImportPart(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_DRC_CONTROL::OnListUnconnectedClick(), SCH_EDIT_FRAME::OnNewProject(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick(), DIALOG_DIMENSION_EDITOR::OnOKClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), EDA_DRAW_PANEL_GAL::onPaint(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick(), DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick(), DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview(), DIALOG_PRINT_USING_PRINTER::OnPrintPreview(), FOOTPRINT_EDIT_FRAME::OnRightClick(), FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs(), SCH_EDIT_FRAME::OnSaveProject(), DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar(), KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser(), SIM_PLOT_FRAME::onSettings(), PCB_DRAW_PANEL_GAL::OnShow(), DIALOG_DRC_CONTROL::OnStartdrcClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), PCB_EDIT_FRAME::OnUpdatePCBFromSch(), FOOTPRINT_EDIT_FRAME::OnVerticalToolbar(), ROUTER_TOOL::onViaCommand(), WIZARD_3DSHAPE_LIBS_DOWNLOADER::OnWizardFinished(), WIZARD_FPLIB_TABLE::OnWizardFinished(), OpenPDF(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_PARSER::parseZONE_CONTAINER(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), SCH_EDIT_FRAME::PasteListOfItems(), DIALOG_PLOT::Plot(), DIALOG_BOM::pluginInit(), ROUTER_TOOL::prepareInteractive(), DIALOG_PRINT_USING_PRINTER::PreparePrintPrms(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::ProcessMuWaveFunctions(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), KIGFX::VERTEX_MANAGER::Reserve(), Retrace(), MODULE::RunOnChildren(), FOOTPRINT_EDIT_FRAME::SaveCurrentModule(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), PCB_BASE_FRAME::SelectFootprint(), SCH_BASE_FRAME::SelectLibraryFromList(), KIGFX::GPU_MANAGER::SetShader(), PCB_EDIT_FRAME::SpreadFootprints(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), SIM_PLOT_FRAME::StartSimulation(), EDA_DRAW_PANEL_GAL::SwitchBackend(), DIALOG_LAYERS_SETUP::testLayerNames(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), FOOTPRINT_EDIT_FRAME::ToPrinter(), PCB_EDIT_FRAME::ToPrinter(), GERBVIEW_FRAME::ToPrinter(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_EDIT_FPTEXT::TransferDataFromWindow(), DIALOG_EDIT_ONE_FIELD::TransferDataFromWindow(), DIALOG_SIM_SETTINGS::TransferDataFromWindow(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_ENV_VAR_SINGLE::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_LAYERS_SETUP::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), SPICE_VALIDATOR::Validate(), KIGFX::VERTEX_MANAGER::Vertex(), KIGFX::VERTEX_MANAGER::Vertices(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_KICAD::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), LEGACY_RESCUER::WriteRescueLibrary(), and PCB_EDITOR_CONTROL::ZoneDuplicate().

186 {
187  wxMessageDialog* dialog;
188 
189  int icon = displaytime > 0 ? wxICON_INFORMATION : wxICON_ERROR;
190 
191  dialog = new wxMessageDialog( parent, text, _( "Warning" ),
192  wxOK | wxCENTRE | wxRESIZE_BORDER | icon );
193 
194  dialog->ShowModal();
195  dialog->Destroy();
196 }
void DisplayErrorMessage ( wxWindow *  aParent,
const wxString &  aMessage,
const wxString &  aExtraInfo = wxEmptyString 
)

Function DisplayErrorMessage displays an error message with aMessage.

Parameters
aParentis the parent window
aMessageis the message text to display
aExtraInfois extra data that can be optionally displayed in a collapsible pane

Definition at line 199 of file confirm.cpp.

Referenced by PROJECT::AbsolutePath(), PCB_EDIT_FRAME::AppendBoardFile(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), checkGlError(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkNewAlias(), copy_pro_file_template(), SCH_EDIT_FRAME::CreateArchiveLibrary(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAllAliasOfPart(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::duplicateZone(), LIB_EDIT_FRAME::EditField(), DIALOG_ENV_VAR_CONFIG::EditSelectedEntry(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::ExportSpecctraFile(), LIB_MANAGER::FlushLibrary(), LIB_MANAGER::GetAlias(), LIB_MANAGER::GetAliases(), LIB_MANAGER::GetAliasNames(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::GetLibrary(), LIB_MANAGER::getOriginalParts(), PCB_EDIT_FRAME::ImportSpecctraSession(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadOneSymbol(), DIALOG_EXPORT_STEP::onExportButton(), LIB_EDIT_FRAME::OnExportPart(), PCB_EDIT_FRAME::OnExportSTEP(), LIB_EDIT_FRAME::OnImportPart(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), PCB_EDIT_FRAME::OnLeftDClick(), KICAD_MANAGER_FRAME::OnNewProject(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), LIB_EDIT_FRAME::OnPreferencesOptions(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PROJECT::PcbFootprintLibs(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Remove_Zone_Corner(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), SchGetLibAlias(), FOOTPRINT_EDIT_FRAME::ToolOnRightClick(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().

200 {
201  wxRichMessageDialog* dlg;
202 
203  dlg = new wxRichMessageDialog( aParent, aText, _( "Error" ),
204  wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR );
205 
206  if( !aExtraInfo.IsEmpty() )
207  {
208  dlg->ShowDetailedText( aExtraInfo );
209  }
210 
211  dlg->ShowModal();
212  dlg->Destroy();
213 }
int DisplayExitDialog ( wxWindow *  aParent,
const wxString &  aMessage 
)

Function DisplayExitDialog displays a dialog with 3 buttons: Save and Exit Cancel Exit without save.

Parameters
aParent= the parent window
aMessage= the main message to put in dialog If empty, the standard message will be shown: Save the changes before closing?
Returns
wxID_YES, wxID_CANCEL, wxID_NO.

Definition at line 173 of file confirm.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), and PCB_EDIT_FRAME::OnCloseWindow().

174 {
175  DIALOG_EXIT dlg( parent, aMessage );
176 
177  int ret = dlg.ShowModal();
178 
179  // Returns wxID_YES, wxID_NO, or wxID_CANCEL
180  return ret;
181 }
void DisplayInfoMessage ( wxWindow *  parent,
const wxString &  aMessage,
const wxString &  aExtraInfo = wxEmptyString 
)

Function DisplayInfoMessage displays an informational message box with aMessage.

Parameters
aParentis the parent window
aMessageis the message text to display
aExtraInfois the extra data that can be optionally displayed in a collapsible pane

Definition at line 216 of file confirm.cpp.

Referenced by PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkNewAlias(), PCB_BASE_FRAME::CreateNewModule(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), PCB_EDIT_FRAME::duplicateZone(), FOOTPRINT_EDIT_FRAME::Export_Module(), GERBVIEW_FRAME::ExportDataInPcbnewFormat(), PCB_EDIT_FRAME::Files_io_from_id(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), PGM_BASE::GetEditorName(), SCH_EDIT_FRAME::ImportSheetPin(), DIALOG_PRINT_USING_PRINTER::InitValues(), SIM_PLOT_FRAME::onAddSignal(), LIB_EDIT_FRAME::OnCheckComponent(), CV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs(), PCB_EDIT_FRAME::OnSelectTool(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), DIALOG_NETLIST::OnTestFootprintsClick(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), DIALOG_PLOT::Plot(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::SaveCurrentModule(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_BASE_FRAME::SelectCopperLayerPair(), DIALOG_PRINT_USING_PRINTER::SetPrintParameters(), SIM_PLOT_FRAME::StartSimulation(), PCBNEW_CONTROL::ToBeDone(), and FOOTPRINT_EDIT_FRAME::Transform().

217 {
218  wxRichMessageDialog* dlg;
219 
220  dlg = new wxRichMessageDialog( aParent, aMessage, _( "Info" ),
221  wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_INFORMATION );
222 
223  if( !aExtraInfo.IsEmpty() )
224  {
225  dlg->ShowDetailedText( aExtraInfo );
226  }
227 
228  dlg->ShowModal();
229  dlg->Destroy();
230 }
bool IsOK ( wxWindow *  aParent,
const wxString &  aMessage 
)

Function IsOK displays a yes/no dialog with aMessage and returns the user response.

Parameters
aParentis the parent window. NULL can be used if the parent is the top level window.
aMessageis the message to display in the dialog box.
Returns
True if user selected the yes button, otherwise false.

Definition at line 233 of file confirm.cpp.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::AutoPlaceModule(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage(), SELECTION_TOOL::CheckLock(), ALIGN_DISTRIBUTE_TOOL::checkLockedStatus(), GERBVIEW_FRAME::Clear_DrawLayers(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), CVPCB_MAINFRAME::DelAssociations(), PCB_EDIT_FRAME::Delete_Drawings_All_Layer(), PCB_EDIT_FRAME::Delete_net(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAllAliasOfPart(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAllFootprintFilter(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), PCB_BASE_FRAME::DeletePad(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer(), SCH_EDIT_FRAME::EditSheet(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), PL_EDITOR_FRAME::Files_io(), PCB_EDIT_FRAME::Files_io_from_id(), ZONE_FILLER::Fill(), getOptimalModulePlacement(), PGM_BASE::InitPgm(), ROUTER_TOOL::InlineDrag(), PCB_EDIT_FRAME::InstallNetlistFrame(), LIB_EDIT_FRAME::LoadComponentAndSelectLib(), FOOTPRINT_EDIT_FRAME::LoadModuleFromBoard(), SCH_EDIT_FRAME::OnAppendProject(), LIB_EDIT_FRAME::OnEditPin(), LIB_EDIT_FRAME::OnExportPart(), PL_EDITOR_FRAME::OnFileHistory(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), KICAD_MANAGER_FRAME::OnNewProject(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), DIALOG_NETLIST::OnReadNetlistFileClick(), LIB_EDIT_FRAME::OnRemovePart(), LIB_EDIT_FRAME::OnRevertLibrary(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), ROUTER_TOOL::performDragging(), LIB_EDIT_FRAME::PlacePin(), SCH_EDIT_FRAME::prepareForNetlist(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert(), PCB_EDIT_FRAME::Solve(), DIALOG_GENCAD_EXPORT_OPTIONS::TransferDataFromWindow(), DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataFromWindow(), and DIALOG_LAYERS_SETUP::TransferDataFromWindow().

234 {
235  wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
236  wxYES_NO | wxCENTRE | wxICON_QUESTION );
237 
238  return dlg.ShowModal() == wxID_YES;
239 }
std::pair<bool, wxArrayInt> SelectMultipleOptions ( wxWindow *  aParent,
const wxString &  aTitle,
const wxString &  aMessage,
const wxArrayString &  aOptions,
bool  aDefaultState = false 
)

Displays a dialog with checkboxes asking the user to select one or more options.

Parameters
aParentis the parent window.
aTitleis the dialog title.
aMessageis a text label displayed in the first row of the dialog.
aOptionsis a vector of possible options.
aDefaultStateis the default state for the checkboxes.
Returns
Pair containing a boolean value equal to true when the selection has been confirmed and an integer array containing indices of the selected options.

Definition at line 349 of file confirm.cpp.

References DIALOG_MULTI_OPTIONS::SetCheckboxes().

Referenced by LIB_EDIT_FRAME::saveAllLibraries(), and SelectMultipleOptions().

351 {
352  DIALOG_MULTI_OPTIONS dlg( aParent, aTitle, aMessage, aOptions );
353  dlg.Layout();
354  dlg.SetCheckboxes( aDefaultState );
355 
356  wxArrayInt ret;
357  bool clickedOk = ( dlg.ShowModal() == wxID_OK );
358 
359  if( clickedOk )
360  ret = dlg.GetSelections();
361 
362  return std::make_pair( clickedOk, ret );
363 }
std::pair<bool, wxArrayInt> SelectMultipleOptions ( wxWindow *  aParent,
const wxString &  aTitle,
const wxString &  aMessage,
const std::vector< std::string > &  aOptions,
bool  aDefaultState = false 
)

Definition at line 366 of file confirm.cpp.

References SelectMultipleOptions().

368 {
369  wxArrayString array;
370 
371  for( const auto& option : aOptions )
372  array.Add( option );
373 
374  return SelectMultipleOptions( aParent, aTitle, aMessage, array, aDefaultState );
375 }
std::pair< bool, wxArrayInt > SelectMultipleOptions(wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const wxArrayString &aOptions, bool aDefaultState)
Displays a dialog with checkboxes asking the user to select one or more options.
Definition: confirm.cpp:349
int SelectSingleOption ( wxWindow *  aParent,
const wxString &  aTitle,
const wxString &  aMessage,
const wxArrayString &  aOptions 
)

Displays a dialog with radioboxes asking the user to select an option.

Parameters
aParentis the parent window.
aTitleis the dialog title.
aMessageis a text label displayed in the first row of the dialog.
aOptionsis a vector of possible options.
Returns
Index of the selected option or -1 when the dialog has been cancelled.

Definition at line 284 of file confirm.cpp.

Referenced by LIB_EDIT_FRAME::selectSymLibTable().

285 {
286  wxSingleChoiceDialog dlg( aParent, aMessage, aTitle, aOptions );
287 
288  if( dlg.ShowModal() != wxID_OK )
289  return -1;
290 
291  return dlg.GetSelection();
292 }
int YesNoCancelDialog ( wxWindow *  aParent,
const wxString &  aPrimaryMessage,
const wxString &  aSecondaryMessage,
const wxString &  aYesButtonText = wxEmptyString,
const wxString &  aNoButtonText = wxEmptyString,
const wxString &  aCancelButtonText = wxEmptyString 
)

Function YesNoCancelDialog displays a yes/no/cancel dialog with aMessage and returns the user response.

Parameters
aParentis the parent window. NULL can be used if the parent is the top level window.
aPrimaryMessageis the message to display in the top part of the dialog box using a bold font.
aSecondaryMessageis the message to display in the lower part of the dialog box using the default system UI font.
aYesButtonTextis the text to display in the yes button when defined.
aNoButtonTextis the text to display in the no button when defiend.
aCancelButtonTextis the text to display in the cancel button when defined.
Returns
wxID_YES, wxID_NO, or wxID_CANCEL depending on the button the user selected.

Definition at line 270 of file confirm.cpp.

Referenced by SCH_EDIT_FRAME::AskToSaveChanges(), and PCB_EDIT_FRAME::OpenProjectFiles().

276 {
277  DIALOG_YES_NO_CANCEL dlg( aParent, aPrimaryMessage, aSecondaryMessage,
278  aYesButtonText, aNoButtonText, aCancelButtonText );
279 
280  return dlg.ShowModal();
281 }