diff --git a/README.md b/README.md index 3d029c7a..b64ebb65 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ This README is being written.
*Note that today's entry may be updated later today.* +* **5 June 2016** + * Added `uiNewPasswordEntry()`, which creates a new `uiEntry` suitable for entering passwords. + * Added `uiNewSearchEntry()`, which creates a new `uiEntry` suitable for searching. On some systems, the `OnChanged()` event will be slightly delayed and/or combined, to produce a more natural feel when searching. + * **29 May 2016** * Thanks to @pcwalton, we can now statically link libui! Simply do `make STATIC=1` instead of just `make`. * On Windows you must link both `libui.lib` and `libui.res` AND provide a Common Controls 6 manifest for output static binaries to work properly. diff --git a/windows/entry.cpp b/windows/entry.cpp index 878f359d..6cc865a3 100644 --- a/windows/entry.cpp +++ b/windows/entry.cpp @@ -92,7 +92,7 @@ void uiEntrySetReadOnly(uiEntry *e, int readonly) logLastError(L"error making uiEntry read-only"); } -uiEntry *uiNewEntry(void) +static uiEntry *finishNewEntry(DWORD style) { uiEntry *e; @@ -100,7 +100,7 @@ uiEntry *uiNewEntry(void) e->hwnd = uiWindowsEnsureCreateControlHWND(WS_EX_CLIENTEDGE, L"edit", L"", - ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP, + style | ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP, hInstance, NULL, TRUE); @@ -109,3 +109,19 @@ uiEntry *uiNewEntry(void) return e; } + +uiEntry *uiNewEntry(void) +{ + return finishNewEntry(0); +} + +uiEntry *uiNewPasswordEntry(void) +{ + return finishNewEntry(ES_PASSWORD); +} + +uiEntry *uiNewSearchEntry(void) +{ + // TODO + return finishNewEntry(0); +}