|
|
Home » Community » Newbie corner » Problems when using layouts
|
Re: Problems when using layouts [message #27156 is a reply to message #27154] |
Mon, 28 June 2010 23:33   |
|
Hi Javier,
The problem is that the code in dialogoDlg.h doesn't know about the layout template, because that was included in prueba.h. The solution requires moving the code between the files a bit. I would say the simplest solution (but not only one) is to move the content of dialogoDLG.h into prueba.h and use only this one file.
Additionally, in class prueba you have : That is interpreted by compiler as function declaration, correctly it shoud be without the parenthesis:
Honza
|
|
|
|
Re: Problems when using layouts [message #27158 is a reply to message #27157] |
Tue, 29 June 2010 01:46   |
|
In attachment - working code.
If you have tool for compare source file - compare line by line
Some comments:
In C++ isolation - by modules, because combine header files and combine layout files OR split header files and split layout files.
(I split dialogo and main window into different files)
Use Button variable name ok - and change from CtrlLayout to CtrlLayoutOK - logic of work added automaticaly.
(I change variable name from Cerrar to ok - and method Close is gone...)
Don't forget add
#define LAYOUTFILE <prueba/dialogo.lay>
#include <CtrlCore/lay.h> for every dialog
and for every class.
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: Problems when using layouts [message #27173 is a reply to message #27171] |
Tue, 29 June 2010 17:36   |
|
281264 wrote on Tue, 29 June 2010 17:04 | 2.- So the conclusion is that it is better (from the stand point of C++ modularity) to have different “.lay” files, one for the “main window” and others for the respective dialogs.
|
I would say it is a matter of taste For example if you look at theide, which is pretty complex application, you'll see that there is only single layout file included in ide.h. The separation of modules is used only for .cpp files.
281264 wrote on Tue, 29 June 2010 17:04 | 3.- What is this?:
Result<<=(double)~dialogo.entrada_a*(double)~dialogo.entrada_b;
What is the role of ~ in the expression?
|
In Ctrl, operator~() is used as a shorthand for GetData() and operator<<=(Value v) for SetData(Value v). It can save you some typing and increase readability of the code.
Honza
|
|
|
|
Re: Problems when using layouts [message #27180 is a reply to message #27173] |
Tue, 29 June 2010 19:19   |
|
dolik.rce wrote on Tue, 29 June 2010 19:36 |
281264 wrote on Tue, 29 June 2010 17:04 | 2.- So the conclusion is that it is better (from the stand point of C++ modularity) to have different “.lay” files, one for the “main window” and others for the respective dialogs.
|
I would say it is a matter of taste For example if you look at theide, which is pretty complex application, you'll see that there is only single layout file included in ide.h. The separation of modules is used only for .cpp files.
281264 wrote on Tue, 29 June 2010 17:04 | 3.- What is this?:
Result<<=(double)~dialogo.entrada_a*(double)~dialogo.entrada_b;
What is the role of ~ in the expression?
|
In Ctrl, operator~() is used as a shorthand for GetData() and operator<<=(Value v) for SetData(Value v). It can save you some typing and increase readability of the code.
Honza
|
I say
Quote: | In C++ isolation - by modules, because combine header files and combine layout files OR split header files and split layout files.
(I split dialogo and main window into different files)
|
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
[Updated on: Tue, 29 June 2010 19:19] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 00:56:21 CEST 2025
Total time taken to generate the page: 0.01251 seconds
|
|
|