add part of the patch from bug 2805 with some minor changes

See issue #2805 for more details.

svn path=/trunk/; revision=30442
This commit is contained in:
Ged Murphy 2007-11-14 13:05:51 +00:00
parent 06f3a18483
commit 8b43f34cf0
2 changed files with 28 additions and 50 deletions

View file

@ -68,9 +68,8 @@ FillFontStyleComboList(HWND hwndCombo)
(WPARAM)hFont,
0);
ZeroMemory(&lf, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfFaceName[0] = L'\0'; // all fonts
lf.lfPitchAndFamily = 0;
hdc = GetDC(hwndCombo);
@ -123,6 +122,10 @@ ChangeMapFont(HWND hDlg)
0,
(LPARAM)lpFontName);
}
HeapFree(GetProcessHeap(),
0,
lpFontName);
}
}
@ -250,12 +253,23 @@ DlgProc(HWND hDlg,
}
return TRUE;
}
break;
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case IDC_FONTMAP:
{
switch (HIWORD(wParam))
{
case FM_SETCHAR:
AddCharToSelection(GetDlgItem(hDlg, IDC_TEXTBOX),
LOWORD(lParam));
break;
}
}
break;
case IDC_FONTCOMBO:
{
if (HIWORD(wParam) == CBN_SELCHANGE)
@ -303,29 +317,6 @@ DlgProc(HWND hDlg,
}
break;
case WM_NOTIFY:
{
LPMAPNOTIFY lpnm = (LPMAPNOTIFY)lParam;
switch (lpnm->hdr.idFrom)
{
case IDC_FONTMAP:
{
switch (lpnm->hdr.code)
{
case FM_SETCHAR:
{
AddCharToSelection(GetDlgItem(hDlg, IDC_TEXTBOX),
lpnm->ch);
}
break;
}
}
break;
}
}
break;
case WM_CLOSE:
if (hSmIcon)
DestroyIcon(hSmIcon);

View file

@ -211,19 +211,16 @@ NotifyParentOfSelection(PMAP infoPtr,
if (infoPtr->hParent != NULL)
{
MAPNOTIFY mnmh;
mnmh.hdr.hwndFrom = infoPtr->hMapWnd;
mnmh.hdr.idFrom = GetWindowLongPtr(infoPtr->hMapWnd,
GWLP_ID);
mnmh.hdr.code = code;
mnmh.ch = ch;
Ret = SendMessageW(infoPtr->hParent,
WM_NOTIFY,
(WPARAM)mnmh.hdr.idFrom,
(LPARAM)&mnmh);
DWORD dwIdc = GetWindowLongPtr(infoPtr->hMapWnd, GWLP_ID);
/*
* Push directly into the event queue instead of waiting
* the parent to be unlocked.
* High word of LPARAM is still available for future needs...
*/
Ret = PostMessage(infoPtr->hParent,
WM_COMMAND,
MAKELPARAM((WORD)dwIdc, (WORD)code),
(LPARAM)LOWORD(ch));
}
return Ret;
@ -509,18 +506,8 @@ MapWndProc(HWND hwnd,
}
case FM_SETFONT:
{
LPWSTR lpFontName = (LPWSTR)lParam;
SetFont(infoPtr,
lpFontName);
HeapFree(GetProcessHeap(),
0,
lpFontName);
SetFont(infoPtr, (LPWSTR)lParam);
break;
}
case FM_GETCHAR:
{