New topic: CharPosAtXY Error?
<http://forums.realsoftware.com/viewtopic.php?t=29718> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message geconant Post subject: CharPosAtXY Error?Posted: Mon Aug 24, 2009 5:27 pm Joined: Mon Aug 24, 2009 5:08 pm Posts: 1 I'm running REALbasic for Windows (2009 Release 3 Personal Edition). I have a TextArea control that often has some text styled (e.g., non black color, bold, larger font size) in it. I want to set the style back to all the same (no color, not bold, etc.) if the user clicks on an area in the control where there is no text. I assumed that if the user clicked in an area way below the text, then the CharPosAtXY method, when passed the x and y coordinates from the MouseDown event for the TextArea, would return a value greater than the length of the text string in the control. I've seen other postings in this forum that would lead me to believe this is how it works. What I found playing around with it is that, if I click below and to the right of all text so that the x coordinate where I clicked is greater than the x coordinate of any text in the control, then the CharPosAtXY method does, indeed, return a value one greater than the length of the text. However, if I click way below the text but underneath it, the CharPosAtXY method appears to always return the character position of the text directly above where I clicked even though I clicked considerably below the text. This is keeping me from recognizing an effective "off the text" event. I'd appreciate help from anyone whose had experience with using the CharPosAtXY method from the TextArea MouseDown event. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
