mirror of https://github.com/adamdruppe/arsd.git
windows fixes
This commit is contained in:
parent
af47ae19c2
commit
16c4348b83
|
@ -5576,15 +5576,15 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
||||||
} else version(win32_widgets) {
|
} else version(win32_widgets) {
|
||||||
// get the current selection
|
// get the current selection
|
||||||
DWORD StartPos, EndPos;
|
DWORD StartPos, EndPos;
|
||||||
SendMessageW( hwnd, EM_GETSEL, cast(WPARAM)(&StartPos), cast(WPARAM)(&EndPos) );
|
SendMessageW( hwnd, EM_GETSEL, cast(WPARAM)(&StartPos), cast(LPARAM)(&EndPos) );
|
||||||
|
|
||||||
// move the caret to the end of the text
|
// move the caret to the end of the text
|
||||||
int outLength = GetWindowTextLengthW( hwndOutput );
|
int outLength = GetWindowTextLengthW( hwnd );
|
||||||
SendMessageW( hwnd, EM_SETSEL, outLength, outLength );
|
SendMessageW( hwnd, EM_SETSEL, outLength, outLength );
|
||||||
|
|
||||||
// insert the text at the new caret position
|
// insert the text at the new caret position
|
||||||
WCharzBuffer bfr = WCharzBuffer(txt, WindowsStringConversionFlags.convertNewLines);
|
WCharzBuffer bfr = WCharzBuffer(txt, WindowsStringConversionFlags.convertNewLines);
|
||||||
SendMessageW( hwnd, EM_REPLACESEL, TRUE, txt );
|
SendMessageW( hwnd, EM_REPLACESEL, TRUE, cast(LPARAM) bfr.ptr );
|
||||||
|
|
||||||
// restore the previous selection
|
// restore the previous selection
|
||||||
SendMessageW( hwnd, EM_SETSEL, StartPos, EndPos );
|
SendMessageW( hwnd, EM_SETSEL, StartPos, EndPos );
|
||||||
|
|
Loading…
Reference in New Issue