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 » FileSel&FileList, Path » FileSel ExecuteSaveAs replace file prompt bug
FileSel ExecuteSaveAs replace file prompt bug [message #16280] Thu, 05 June 2008 19:57 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
When I use FileSel::ExecuteSaveAs with the Asking option, when trying to replace an existing file it will prompt you to confirm, but the file list will go into edit mode if you wait about a second and don't answer the prompt.

I think that double clicking on a control which allows in place editing should not set of any edit event. Only if the two clicks are made in an interval larger than the double click register time should the edit event fire, so I think this should be changed at the level of FileList.

I tried to kill the timer event which calls StartEdit on double click, but it did not work.

There is also a fix specially for FileSel which I'm using right now.

Add to FileList:
	bool		IsRenaming()						 { return renaming; }

void FileList::StartEdit() {
	if (!renaming)
		return;
	Rect r = GetItemRect(GetCursor());
	const File& cf = Get(GetCursor());
	Font f = cf.font;
	int fcy = f.Info().GetHeight();
	r.left += iconwidth + 2;
	r.top += (r.Height() - fcy - 4) / 2;
	r.bottom = r.top + fcy + 2;
	edit.SetRect(r);
	edit.SetFont(cf.font);
	edit = cf.name.ToWString();
	edit.Show();
	edit.SetFocus();
}

Add to FileSel::Finish():
...
		if(asking)
			if(mode == SAVEAS) {
				bool b = list.IsRenaming();
				list.Renaming(false);
				if(!ff.IsEmpty() && !PromptOKCancel(p + t_(" already exists.&Do you want to continue ?")))
				{
					list.Renaming(b);
					return;
				}
			}
			else
...
 
Read Message
Read Message
Read Message
Previous Topic: FileSel bug when displaying Han characters
Next Topic: FindFile Problem
Goto Forum:
  


Current Time: Fri Mar 29 15:22:01 CET 2024

Total time taken to generate the page: 0.03111 seconds