Skip to content

Commit 9437ece

Browse files
committed
Alt+Enter now edits the Send box in the trigger/alias/timer editing dialog boxes
1 parent e901b4e commit 9437ece

File tree

6 files changed

+45
-0
lines changed

6 files changed

+45
-0
lines changed

dialogs/world_prefs/TimerDlg.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,16 @@ CEditMultiLine dlg;
404404

405405
}
406406

407+
408+
// Alt+Return edits "send" text
409+
BOOL CTimerDlg::PreTranslateMessage(MSG* pMsg)
410+
{
411+
if (pMsg->message == WM_SYSKEYDOWN &&
412+
pMsg->wParam == VK_RETURN)
413+
{
414+
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
415+
return FALSE;
416+
}
417+
418+
return CDialog::PreTranslateMessage(pMsg);
419+
}

dialogs/world_prefs/TimerDlg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class CTimerDlg : public CDialog
5858
// Overrides
5959
// ClassWizard generated virtual function overrides
6060
//{{AFX_VIRTUAL(CTimerDlg)
61+
public:
62+
virtual BOOL PreTranslateMessage(MSG* pMsg);
6163
protected:
6264
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
6365
//}}AFX_VIRTUAL

dialogs/world_prefs/aliasdlg.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,16 @@ CEditMultiLine dlg;
535535

536536
}
537537

538+
539+
// Alt+Return edits "send" text
540+
BOOL CAliasDlg::PreTranslateMessage(MSG* pMsg)
541+
{
542+
if (pMsg->message == WM_SYSKEYDOWN &&
543+
pMsg->wParam == VK_RETURN)
544+
{
545+
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
546+
return FALSE;
547+
}
548+
549+
return CDialog::PreTranslateMessage(pMsg);
550+
}

dialogs/world_prefs/aliasdlg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class CAliasDlg : public CDialog
5656
// Overrides
5757
// ClassWizard generated virtual function overrides
5858
//{{AFX_VIRTUAL(CAliasDlg)
59+
public:
60+
virtual BOOL PreTranslateMessage(MSG* pMsg);
5961
protected:
6062
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
6163
//}}AFX_VIRTUAL

dialogs/world_prefs/triggdlg.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,3 +823,16 @@ if (GetText (m_ctlLinesToMatch) == "0")
823823
m_ctlLinesToMatch.SetWindowText ("2");
824824

825825
}
826+
827+
// Alt+Return edits "send" text
828+
BOOL CTriggerDlg::PreTranslateMessage(MSG* pMsg)
829+
{
830+
if (pMsg->message == WM_SYSKEYDOWN &&
831+
pMsg->wParam == VK_RETURN)
832+
{
833+
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
834+
return FALSE;
835+
}
836+
837+
return CDialog::PreTranslateMessage(pMsg);
838+
}

dialogs/world_prefs/triggdlg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class CTriggerDlg : public CDialog
9797
// Overrides
9898
// ClassWizard generated virtual function overrides
9999
//{{AFX_VIRTUAL(CTriggerDlg)
100+
public:
101+
virtual BOOL PreTranslateMessage(MSG* pMsg);
100102
protected:
101103
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
102104
//}}AFX_VIRTUAL

0 commit comments

Comments
 (0)