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

View file

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