THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/02/2012 at 13:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
Hey guys,
I'm trying to do live polling of the text being typed into a textbox. And it's turning out to be very challenging.
I've gotten some good code from the archives posted by Matthias about how to call to a custom method from the message method. Which works well...Except that it does not work for polling inside of a textbox.
Here's the Scenario:
Message() runs continuously all the time. Which can be both a blessing & a curse.
If I use some code in there to constantly poll the textbox. I can easily tell when a person has typed a specific word. Or even a period.
But then comes the rub.
In order to take things any farther. I need to stop polling that text box so I can do some of my own looping and things on the text inside of the textbox. But I can't do that because I'm inside the Message() method...And that never stops....Hence the curse!
So I thought ok.
What if I use Message() to poll the textbox, and then jump out of the Message() function once the user types a specific thing. Like a period:
String text; this->GetString (1001, text); //Get the text in the text box
LONG sLength = text.GetLength();
LONG pos = NULL;
Bool lastPeriod = text.FindLast(".",&pos, -1); //Find the last occurrence of a period
if(lastPeriod)
{
myCustomMethod(msg); //Go to my custom method where I can work on it safely now
return TRUE;
}
Which sorta works.
I do jump out of the message() method and into my custom method successfully.
But I still have the same problem as before.
The Message() method is still continuously calling to my custom method. So my custom method is now constantly executing over and over. I haven't solved the problem. I've just moved it to another place.:cry:
So I'm stuck in this catch 22 scenario.
How do you do textbox polling. But also be able to shut the polling off when you need to?
-ScottA