IonicWind Software

Aurora Compiler => GUI => Topic started by: Bruce Peaslee on January 06, 2006, 09:43:44 AM

Title: GetText() drops character
Post by: Bruce Peaslee on January 06, 2006, 09:43:44 AM
It appears that:

pControl = GetControl(txtD1Owner1);
Lot.Owner1 = pControl->GetText();

misses the last character in the edit control.

As I test, I tried this, which works:

Lot.Owner1 = *(CEdit)pControl.GetLine(0);

Although there is only 1 line.
Title: Re: GetText() drops character
Post by: Ionic Wind Support Team on January 06, 2006, 01:41:08 PM
Fixed.  Thanks.
Title: Re: GetText() drops character
Post by: LarryMc on January 06, 2006, 01:58:00 PM
Fundamental question for dummy:

QuoteLot.Owner1 = pControl->GetText();

Lot.Owner1 = *(CEdit)pControl.GetLine(0);

Can someone please tell me (in dumbese) what the right side of the eqaul sign is telling me in each case?
And type real slow!
Title: Re: GetText() drops character
Post by: Bruce Peaslee on January 06, 2006, 03:00:44 PM
It's my code, so I'll give it a try.

The code is incomplete, but was enough for Paul to see the problem. This comes first:

pControl = GetControl(txtD1Owner1);

and provides the pointer to an edit control. ("txtD1Owner1" is my naming convention for a "text box" in dialog D1 for variable Owner1. I never use just numbers.) Once you have the pointer to the control

pControl->GetText();   // pointer function call syntax

gives you the text in it. Since there was a bug in the subroutine, I used:

*(CEdit)pControl.GetLine(0);

instead. I'm not sure why the syntax for derefencing is different, but I guess it has something to do with where the function is defined. This function is supposed to give you a specific line in a multi-line control (starting at zero), but it worked for what I needed to do while Paul does the fix.

Sorry, but I can't type any slowerÂÃ,  ;)

Title: Re: GetText() drops character
Post by: Parker on January 06, 2006, 03:10:08 PM
*x.y is equivalent to x->y, but Aurora has some bugs at the moment that don't allow you to use the -> operator since it doesn't remember the type of the pointer.
Title: Re: GetText() drops character
Post by: Bruce Peaslee on January 06, 2006, 03:13:56 PM
Quote from: Parker on January 06, 2006, 03:10:08 PM
*x.y is equivalent to x->y, but Aurora has some bugs at the moment that don't allow you to use the -> operator since it doesn't remember the type of the pointer.
Thanks. I was worried about my lack of understanding. A bug is not the first thing you think of when dealing with Paul's work.
Title: Re: GetText() drops character
Post by: Ionic Wind Support Team on January 06, 2006, 03:15:32 PM
Actually it does allow it.

CControl *pControl;
CEdit *pEdit = GetControl(txtD1Owner1);
Lot.Owner1 = pEdit->GetLine(0);

See the difference ;)
Title: Re: GetText() drops character
Post by: Bruce Peaslee on January 06, 2006, 03:20:54 PM
It does. Easier to read (and type).
Title: Re: GetText() drops character
Post by: Parker on January 06, 2006, 03:23:01 PM
I was referring to the fact that there were a couple of times when it doesn't work, I think I found them in function calls and when using arrays. For example (not quite sure if it's right though):
DoWork(item->data[1]);
Title: Re: GetText() drops character
Post by: Ionic Wind Support Team on January 06, 2006, 03:33:42 PM
They should have all been working in the last update.