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 » FileSelector lambda troubles
FileSelector lambda troubles [message #47813] Sun, 02 April 2017 13:38 Go to previous message
germax is currently offline  germax
Messages: 20
Registered: March 2017
Location: germany
Promising Member
And another brick wall I need to chew myself through Sad

I have a FileDialog (defined in .lay) that I now want to add a 'convenience' button to
that opens the FileSelector and then copies the path over to my input box.

Again, for a more experienced man than I am, that shouldn't be much of an issue, right?

I'm still stuck somehow.. here are some lines of nastyness
....	
NewFLdlg dlg;
/* 
dlg is my file dialog and apart from some bits and bolts 
it has a button ofs (open file selector)
and an editstring path (to take ... you guessed it ... my file path)
*/ 
String fsp = "nixx"; // just a String I added to test if the lambda can read 'outside'
dlg.button.WhenPush = [=]
{
	FileSelector fs; 
	fs.AllFilesType().Multi(true);
	if(fs.ExecuteOpen("Dummy Demo"))
		PromptOK("\1"+~fs);
	else
		PrompOK(fsp); // works so far...
/* BUT

		fsp = ~fs; // is not working since fsp is now a const 
		//error: passing 'const Upp::String' as 'this' argument discards qualifiers [-fpermissive]
		PromptOK(AsString(~dlg.path)); // error: use of deleted function 'NewFLdlg::NewFLdlg(NewFLdlg&)'
Not even mentioning
		dlg.path = ~fs; // what I'm really after 

*/
};
.....


I'd like to avoid to add a callback (well a non lambda callback that is Wink)
if at all possible.

Any hints?

Thanks alot

Alex


that other german guy
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Common Dialog
Next Topic: Different GetHomeDirectory() in PLATFORM_POSIX and PLATFORM_WIN32
Goto Forum:
  


Current Time: Thu Apr 18 22:50:38 CEST 2024

Total time taken to generate the page: 0.02160 seconds