mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Lauri Tulmin <lauri_@ut.ee> implement word wrap
svn path=/trunk/; revision=17995
This commit is contained in:
parent
1e482c105d
commit
05a74dc2dd
1 changed files with 26 additions and 0 deletions
|
@ -720,6 +720,32 @@ VOID DIALOG_EditTimeDate(VOID)
|
||||||
|
|
||||||
VOID DIALOG_EditWrap(VOID)
|
VOID DIALOG_EditWrap(VOID)
|
||||||
{
|
{
|
||||||
|
static const WCHAR editW[] = { 'e','d','i','t',0 };
|
||||||
|
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
|
||||||
|
ES_AUTOVSCROLL | ES_MULTILINE;
|
||||||
|
RECT rc;
|
||||||
|
DWORD size;
|
||||||
|
LPWSTR pTemp;
|
||||||
|
|
||||||
|
size = GetWindowTextLength(Globals.hEdit) + 1;
|
||||||
|
pTemp = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
|
||||||
|
if (!pTemp)
|
||||||
|
{
|
||||||
|
ShowLastError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GetWindowText(Globals.hEdit, pTemp, size);
|
||||||
|
DestroyWindow(Globals.hEdit);
|
||||||
|
GetClientRect(Globals.hMainWnd, &rc);
|
||||||
|
if( Globals.bWrapLongLines ) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
|
||||||
|
Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL, dwStyle,
|
||||||
|
0, 0, rc.right, rc.bottom, Globals.hMainWnd,
|
||||||
|
NULL, Globals.hInstance, NULL);
|
||||||
|
SendMessage(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)FALSE);
|
||||||
|
SetWindowTextW(Globals.hEdit, pTemp);
|
||||||
|
SetFocus(Globals.hEdit);
|
||||||
|
HeapFree(GetProcessHeap(), 0, pTemp);
|
||||||
|
|
||||||
Globals.bWrapLongLines = !Globals.bWrapLongLines;
|
Globals.bWrapLongLines = !Globals.bWrapLongLines;
|
||||||
CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP,
|
CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP,
|
||||||
MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
|
MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
|
||||||
|
|
Loading…
Reference in a new issue