- if ( affirmativeId == m_affirmativeId )
- return;
-
- // disconnect the handler for the old affirmative button
- if ( m_affirmativeId != wxID_NONE && m_affirmativeId != wxID_OK )
- {
- if ( !Disconnect
- (
- m_affirmativeId,
- wxEVT_COMMAND_BUTTON_CLICKED,
- wxCommandEventHandler(wxDialogBase::OnAffirmativeButton)
- ) )
- {
- wxFAIL_MSG( _T("failed to disconnect old ok handler") );
- }
- }
- //else: wxID_OK is always handled
-
- // connect the handler to the new button
- if ( affirmativeId != wxID_NONE )
- {
- Connect(m_affirmativeId,
- wxEVT_COMMAND_BUTTON_CLICKED,
- wxCommandEventHandler(wxDialogBase::OnAffirmativeButton));
- }
- //else: no affirmative button
-