More stuff. Screw this; releasing as is.
This commit is contained in:
parent
a226c80993
commit
2ed29a7fa0
|
@ -1,8 +1,7 @@
|
||||||
// 8 april 2015
|
// 8 april 2015
|
||||||
#include "uipriv_windows.hpp"
|
#include "uipriv_windows.hpp"
|
||||||
|
|
||||||
// TODO there's alpha darkening of text going on; something is up in our parent logic
|
// TODO there's alpha darkening of text going on in read-only ones; something is up in our parent logic
|
||||||
// TODO resizing collapses newlines
|
|
||||||
|
|
||||||
struct uiMultilineEntry {
|
struct uiMultilineEntry {
|
||||||
uiWindowsControl c;
|
uiWindowsControl c;
|
||||||
|
@ -38,7 +37,7 @@ uiWindowsControlAllDefaultsExceptDestroy(uiMultilineEntry)
|
||||||
|
|
||||||
// from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing
|
// 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 */
|
#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
|
#define entryHeight 14
|
||||||
|
|
||||||
static void uiMultilineEntryMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height)
|
static void uiMultilineEntryMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height)
|
||||||
|
@ -60,7 +59,6 @@ static void defaultOnChanged(uiMultilineEntry *e, void *data)
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO apply crlf conversion
|
|
||||||
char *uiMultilineEntryText(uiMultilineEntry *e)
|
char *uiMultilineEntryText(uiMultilineEntry *e)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out;
|
||||||
|
@ -70,7 +68,6 @@ char *uiMultilineEntryText(uiMultilineEntry *e)
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO apply crlf conversion
|
|
||||||
void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text)
|
void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text)
|
||||||
{
|
{
|
||||||
char *crlf;
|
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
|
// don't queue the control for resize; entry sizes are independent of their contents
|
||||||
}
|
}
|
||||||
|
|
||||||
// TOOD crlf stuff
|
|
||||||
void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)
|
void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)
|
||||||
{
|
{
|
||||||
LRESULT n;
|
LRESULT n;
|
||||||
char *crlf;
|
char *crlf;
|
||||||
WCHAR *wtext;
|
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 preserve selection? caret? what if caret used to be at end?
|
||||||
// TODO scroll to bottom?
|
// TODO scroll to bottom?
|
||||||
// TODO overdraw issues
|
|
||||||
n = SendMessageW(e->hwnd, WM_GETTEXTLENGTH, 0, 0);
|
n = SendMessageW(e->hwnd, WM_GETTEXTLENGTH, 0, 0);
|
||||||
SendMessageW(e->hwnd, EM_SETSEL, n, n);
|
SendMessageW(e->hwnd, EM_SETSEL, n, n);
|
||||||
crlf = LFtoCRLF(text);
|
crlf = LFtoCRLF(text);
|
||||||
|
@ -102,6 +98,7 @@ void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)
|
||||||
uiFree(crlf);
|
uiFree(crlf);
|
||||||
SendMessageW(e->hwnd, EM_REPLACESEL, FALSE, (LPARAM) wtext);
|
SendMessageW(e->hwnd, EM_REPLACESEL, FALSE, (LPARAM) wtext);
|
||||||
uiFree(wtext);
|
uiFree(wtext);
|
||||||
|
e->inhibitChanged = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiMultilineEntryOnChanged(uiMultilineEntry *e, void (*f)(uiMultilineEntry *, void *), void *data)
|
void uiMultilineEntryOnChanged(uiMultilineEntry *e, void (*f)(uiMultilineEntry *, void *), void *data)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#pragma code_page(65001)
|
#pragma code_page(65001)
|
||||||
|
|
||||||
// this is the Common Controls 6 manifest
|
// this is the Common Controls 6 manifest
|
||||||
// TODO set up the string values here
|
// LONGTERM set up the string values here
|
||||||
#ifndef _UI_STATIC
|
#ifndef _UI_STATIC
|
||||||
ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "libui.manifest"
|
ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "libui.manifest"
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,8 +21,8 @@ END
|
||||||
|
|
||||||
// this is for our custom DirectWrite-based font dialog (see fontdialog.cpp)
|
// 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
|
// this is based on the "New Font Dialog with Syslink" in Microsoft's font.dlg
|
||||||
// TODO look at localization
|
// LONGTERM 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 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
|
rcFontDialog DIALOGEX 13, 54, 243, 200
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_3DLOOK
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_3DLOOK
|
||||||
CAPTION "Font"
|
CAPTION "Font"
|
||||||
|
|
Loading…
Reference in New Issue