mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
add MwNhideInput
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@531 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define MwNinverted "Iinverted"
|
||||
#define MwNmodernLook "ImodernLook"
|
||||
#define MwNwaitMS "IwaitMS"
|
||||
#define MwNhideInput "IhideInput"
|
||||
|
||||
#define MwNtitle "Stitle"
|
||||
#define MwNtext "Stext"
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<integer name="inverted" />
|
||||
<integer name="modernLook" />
|
||||
<integer name="waitMS" />
|
||||
<integer name="hideInput" />
|
||||
|
||||
<string name="title" />
|
||||
<string name="text" />
|
||||
@@ -425,6 +426,7 @@
|
||||
<widget name="Entry">
|
||||
<properties>
|
||||
<property name="text" />
|
||||
<property name="hideInput" />
|
||||
</properties>
|
||||
</widget>
|
||||
<widget name="Frame" />
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user