diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h index 9f33be2..4f0882a 100644 --- a/include/Mw/StringDefs.h +++ b/include/Mw/StringDefs.h @@ -26,6 +26,7 @@ #define MwNinverted "Iinverted" #define MwNmodernLook "ImodernLook" #define MwNwaitMS "IwaitMS" +#define MwNhideInput "IhideInput" #define MwNtitle "Stitle" #define MwNtext "Stext" diff --git a/milsko.xml b/milsko.xml index 3e6fe47..5245942 100644 --- a/milsko.xml +++ b/milsko.xml @@ -62,6 +62,7 @@ + @@ -425,6 +426,7 @@ + diff --git a/src/backend/x11.c b/src/backend/x11.c index 070defc..3d547b0 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -681,6 +681,8 @@ void MwLLDetach(MwLL handle, MwPoint* point) { void MwLLShow(MwLL handle, int show) { if(show) { XMapWindow(handle->display, handle->window); + wait_map(handle); + XSetInputFocus(handle->display, handle->window, RevertToNone, CurrentTime); } else { XUnmapWindow(handle->display, handle->window); diff --git a/src/widget/entry.c b/src/widget/entry.c index 856e962..ee178f6 100644 --- a/src/widget/entry.c +++ b/src/widget/entry.c @@ -42,6 +42,7 @@ static void draw(MwWidget handle) { int i; int start; int textlen; + int attr; MwRect currc; p.x = (r.width - (r.width / w * w)) / 2; @@ -54,7 +55,11 @@ static void draw(MwWidget handle) { start = (t->cursor - 1) / len; start *= len; - MwUTF8Copy(str, start, show, 0, len); + if((attr = MwGetInteger(handle, MwNhideInput)) == MwDEFAULT || !attr) { + MwUTF8Copy(str, start, show, 0, len); + } else { + for(i = 0; i < MwUTF8Length(str) - start; i++) show[i] = '*'; + } MwDrawText(handle, &p, show, 0, MwALIGNMENT_BEGINNING, text); @@ -119,7 +124,7 @@ static void key(MwWidget handle, int code) { } static void prop_change(MwWidget handle, const char* prop) { - if(strcmp(prop, MwNtext) == 0) MwForceRender(handle); + if(strcmp(prop, MwNtext) == 0 || strcmp(prop, MwNhideInput) == 0) MwForceRender(handle); } MwClassRec MwEntryClassRec = { diff --git a/src/widget/radiobox.c b/src/widget/radiobox.c index ef60ce3..764b615 100644 --- a/src/widget/radiobox.c +++ b/src/widget/radiobox.c @@ -27,7 +27,7 @@ static void draw(MwWidget handle) { } static void click(MwWidget handle) { - MwSetInteger(handle, MwNchecked, MwGetInteger(handle, MwNchecked) ? 0 : 1); + if(!MwGetInteger(handle, MwNchecked)) MwSetInteger(handle, MwNchecked, 1); if(MwGetInteger(handle, MwNchecked) && handle->parent != NULL) { int i; for(i = 0; i < arrlen(handle->parent->children); i++) {