Home » U++ Library support » LineEdit, EditFields, DocEdit » [SECURITY] Drag-n-drop enabled in password fields
[SECURITY] Drag-n-drop enabled in password fields [message #29103] |
Tue, 05 October 2010 10:43 |
Shire
Messages: 41 Registered: September 2006 Location: Russia, Yamal peninsula
|
Member |
|
|
In password fields drag and drop text is enabled by default. When dragging text, password shows in sample picture.
This must be disabled by additional check in
void EditField::LeftDrag(Point p, dword flags)
{
+ if(password) return;
Also EditField::GetCursor() can be rewritten for proper selection:
int EditField::GetCursor(int posx)
{
posx -= 2;
if(posx <= 0) return 0;
FontInfo fi = font.Info();
int count = text.GetLength();
if(password)
return min((posx + fi['*'] / 2) / fi['*'], count);
int x = 0;
const wchar *s = text;
int i = 0;
while(i < count)
{
int witdh = fi[*s];
if(posx < x + witdh / 2)
break;
x += witdh;
s++; i++;
}
return i;
}
Some methods (GetTextCx(), Paints()) have argument 'password'. For what?
|
|
|
|
Goto Forum:
Current Time: Fri Apr 19 04:58:17 CEST 2024
Total time taken to generate the page: 0.04686 seconds
|