Mercurial > projects > dwt-mac
comparison dwt/widgets/Text.d @ 153:8433dabeb15e
Fixed the password style for text fields
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 11 Jun 2009 01:36:32 +0200 |
parents | 834420cb1486 |
children |
comparison
equal
deleted
inserted
replaced
152:834420cb1486 | 153:8433dabeb15e |
---|---|
94 alias Scrollable.setFont setFont; | 94 alias Scrollable.setFont setFont; |
95 alias Scrollable.setForeground setForeground; | 95 alias Scrollable.setForeground setForeground; |
96 alias Scrollable.translateTraversal translateTraversal; | 96 alias Scrollable.translateTraversal translateTraversal; |
97 | 97 |
98 int textLimit, tabs = 8; | 98 int textLimit, tabs = 8; |
99 wchar echoCharacter; | 99 wchar echoCharacter = '\0'; |
100 bool doubleClick, receivingFocus; | 100 bool doubleClick, receivingFocus; |
101 wchar[] hiddenText, message; | 101 wchar[] hiddenText, message; |
102 NSRange* selectionRange; | 102 NSRange* selectionRange; |
103 NSRange selectionRangeStruct; | 103 NSRange selectionRangeStruct; |
104 | 104 |
1497 } | 1497 } |
1498 } | 1498 } |
1499 | 1499 |
1500 void setEditText (wchar[] string) { | 1500 void setEditText (wchar[] string) { |
1501 wchar [] buffer; | 1501 wchar [] buffer; |
1502 if (((style & DWT.PASSWORD) is 0) && echoCharacter !is '\0') { | 1502 if ((style & DWT.PASSWORD) is 0 && echoCharacter !is '\0') { |
1503 hiddenText = string; | 1503 hiddenText = string; |
1504 buffer = new wchar [Math.min(hiddenText.length (), textLimit)]; | 1504 buffer = new wchar [Math.min(hiddenText.length (), textLimit)]; |
1505 for (int i = 0; i < buffer.length; i++) buffer [i] = echoCharacter; | 1505 for (int i = 0; i < buffer.length; i++) buffer [i] = echoCharacter; |
1506 } else { | 1506 } else { |
1507 hiddenText = null; | 1507 hiddenText = null; |