summaryrefslogtreecommitdiff
path: root/basicctrls_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-05 12:59:44 -0500
committerPietro Gagliardi <[email protected]>2014-11-05 12:59:44 -0500
commit5fc368fc23f0720fc193883d0709df8417268987 (patch)
treebd929349e56551dbca795300457232093d6047b3 /basicctrls_windows.c
parent0bd58006a6001f830413bb4dcbb7bcad6aea3cc9 (diff)
Started adding TextField.ReadOnly() and implemented it (mostly) on Windows.
Diffstat (limited to 'basicctrls_windows.c')
-rw-r--r--basicctrls_windows.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/basicctrls_windows.c b/basicctrls_windows.c
index 4cda2eb..b33bce2 100644
--- a/basicctrls_windows.c
+++ b/basicctrls_windows.c
@@ -128,6 +128,19 @@ void textfieldHideInvalidBalloonTip(HWND hwnd)
xpanic("error hiding TextField.Invalid() balloon tip", GetLastError());
}
+// also good for Textbox
+int textfieldReadOnly(HWND hwnd)
+{
+ return (GetWindowLongPtrW(hwnd, GWL_STYLE) & ES_READONLY) != 0;
+}
+
+// also good for Textbox
+void textfieldSetReadOnly(HWND hwnd, BOOL readonly)
+{
+ if (SendMessageW(hwnd, EM_SETREADONLY, (WPARAM) readonly, 0) == 0)
+ xpanic("error setting TextField/Textbox as read-only/not read-only", GetLastError());
+}
+
static LRESULT CALLBACK groupSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR data)
{
LRESULT lResult;