mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 21:33:37 +00:00
comdlg32/fontdlg: Allow setting value by typing it into the edit fields.
The font-dialog allows the user to select a value from the combobox by typing it into its edit field. This operation seems unique to the fontdialog. It works case-insensitively and doesn't change the selection in the edit field. Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
500f077dd6
commit
aa7941d41b
|
@ -940,14 +940,37 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
|
||||||
int i;
|
int i;
|
||||||
long l;
|
long l;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
BOOL cmb_selected_by_edit = FALSE;
|
||||||
|
|
||||||
if (!lpcf) return FALSE;
|
if (!lpcf) return FALSE;
|
||||||
|
|
||||||
|
if(HIWORD(wParam) == CBN_EDITCHANGE)
|
||||||
|
{
|
||||||
|
int idx;
|
||||||
|
WCHAR str_edit[256], str_cmb[256];
|
||||||
|
int cmb = LOWORD(wParam);
|
||||||
|
|
||||||
|
GetDlgItemTextW(hDlg, cmb, str_edit, sizeof(str_edit) / sizeof(str_edit[0]));
|
||||||
|
idx = SendDlgItemMessageW(hDlg, cmb, CB_FINDSTRING, -1, (LPARAM)str_edit);
|
||||||
|
if(idx != -1)
|
||||||
|
{
|
||||||
|
SendDlgItemMessageW(hDlg, cmb, CB_GETLBTEXT, idx, (LPARAM)str_cmb);
|
||||||
|
|
||||||
|
/* Select listbox entry only if we have an exact match */
|
||||||
|
if(lstrcmpiW(str_edit, str_cmb) == 0)
|
||||||
|
{
|
||||||
|
SendDlgItemMessageW(hDlg, cmb, CB_SETCURSEL, idx, 0);
|
||||||
|
SendDlgItemMessageW(hDlg, cmb, CB_SETEDITSEL, 0, -1); /* Remove edit field selection */
|
||||||
|
cmb_selected_by_edit = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("WM_COMMAND wParam=%08X lParam=%08lX\n", (LONG)wParam, lParam);
|
TRACE("WM_COMMAND wParam=%08X lParam=%08lX\n", (LONG)wParam, lParam);
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case cmb1:
|
case cmb1:
|
||||||
if (HIWORD(wParam)==CBN_SELCHANGE)
|
if (HIWORD(wParam) == CBN_SELCHANGE || cmb_selected_by_edit)
|
||||||
{
|
{
|
||||||
INT pointsize; /* save current pointsize */
|
INT pointsize; /* save current pointsize */
|
||||||
LONG pstyle; /* save current style */
|
LONG pstyle; /* save current style */
|
||||||
|
@ -998,7 +1021,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
|
||||||
case cmb2:
|
case cmb2:
|
||||||
case cmb3:
|
case cmb3:
|
||||||
case cmb5:
|
case cmb5:
|
||||||
if (HIWORD(wParam)==CBN_SELCHANGE || HIWORD(wParam)== BN_CLICKED )
|
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == BN_CLICKED || cmb_selected_by_edit)
|
||||||
{
|
{
|
||||||
WCHAR str[256];
|
WCHAR str[256];
|
||||||
WINDOWINFO wininfo;
|
WINDOWINFO wininfo;
|
||||||
|
|
Loading…
Reference in a new issue