From 2ed29a7fa0e36c2efd68db24a6e08448144eb6d1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 29 May 2016 21:13:03 -0400 Subject: [PATCH] More stuff. Screw this; releasing as is. --- windows/multilineentry.cpp | 13 +++++-------- windows/resources.rc | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/windows/multilineentry.cpp b/windows/multilineentry.cpp index bac05752..7151cdd0 100644 --- a/windows/multilineentry.cpp +++ b/windows/multilineentry.cpp @@ -1,8 +1,7 @@ // 8 april 2015 #include "uipriv_windows.hpp" -// TODO there's alpha darkening of text going on; something is up in our parent logic -// TODO resizing collapses newlines +// TODO there's alpha darkening of text going on in read-only ones; something is up in our parent logic struct uiMultilineEntry { uiWindowsControl c; @@ -38,7 +37,7 @@ uiWindowsControlAllDefaultsExceptDestroy(uiMultilineEntry) // from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing #define entryWidth 107 /* this is actually the shorter progress bar width, but Microsoft only indicates as wide as necessary */ -// TODO change this for multiline text boxes +// LONGTERM change this for multiline text boxes (longterm because how?) #define entryHeight 14 static void uiMultilineEntryMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height) @@ -60,7 +59,6 @@ static void defaultOnChanged(uiMultilineEntry *e, void *data) // do nothing } -// TODO apply crlf conversion char *uiMultilineEntryText(uiMultilineEntry *e) { char *out; @@ -70,7 +68,6 @@ char *uiMultilineEntryText(uiMultilineEntry *e) return out; } -// TODO apply crlf conversion void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text) { char *crlf; @@ -84,17 +81,16 @@ void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text) // don't queue the control for resize; entry sizes are independent of their contents } -// TOOD crlf stuff void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text) { LRESULT n; char *crlf; WCHAR *wtext; - // TODO does doing this raise EN_CHANGED? + // doing this raises an EN_CHANGED + e->inhibitChanged = TRUE; // TODO preserve selection? caret? what if caret used to be at end? // TODO scroll to bottom? - // TODO overdraw issues n = SendMessageW(e->hwnd, WM_GETTEXTLENGTH, 0, 0); SendMessageW(e->hwnd, EM_SETSEL, n, n); crlf = LFtoCRLF(text); @@ -102,6 +98,7 @@ void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text) uiFree(crlf); SendMessageW(e->hwnd, EM_REPLACESEL, FALSE, (LPARAM) wtext); uiFree(wtext); + e->inhibitChanged = FALSE; } void uiMultilineEntryOnChanged(uiMultilineEntry *e, void (*f)(uiMultilineEntry *, void *), void *data) diff --git a/windows/resources.rc b/windows/resources.rc index dc60b5e0..74402dfb 100644 --- a/windows/resources.rc +++ b/windows/resources.rc @@ -6,7 +6,7 @@ #pragma code_page(65001) // this is the Common Controls 6 manifest -// TODO set up the string values here +// LONGTERM set up the string values here #ifndef _UI_STATIC ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "libui.manifest" #endif @@ -21,8 +21,8 @@ END // this is for our custom DirectWrite-based font dialog (see fontdialog.cpp) // this is based on the "New Font Dialog with Syslink" in Microsoft's font.dlg -// TODO look at localization -// TODO make it look tighter and nicer like the real one, including the actual heights of the font family and style comboboxes +// LONGTERM look at localization +// LONGTERM make it look tighter and nicer like the real one, including the actual heights of the font family and style comboboxes rcFontDialog DIALOGEX 13, 54, 243, 200 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_3DLOOK CAPTION "Font"