// set this button as being currently default void wxButton::SetTmpDefault() { wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this); if ( !tlw ) return; wxWindow *winOldDefault = tlw->GetDefaultItem(); tlw->SetTmpDefaultItem(this); SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false); SetDefaultStyle(this, true); }
// unset this button as currently default, it may still stay permanent default void wxButton::UnsetTmpDefault() { wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this); if ( !tlw ) return; tlw->SetTmpDefaultItem(NULL); wxWindow *winOldDefault = tlw->GetDefaultItem(); // Just as in SetTmpDefault() above, the order is important here. SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), true); SetDefaultStyle(this, false); }
// set this button as being currently default void wxButton::SetTmpDefault() { wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this); if ( !tlw ) return; wxWindow *winOldDefault = tlw->GetDefaultItem(); tlw->SetTmpDefaultItem(this); // Notice that the order of these statements is important, the old button // is not reset if we do it the other way round, probably because of // something done by the default DM_SETDEFID handler. SetDefaultStyle(this, true); SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false); }