Home » Community » Newbie corner » Layout files versus embedded code
Layout files versus embedded code [message #59621] |
Fri, 17 February 2023 14:25  |
MrAndreas
Messages: 2 Registered: February 2023
|
Junior Member |
|
|
I just came across U++ and soon found the following example...
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <Days/Days.lay>
#include <CtrlCore/lay.h>
class Days : public WithDaysLayout<TopWindow> {
public:
typedef Days CLASSNAME;
Days();
};
Days::Days()
{
CtrlLayout(*this, "Days");
date1 ^= date2 ^= [=] {
result = IsNull(date1) || IsNull(date2) ? "" :
Format("There is %d day(s) between %` and %`", abs(Date(~date1) - Date(~date2)), ~date1, ~date2);
};
}
GUI_APP_MAIN
{
Days().Run();
}
Source: U++ Overview / 1. Whetting your appetite
Based on this example it appears U++ makes use of external data files that describe the GUI similar to how Delphi and C++ Builder uses DFM files for the same purpose. If this is the case then why was this paradigm chosen when it has been proven to be a source of many errors and in general flawed? Note that Anders, the original architect of Delphi/C++ Builder, recognised and rectified these flaws when he designed C# and made the GUI definitions as plain C# code embedded in standard C# source files.
Cheers,
-Andreas
|
|
|
Goto Forum:
Current Time: Wed Jul 30 21:57:26 CEST 2025
Total time taken to generate the page: 0.04393 seconds
|