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 » Community » U++ community news and announcements » .lay / .usc namespace
.lay / .usc namespace [message #55337] Sat, 31 October 2020 19:56 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
It is now possible to specify widget's namespace in .usc file. This namespace is then automatically added to each widget type in the .lay file, with the final effect that it is now not necessary to put layout include into namespace nor use "using namespace Upp;" before the include.
Re: .lay / .usc namespace [message #55338 is a reply to message #55337] Sat, 31 October 2020 20:28 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

That's great news! I would like to ask will it work with chain namespace from C++17:
namespace MyApplication::HelperWidgets {
    // ...
}

or in the similar situation for previous standards:
namespace MyApplication { namespace HelperWidgets {

}
}


So, in .usc file following declaration should be valid:
namespace MyApplication::HelperWidgets;


I also saw following hack in the code:
String CurrentNamespace; // this is ugly hack, but better than rewrite everything

The whole file when the function is used is relatively simply, so why not just extract class and put current namespace as variable? Should be easy and we will have better/cleaner (easier to maintain) code in that place.

Klugier


U++ - one framework to rule them all.
Re: .lay / .usc namespace [message #55339 is a reply to message #55338] Sat, 31 October 2020 23:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Klugier wrote on Sat, 31 October 2020 20:28

I also saw following hack in the code:
String CurrentNamespace; // this is ugly hack, but better than rewrite everything

The whole file when the function is used is relatively simply, so why not just extract class and put current namespace as variable? Should be easy and we will have better/cleaner (easier to maintain) code in that place.

Klugier


Would need to redesign about 1000 lines of code. Not really worth it in this case.

Mirek
Re: .lay / .usc namespace [message #55340 is a reply to message #55338] Sun, 01 November 2020 09:30 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Klugier wrote on Sat, 31 October 2020 20:28


So, in .usc file following declaration should be valid:
namespace MyApplication::HelperWidgets;




Implemented. I doubt it will ever be used, but whatever... Smile

Mirek
Previous Topic: ide: Compare with the next file, break long lines in comparison
Next Topic: SSH package is upgraded to libssh2 v1.9.0
Goto Forum:
  


Current Time: Fri Apr 19 13:07:00 CEST 2024

Total time taken to generate the page: 0.03536 seconds