Moved data transfer from OnOK to TransferDataFromWindow() and removed all instances of OnOK and OnExit

This commit is contained in:
Cirilo Bernardo 2016-01-11 16:14:35 +11:00
parent 14bee875cf
commit c81a0d0f2f
4 changed files with 5 additions and 57 deletions

View File

@ -39,8 +39,6 @@ enum
wxBEGIN_EVENT_TABLE( DLG_CFG_3DPATH, wxDialog )
EVT_BUTTON( wxID_OK, DLG_CFG_3DPATH::OnOK )
EVT_BUTTON( wxID_CANCEL, DLG_CFG_3DPATH::OnExit )
EVT_BUTTON( btnEditPath, DLG_CFG_3DPATH::EditPath )
EVT_BUTTON( btnAddPath, DLG_CFG_3DPATH::AddPath )
EVT_BUTTON( btnDeletePath, DLG_CFG_3DPATH::DeletePath )
@ -130,28 +128,12 @@ DLG_CFG_3DPATH::DLG_CFG_3DPATH( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResol
}
void DLG_CFG_3DPATH::OnExit( wxCommandEvent& event )
bool DLG_CFG_3DPATH::TransferDataFromWindow()
{
if( IsModal() )
EndModal( wxID_EXIT );
else
Close( true );
if( resolver && resolver->UpdatePathList( m_paths ) )
return true;
return;
}
void DLG_CFG_3DPATH::OnOK( wxCommandEvent& event )
{
if( resolver )
resolver->UpdatePathList( m_paths );
if( IsModal() )
EndModal( wxID_OK );
else
Close( true );
return;
return false;
}

View File

@ -47,10 +47,9 @@ private:
public:
DLG_CFG_3DPATH( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver );
virtual bool TransferDataFromWindow();
private:
void OnExit( wxCommandEvent& event );
void OnOK( wxCommandEvent& event );
void EditPath( wxCommandEvent& event );
void AddPath( wxCommandEvent& event );
void DeletePath( wxCommandEvent& event );

View File

@ -38,11 +38,6 @@ static wxWindow* mkPreviewPanel( wxWindow* aParent )
return (wxWindow*)pp;
}
wxBEGIN_EVENT_TABLE( DLG_SEL_3DMODEL, wxFileDialog )
EVT_BUTTON( wxID_OK, DLG_SEL_3DMODEL::OnOK )
EVT_BUTTON( wxID_CANCEL, DLG_SEL_3DMODEL::OnExit )
wxEND_EVENT_TABLE()
DLG_SEL_3DMODEL::DLG_SEL_3DMODEL( wxWindow* aParent, S3D_CACHE* aManager,
const wxString& aDefaultDir, int aFilterIndex )
@ -86,28 +81,6 @@ DLG_SEL_3DMODEL::DLG_SEL_3DMODEL( wxWindow* aParent, S3D_CACHE* aManager,
}
void DLG_SEL_3DMODEL::OnExit( wxCommandEvent& event )
{
if( IsModal() )
EndModal( wxID_EXIT );
else
Close( true );
return;
}
void DLG_SEL_3DMODEL::OnOK( wxCommandEvent& event )
{
if( IsModal() )
EndModal( wxID_OK );
else
Close( true );
return;
}
void DLG_SEL_3DMODEL::GetModelData( S3D_INFO* aModel )
{
PANEL_PREV_3D* pp = (PANEL_PREV_3D*)GetExtraControl();

View File

@ -46,12 +46,6 @@ public:
// Retrieve model data
void GetModelData( S3D_INFO* aModel );
private:
void OnExit( wxCommandEvent& event );
void OnOK( wxCommandEvent& event );
wxDECLARE_EVENT_TABLE();
};
#endif // DIALOG_SELECT_3DMODEL_H