Return key detection in richedit control now implemented correctly.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@956 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
sunjammerx 2002-09-08 11:02:28 +00:00
parent 68a95feae8
commit 684029a008

View file

@ -673,7 +673,7 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
hwLicense=GetDlgItem(hwndDlg,IDC_EDIT1); hwLicense=GetDlgItem(hwndDlg,IDC_EDIT1);
SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0); SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0);
SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg>=0?g_inst_header->license_bg:GetSysColor(COLOR_BTNFACE)); SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg>=0?g_inst_header->license_bg:GetSysColor(COLOR_BTNFACE));
SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK|ENM_KEYEVENTS); SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK|ENM_KEYEVENTS); //XGE 8th September 2002 Or'd in ENM_KEYEVENTS
dwRead=0; dwRead=0;
SendMessage(hwLicense,EM_STREAMIN,(((char*)es.dwCookie)[0]=='{')?SF_RTF:SF_TEXT,(LPARAM)&es); SendMessage(hwLicense,EM_STREAMIN,(((char*)es.dwCookie)[0]=='{')?SF_RTF:SF_TEXT,(LPARAM)&es);
SetUITextFromLang(hwndDlg,IDC_INTROTEXT,g_inst_header->common.intro_text_id,LANGID_LICENSE_TEXT); SetUITextFromLang(hwndDlg,IDC_INTROTEXT,g_inst_header->common.intro_text_id,LANGID_LICENSE_TEXT);
@ -685,6 +685,7 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
} }
else if (uMsg == WM_NOTIFY) { else if (uMsg == WM_NOTIFY) {
ENLINK *enlink=(ENLINK *)lParam; ENLINK *enlink=(ENLINK *)lParam;
MSGFILTER* msgfilter=(MSGFILTER *)lParam;
if (enlink->nmhdr.code==EN_LINK) { if (enlink->nmhdr.code==EN_LINK) {
if (enlink->msg==WM_LBUTTONDOWN) { if (enlink->msg==WM_LBUTTONDOWN) {
char *szUrl; char *szUrl;
@ -704,15 +705,15 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SetCursor(LoadCursor(0,IDC_HAND)); SetCursor(LoadCursor(0,IDC_HAND));
} }
} }
// nmhdr.code==EN_MSGFILTER but I noticed that the 3e8 value I *was* //Ximon Eighteen 8th September 2002 Capture return key presses in the rich
// getting contains the bits set by EN_MSGFILTER so I figured I'd set //edit control now that the control gets the focus rather than the default
// this to & EN_MSGFILTER and pray :) Since it only works when return //push button. When the user presses return ask the outer dialog to move
// is pressed *and* in that case both these tests pass I figure that //the installer onto the next page. MSDN docs say return non-zero if the
// must be correct... wish it was documented somewhere gawd damnit! //rich edit control should NOT process this message, hence the return 1.
else if (((MSGFILTER*)lParam)->nmhdr.code&EN_MSGFILTER) else if (msgfilter->nmhdr.code==EN_MSGFILTER)
{ {
if (((MSGFILTER*)lParam)->msg==WM_KEYDOWN && if (msgfilter->msg==WM_KEYDOWN &&
((MSGFILTER*)lParam)->wParam==VK_RETURN) msgfilter->wParam==VK_RETURN)
{ {
SendMessage(g_hwnd,WM_NOTIFY_OUTER_NEXT,1,0); SendMessage(g_hwnd,WM_NOTIFY_OUTER_NEXT,1,0);
return 1; return 1;