Skip to content

Commit

Permalink
Alt+Enter now edits the Send box in the trigger/alias/timer editing d…
Browse files Browse the repository at this point in the history
…ialog boxes
  • Loading branch information
nickgammon committed Jul 12, 2011
1 parent e901b4e commit 9437ece
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dialogs/world_prefs/TimerDlg.cpp
Expand Up @@ -404,3 +404,16 @@ CEditMultiLine dlg;

}


// Alt+Return edits "send" text
BOOL CTimerDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_SYSKEYDOWN &&
pMsg->wParam == VK_RETURN)
{
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
return FALSE;
}

return CDialog::PreTranslateMessage(pMsg);
}
2 changes: 2 additions & 0 deletions dialogs/world_prefs/TimerDlg.h
Expand Up @@ -58,6 +58,8 @@ class CTimerDlg : public CDialog
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTimerDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
Expand Down
13 changes: 13 additions & 0 deletions dialogs/world_prefs/aliasdlg.cpp
Expand Up @@ -535,3 +535,16 @@ CEditMultiLine dlg;

}


// Alt+Return edits "send" text
BOOL CAliasDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_SYSKEYDOWN &&
pMsg->wParam == VK_RETURN)
{
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
return FALSE;
}

return CDialog::PreTranslateMessage(pMsg);
}
2 changes: 2 additions & 0 deletions dialogs/world_prefs/aliasdlg.h
Expand Up @@ -56,6 +56,8 @@ class CAliasDlg : public CDialog
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAliasDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
Expand Down
13 changes: 13 additions & 0 deletions dialogs/world_prefs/triggdlg.cpp
Expand Up @@ -823,3 +823,16 @@ if (GetText (m_ctlLinesToMatch) == "0")
m_ctlLinesToMatch.SetWindowText ("2");

}

// Alt+Return edits "send" text
BOOL CTriggerDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_SYSKEYDOWN &&
pMsg->wParam == VK_RETURN)
{
PostMessage(WM_COMMAND, MAKELONG(IDC_EDIT_SEND, BN_CLICKED), NULL);
return FALSE;
}

return CDialog::PreTranslateMessage(pMsg);
}
2 changes: 2 additions & 0 deletions dialogs/world_prefs/triggdlg.h
Expand Up @@ -97,6 +97,8 @@ class CTriggerDlg : public CDialog
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTriggerDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
Expand Down

0 comments on commit 9437ece

Please sign in to comment.