Implemented uiPasswordEntry and uiSearchEntry on Windows.

This commit is contained in:
Pietro Gagliardi 2016-06-05 21:02:59 -04:00
parent 3d5d1408c7
commit 15456c8b41
2 changed files with 22 additions and 2 deletions

View File

@ -37,6 +37,10 @@ This README is being written.<br>
*Note that today's entry may be updated later today.* *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** * **29 May 2016**
* Thanks to @pcwalton, we can now statically link libui! Simply do `make STATIC=1` instead of just `make`. * 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. * 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.

View File

@ -92,7 +92,7 @@ void uiEntrySetReadOnly(uiEntry *e, int readonly)
logLastError(L"error making uiEntry read-only"); logLastError(L"error making uiEntry read-only");
} }
uiEntry *uiNewEntry(void) static uiEntry *finishNewEntry(DWORD style)
{ {
uiEntry *e; uiEntry *e;
@ -100,7 +100,7 @@ uiEntry *uiNewEntry(void)
e->hwnd = uiWindowsEnsureCreateControlHWND(WS_EX_CLIENTEDGE, e->hwnd = uiWindowsEnsureCreateControlHWND(WS_EX_CLIENTEDGE,
L"edit", L"", L"edit", L"",
ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP, style | ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP,
hInstance, NULL, hInstance, NULL,
TRUE); TRUE);
@ -109,3 +109,19 @@ uiEntry *uiNewEntry(void)
return e; return e;
} }
uiEntry *uiNewEntry(void)
{
return finishNewEntry(0);
}
uiEntry *uiNewPasswordEntry(void)
{
return finishNewEntry(ES_PASSWORD);
}
uiEntry *uiNewSearchEntry(void)
{
// TODO
return finishNewEntry(0);
}