Commit d0927f63 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

wordpad: Fixed bugs that prevented setting alignment through dialog.

The combobox to select the alignment in the paragraph format dialog did not have enough height to display the dropdown list. Also, code was missing to set the alignment when OK button is pressed. This patch fixes these issues.
parent 7fe5d6ad
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "Frste linie", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Justering", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Annuller", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "Erste Zeile", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Ausrichtung", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "A&bbrechen", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Annuler", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -141,7 +141,7 @@ BEGIN
LTEXT "첫째 줄", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "정렬", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "확인(&O)", IDOK, 137, 15, 50, 15
PUSHBUTTON "취소(&C)", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT "Frste linje", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Justering", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Avbryt", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -140,7 +140,7 @@ BEGIN
LTEXT "Pierwszy wiersz", 0, 15, 55, 40, 19
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Wyrwnanie", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Anuluj", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -139,7 +139,7 @@ BEGIN
LTEXT " ", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&", IDOK, 137, 15, 50, 15
PUSHBUTTON "&", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -141,7 +141,7 @@ BEGIN
LTEXT "Prva vrstica", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Poravnava", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&V redu", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Prekliči", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -141,7 +141,7 @@ BEGIN
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
......
......@@ -1389,6 +1389,8 @@ static INT_PTR CALLBACK newfile_proc(HWND hWnd, UINT message, WPARAM wParam, LPA
static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static const WORD ALIGNMENT_VALUES[] = {PFA_LEFT, PFA_RIGHT, PFA_CENTER};
switch(message)
{
case WM_INITDIALOG:
......@@ -1439,14 +1441,19 @@ static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam,
{
case IDOK:
{
HWND hListWnd = GetDlgItem(hWnd, IDC_PARA_ALIGN);
HWND hLeftWnd = GetDlgItem(hWnd, IDC_PARA_LEFT);
HWND hRightWnd = GetDlgItem(hWnd, IDC_PARA_RIGHT);
HWND hFirstWnd = GetDlgItem(hWnd, IDC_PARA_FIRST);
WCHAR buffer[MAX_STRING_LEN];
int index;
float num;
int ret = 0;
PARAFORMAT pf;
index = SendMessageW(hListWnd, CB_GETCURSEL, 0, 0);
pf.wAlignment = ALIGNMENT_VALUES[index];
GetWindowTextW(hLeftWnd, buffer, MAX_STRING_LEN);
if(number_from_string(buffer, &num, TRUE))
ret++;
......@@ -1490,7 +1497,8 @@ static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam,
pf.dxOffset = pf.dxOffset - pf.dxStartIndent;
pf.cbSize = sizeof(pf);
pf.dwMask = PFM_OFFSET | PFM_STARTINDENT | PFM_RIGHTINDENT;
pf.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_RIGHTINDENT |
PFM_STARTINDENT;
SendMessageW(hEditorWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment