Fix: Trigger Name not updated when switching tab .

This commit is contained in:
Zero Fanker 2024-12-14 15:22:04 -05:00
parent b28868ba34
commit aeb807ca16
2 changed files with 20 additions and 1 deletions

View file

@ -65,6 +65,7 @@ void CTriggerOptionsDlg::DoDataExchange(CDataExchange* pDX)
BEGIN_MESSAGE_MAP(CTriggerOptionsDlg, CDialog)
//{{AFX_MSG_MAP(CTriggerOptionsDlg)
ON_WM_SHOWWINDOW()
ON_CBN_EDITCHANGE(IDC_HOUSE, OnEditchangeHouse)
ON_CBN_EDITCHANGE(IDC_ATTACHEDTRIGGER, OnEditchangeAttachedtrigger)
ON_EN_KILLFOCUS(IDC_NAME, OnChangeName)
@ -237,10 +238,26 @@ void CTriggerOptionsDlg::OnKillfocusName()
void CTriggerOptionsDlg::OnKillFocus(CWnd* pNewWnd)
{
CDialog::OnKillFocus(pNewWnd);
((CTriggerEditorDlg*)(this->GetOwner()->GetOwner()))->UpdateDialog();
}
void CTriggerOptionsDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
if (!bShow) {
if (auto pOldFocus = GetFocus()) {
switch (pOldFocus->GetDlgCtrlID())
{
case IDC_NAME: {
this->OnChangeName();
} break;
default:
break;
}
}
}
CDialog::OnShowWindow(bShow, nStatus);
}
void CTriggerOptionsDlg::OnEditchangeTriggertype()
{
CIniFile& ini = Map->GetIniFile();

View file

@ -66,6 +66,8 @@ protected:
CToolTipCtrl m_tooltip;
virtual BOOL OnInitDialog();
void OnShowWindow(BOOL bShow, UINT nStatus);
// Generierte Nachrichtenzuordnungsfunktionen
//{{AFX_MSG(CTriggerOptionsDlg)
afx_msg void OnChangeName();