本文整理汇总了C++中SetReturnCode函数的典型用法代码示例。如果您正苦于以下问题:C++ SetReturnCode函数的具体用法?C++ SetReturnCode怎么用?C++ SetReturnCode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetReturnCode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetReturnCode
void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event )
{
SetReturnCode( wxID_OK );
SetDrcParmeters();
m_tester->DestroyDialog( wxID_OK );
}
示例2: DIALOG_COPPER_ZONE_BASE
DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) :
DIALOG_COPPER_ZONE_BASE( aParent )
{
m_Parent = aParent;
m_Config = Kiface().KifaceSettings();
m_ptr = aSettings;
m_settings = *aSettings;
m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
m_OnExitCode = ZONE_ABORT;
SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
// Fix static text widget minimum width to a suitable value so that
// resizing the dialog is not necessary when changing the corner smoothing type.
// Depends on the default text in the widget.
m_cornerSmoothingTitle->SetMinSize( m_cornerSmoothingTitle->GetSize() );
initDialog();
m_sdbSizerOK->SetDefault();
GetSizer()->SetSizeHints( this );
Center();
}
示例3: EndModal
void DlgSaveLayout::OnOkClick( wxCommandEvent& event )
{
if(!m_ComboLayout->GetValue().IsEmpty())
{
if(bSave)
{
wxMainFrame::Get()->AddLayout(m_ComboLayout->GetValue());
}
else
{
wxMainFrame::Get()->RemoveLayout(m_ComboLayout->GetValue());
}
if ( IsModal() )
EndModal(wxID_OK); // If modal
else
{
SetReturnCode(wxID_OK);
this->Show(false); // If modeless
}
}
else
{
wxMessageBox(wxT("You must enter a layout name"), wxT("Error"));
}
}
示例4: SetReturnCode
void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
{
BOARD* board = m_parent->GetBoard();
SetReturnCode( ZONE_ABORT ); // Will be changed on button click
AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit );
wxString msg = StringFromValue( g_UserUnit, m_settings.m_ZoneMinThickness );
m_ZoneMinThicknessCtrl->SetValue( msg );
if( m_settings.m_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 );
switch( m_settings.m_Zone_HatchingStyle )
{
case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection( 0 );
break;
case CPolyLine::DIAGONAL_EDGE:
m_OutlineAppearanceCtrl->SetSelection( 1 );
break;
case CPolyLine::DIAGONAL_FULL:
m_OutlineAppearanceCtrl->SetSelection( 2 );
break;
}
// Create one column in m_LayerSelectionCtrl
wxListItem column0;
column0.SetId( 0 );
m_LayerSelectionCtrl->InsertColumn( 0, column0 );
// Create an icon list:
wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
int ii = 0;
int lyrSelect = ( (PCB_SCREEN*) m_parent->GetScreen() )->m_Active_Layer;
if( m_zone )
lyrSelect = m_zone->GetLayer();
for( LSEQ seq = LSET::AllNonCuMask().Seq(); seq; ++seq, ++ii )
{
LAYER_ID layer = *seq;
EDA_COLOR_T layerColor = board->GetLayerColor( layer );
imageList->Add( makeLayerBitmap( layerColor ) );
wxString msg = board->GetLayerName( layer );
msg.Trim();
int itemIndex = m_LayerSelectionCtrl->InsertItem(
m_LayerSelectionCtrl->GetItemCount(), msg, ii );
if(lyrSelect == layer )
m_LayerSelectionCtrl->Select( itemIndex );
}
}
示例5: EndModal
void ParamEdit::Close() {
if (IsModal())
EndModal(wxID_OK);
else {
SetReturnCode(wxID_OK);
Show(false);
}
}
示例6: wxASSERT_MSG
void wxDialog::EndModal(int retCode)
{
wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") );
SetReturnCode(retCode);
Hide();
}
示例7: SetReturnCode
void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event )
{
SetReturnCode( wxID_CANCEL );
// The dialog can be modal or not modal.
// Leave the DRC caller destroy (or not) the dialog
m_tester->DestroyDRCDialog( wxID_CANCEL );
}
示例8: SetReturnCode
// NB: this function (surprisingly) may be called for both modal and modeless
// dialogs and should work for both of them
void wxDialog::EndModal(int retCode)
{
if ( m_eventLoop )
m_eventLoop->Exit(retCode);
SetReturnCode(retCode);
Show(false);
}
示例9: WXUNUSED
void CConfigChooser::onCancel(wxCommandEvent& WXUNUSED(event))
{
if (IsModal()) {
EndModal(wxID_CANCEL);
} else {
SetReturnCode(wxID_CANCEL);
Show(false);
}
}
示例10: wxASSERT_MSG
void wxDialog::EndModal(int retCode)
{
wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
// m_endModalCalled = true;
SetReturnCode(retCode);
Hide();
}
示例11: SetReturnCode
//----------------------------------------------------------------
void CommandDialog::OnButtonCancelClick(wxCommandEvent& event)
/**
* \brief Occurs when the Cancel Button is clicked. Closes the Dialog.
* \param event CommandEvent.
**/
{
SetReturnCode(wxID_CANCEL);
Destroy();
}
示例12: EndModal
void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event )
{
if( IsModal() )
EndModal( wxID_CANCEL );
else
{
SetReturnCode( wxID_CANCEL );
this->Show( false );
}
}
示例13: ShowModal
void wxDialogBase::ShowWindowModal ()
{
int retval = ShowModal();
// wxWindowModalDialogEvent relies on GetReturnCode() returning correct
// code. Rather than doing it manually in all ShowModal() overrides for
// native dialogs (and getting accidentally broken again), set it here.
// The worst that can happen is that it will be set twice to the same
// value.
SetReturnCode(retval);
SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
}
示例14: ApplyLimit
void filter_dlg::OnOK(wxCommandEvent &event) {
if (Validate() && TransferDataFromWindow()) {
ApplyLimit();
ExecFilter();
if (IsModal()) {
EndModal(wxID_OK);
} else {
SetReturnCode(wxID_OK);
Show(false);
}
}
}
示例15: DIALOG_GENDRILL_BASE
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) :
DIALOG_GENDRILL_BASE( parent )
{
m_parent = parent;
m_board = parent->GetBoard();
m_config = Kiface().KifaceSettings();
m_plotOpts = m_parent->GetPlotSettings();
SetReturnCode( 1 );
initDialog();
GetSizer()->SetSizeHints( this );
}