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 » U++ Library support » LineEdit, EditFields, DocEdit » [HELP] Getting and setting values to EditInt
Re: [HELP] Getting and setting values to EditInt [message #36556 is a reply to message #36546] Fri, 08 June 2012 19:35 Go to previous message
mirek is currently offline  mirek
Messages: 14266
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 Razz

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.
 
Read Message
Read Message
Read Message
Previous Topic: Masking the password field in the login page
Next Topic: To add some methods to LineEdit
Goto Forum:
  


Current Time: Fri Jul 18 14:41:18 CEST 2025

Total time taken to generate the page: 0.00756 seconds