From: <kr_...@us...> - 2003-03-26 17:12:05
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv30880/port/src/cbits/Win32 Modified Files: EditBox.c Log Message: Implement readOnly and visible attributes for Entry control Index: EditBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/EditBox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EditBox.c 10 Feb 2003 22:42:10 -0000 1.4 --- EditBox.c 26 Mar 2003 17:11:48 -0000 1.5 *************** *** 50,51 **** --- 50,87 ---- SetWindowText(editbox, txt); }; + + void osSetEditReadOnly(WindowHandle editbox, BOOL readOnly) + { + SendMessage(editbox,EM_SETREADONLY,readOnly,0); + } + + BOOL osGetEditReadOnly(WindowHandle editbox) + { + return (GetWindowLong(editbox, GWL_STYLE) & ES_READONLY) != 0; + } + + void osSetEditVisibility(WindowHandle editbox, BOOL visible) + { + LONG lStyle; + + lStyle = GetWindowLong(editbox, GWL_STYLE); + + if (visible) + { + SetWindowLong(editbox, GWL_STYLE, lStyle & ~ES_PASSWORD); + SendMessage(editbox, EM_SETPASSWORDCHAR, 0, 0); + } + else + { + SetWindowLong(editbox, GWL_STYLE, lStyle | ES_PASSWORD); + SendMessage(editbox, EM_SETPASSWORDCHAR, (WPARAM) '*', 0); + } + + InvalidateRect(editbox,NULL,TRUE); + } + + BOOL osGetEditVisibility(WindowHandle editbox) + { + return (GetWindowLong(editbox, GWL_STYLE) & ES_PASSWORD) == 0; + } + |