mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-08 12:41:42 -04:00
taskforce dialog handles 'enter' key properly, synced from FA2RN expansion .
This commit is contained in:
parent
358fd7e288
commit
9b2134cee9
2 changed files with 38 additions and 0 deletions
|
@ -500,3 +500,38 @@ void CTaskForce::OnChangeGroup()
|
|||
UpdateDialog();
|
||||
|
||||
}
|
||||
|
||||
BOOL CTaskForce::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if (pMsg->message == WM_KEYDOWN) {
|
||||
switch (pMsg->wParam) {
|
||||
case VK_RETURN:
|
||||
{
|
||||
auto pEdit = this->m_UnitType.GetWindow(GW_CHILD);
|
||||
if (pMsg->hwnd == pEdit->m_hWnd) {
|
||||
this->OnEditchangeUnittype();
|
||||
}
|
||||
|
||||
switch (::GetDlgCtrlID(pMsg->hwnd)) {
|
||||
case IDC_NAME:
|
||||
this->OnChangeName();
|
||||
break;
|
||||
case IDC_NUMBERUNITS:
|
||||
this->OnChangeNumberunits();
|
||||
break;
|
||||
case IDC_GROUP:
|
||||
this->OnChangeGroup();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//do not exit dialog when enter key pressed
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return this->CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
|
@ -61,6 +61,9 @@ protected:
|
|||
|
||||
// Implementierung
|
||||
protected:
|
||||
|
||||
BOOL PreTranslateMessage(MSG* pMsg) override;
|
||||
|
||||
// Generierte Nachrichtenzuordnungsfunktionen
|
||||
//{{AFX_MSG(CTaskForce)
|
||||
afx_msg void OnEditchangeTaskforces();
|
||||
|
|
Loading…
Add table
Reference in a new issue