Home » U++ Library support » LineEdit, EditFields, DocEdit » [HELP] Getting and setting values to EditInt
[HELP] Getting and setting values to EditInt [message #36546] |
Wed, 06 June 2012 20:45 |
thiago__costa
Messages: 1 Registered: June 2012 Location: Guarulhos - SP
|
Junior Member |
|
|
Hello people, this is my first topic here.
I'm new to U++, this framework is simply awesome!
I'm making a simple Lottery number checker
I have a WithConfigLayout<TopWindow> d;
This window is for setting an array int result[6] that stores the values for comparation with user input.
I have 6 EditInt(result_1 to result_6), to store the value from result_1 in result[0] I'm doing this: result[0] = ~d.result_1;
But I want to do this within a for loop, how can I do this?
I need a way to to perform something like this:
for (int i = 0; i < 6; i++)
{
result[i] = ~d.result_(somehow I need to put i + 1 here);
}
There is a way to do this ?
Thanks for attention, hope anybody can help me.
[Updated on: Wed, 06 June 2012 20:48] Report message to a moderator
|
|
|
|
Re: [HELP] Getting and setting values to EditInt [message #36556 is a reply to message #36546] |
Fri, 08 June 2012 19:35 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
thiago__costa wrote on Wed, 06 June 2012 14:45 | Hello people, this is my first topic here.
I'm new to U++, this framework is simply awesome!
I'm making a simple Lottery number checker
I have a WithConfigLayout<TopWindow> d;
This window is for setting an array int result[6] that stores the values for comparation with user input.
I have 6 EditInt(result_1 to result_6), to store the value from result_1 in result[0] I'm doing this: result[0] = ~d.result_1;
But I want to do this within a for loop, how can I do this?
I need a way to to perform something like this:
for (int i = 0; i < 6; i++)
{
result[i] = ~d.result_(somehow I need to put i + 1 here);
}
There is a way to do this ?
Thanks for attention, hope anybody can help me.
|
Actually, yes. In layout designer, simply name fields "result[0]", "result[1]" etc.. In that case, you cannot use type name in layout ("EditInt"); means you will only see rectangles in designer.
In such situation, including layout will not place those members into dialog struct, but it will place them at correct positions. All you need to do now is to add them manually, like
struct MyDialog : MyLayout<TopWindow> {
EditInt result[6];
MyDialog() { CtrlLayout(*this); ... }
};
CtrlLayout here will pick your definition of result and will place it accordingly.
|
|
|
Goto Forum:
Current Time: Thu Apr 18 12:29:59 CEST 2024
Total time taken to generate the page: 0.01046 seconds
|