Home » Community » U++ community news and announcements » 2020.2rc1
Re: 2020.2rc1 [message #55178 is a reply to message #55175] |
Thu, 15 October 2020 22:18 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
It seems that we have one more problem with template generation. By default in generating CtrlLib and Skylark application there is "using namespace Upp;" clausal in header file, which is wrong for obvious reasons.
Here is app generated with the template:
// ClockApp.h
#ifndef _Clock_Clock_h
#define _Clock_Clock_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <Clock/Clock.lay>
#include <CtrlCore/lay.h>
class ClockApp : public WithClockLayout<TopWindow> {
public:
ClockApp();
};
#endif
// main.cpp
#include "Clock.h"
ClockApp::ClockApp()
{
CtrlLayout(*this, "Window title");
}
GUI_APP_MAIN
{
ClockApp().Run();
}
It should be:
// ClockApp.h
#ifndef _Clock_Clock_h
#define _Clock_Clock_h
#include <CtrlLib/CtrlLib.h>
namespace Upp {
#define LAYOUTFILE <Clock/Clock.lay>
#include <CtrlCore/lay.h>
class ClockApp : public WithClockLayout<TopWindow> {
public:
ClockApp();
};
}
#endif
// main.cpp
#include "ClockApp.h"
using namespace Upp;
ClockApp::ClockApp()
{
CtrlLayout(*this, "Window title");
}
GUI_APP_MAIN
{
ClockApp().Run();
}
There is one option I would see there, but this is out of release scope. Upp namespace agnostic template (as option):
// ClockApp.h
#ifndef _Clock_Clock_h
#define _Clock_Clock_h
#include <CtrlLib/CtrlLib.h>
namespace Upp
{
#define LAYOUTFILE <Clock/Clock.lay>
#include <CtrlCore/lay.h>
}
class ClockApp : public Upp::WithClockLayout<Upp::TopWindow> {
public:
ClockApp();
};
#endif
// Clock.h
#include "ClockApp.h"
ClockApp::ClockApp()
{
CtrlLayout(*this, "Window title");
}
GUI_APP_MAIN
{
ClockApp().Run();
}
This option is the best for advanced users. In almost 90% your app shouldn't belong to Upp namespace. You could mix it easier with other namespaces like std. Only Core elements should belong there, but for simplicity we just put app code there...
In Turtle everything is fine. I think Oblivion fixed it some time ago.
U++ - one framework to rule them all.
[Updated on: Thu, 15 October 2020 22:32] Report message to a moderator
|
|
|
|
|
2020.2rc1
By: mirek on Thu, 08 October 2020 12:33
|
|
|
Re: 2020.2rc1
By: Klugier on Thu, 08 October 2020 12:46
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 08 October 2020 19:24
|
|
|
Re: 2020.2rc1
By: omari on Fri, 09 October 2020 11:11
|
|
|
Re: 2020.2rc1
By: mirek on Fri, 09 October 2020 17:17
|
|
|
Re: 2020.2rc1
By: omari on Fri, 09 October 2020 17:39
|
|
|
Re: 2020.2rc1
By: jimlef on Thu, 08 October 2020 19:25
|
|
|
Re: 2020.2rc1
By: Klugier on Thu, 08 October 2020 22:15
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 08 October 2020 23:47
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 08 October 2020 23:48
|
|
|
Re: 2020.2rc1
By: Oblivion on Fri, 09 October 2020 20:11
|
|
|
Re: 2020.2rc1
By: jimlef on Sat, 10 October 2020 03:57
|
|
|
Re: 2020.2rc1
By: Klugier on Sun, 11 October 2020 18:10
|
|
|
Re: 2020.2rc1
By: jimlef on Sun, 11 October 2020 20:05
|
|
|
Re: 2020.2rc1
By: mirek on Sun, 11 October 2020 21:01
|
|
|
Re: 2020.2rc1
By: Klugier on Sun, 11 October 2020 21:12
|
|
|
Re: 2020.2rc1
By: Klugier on Wed, 14 October 2020 00:26
|
|
|
Re: 2020.2rc1
By: jimlef on Wed, 14 October 2020 04:02
|
|
|
Re: 2020.2rc1
By: Klugier on Wed, 14 October 2020 20:52
|
|
|
Re: 2020.2rc1
By: jimlef on Wed, 14 October 2020 22:22
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 15 October 2020 11:10
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 15 October 2020 11:11
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 15 October 2020 15:30
|
|
|
Re: 2020.2rc1
By: Klugier on Thu, 15 October 2020 18:19
|
|
|
Re: 2020.2rc1
By: Klugier on Thu, 15 October 2020 22:18
|
|
|
Re: 2020.2rc1
By: mirek on Thu, 15 October 2020 22:46
|
|
|
Re: 2020.2rc1
By: Klugier on Fri, 16 October 2020 00:30
|
|
|
Re: 2020.2rc1
By: coolman on Fri, 16 October 2020 09:40
|
|
|
Re: 2020.2rc1
By: mirek on Fri, 16 October 2020 09:55
|
|
|
link errors with new(std::nothrow)
By: wimpie on Sun, 11 October 2020 17:00
|
|
|
Re: link errors with new(std::nothrow)
By: mirek on Sun, 11 October 2020 20:21
|
|
|
Re: 2020.2rc1
By: JeyCi on Mon, 12 October 2020 06:49
|
|
|
Re: 2020.2rc1
By: mirek on Mon, 12 October 2020 09:49
|
|
|
Re: 2020.2rc1
By: JeyCi on Mon, 12 October 2020 10:22
|
|
|
Re: 2020.2rc1
By: mirek on Mon, 12 October 2020 11:49
|
|
|
Re: 2020.2rc1
By: Novo on Mon, 12 October 2020 20:10
|
|
|
Re: 2020.2rc1
By: mirek on Mon, 12 October 2020 23:15
|
|
|
Re: 2020.2rc1
By: mirek on Mon, 12 October 2020 23:46
|
|
|
Re: 2020.2rc1
By: Novo on Tue, 13 October 2020 02:22
|
|
|
Re: 2020.2rc1
By: mirek on Tue, 13 October 2020 09:55
|
|
|
Re: 2020.2rc1
By: Novo on Tue, 13 October 2020 00:21
|
|
|
Re: 2020.2rc1
By: mirek on Tue, 13 October 2020 00:46
|
|
|
Re: 2020.2rc1
By: Oblivion on Fri, 16 October 2020 00:41
|
|
|
Re: 2020.2rc1
By: mirek on Fri, 16 October 2020 11:26
|
|
|
Re: 2020.2rc1
By: Klugier on Fri, 16 October 2020 11:49
|
|
|
Re: 2020.2rc1
By: mirek on Fri, 16 October 2020 14:13
|
|
|
Re: 2020.2rc1
By: mirek on Tue, 20 October 2020 09:40
|
|
|
Re: 2020.2rc1
By: Tom1 on Tue, 20 October 2020 21:03
|
Goto Forum:
Current Time: Tue May 14 16:26:13 CEST 2024
Total time taken to generate the page: 0.02365 seconds
|