Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Shire is currently offline  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?
 
Read Message
Read Message
Previous Topic: [FEATURE] Horizontal scroll on Shift+mouse wheel
Next Topic: recent MinMax Refresh fix not GCC compilable
Goto Forum:
  


Current Time: Sat Dec 04 23:19:26 CET 2021

Total time taken to generate the page: 0.01245 seconds