On Oct 5, 2010, at 1:33 PM, OKB (not okblacke) wrote:

>       The SelectedText property doesn't work, because nothing is 
> selected.  I want to inspect the text at the insertion point itself 
> during normal text input, so I can decide as each character is entered 
> whether or not to allow it.  (SelectionStart and SelectionEnd just 
> return the same value as InsertionPosition, so they're not useful to me 
> either.)

        I guess my question is: when there is no selection, do you need...

a) the character immediately before the insertion point
b) the character immediately after the insertion point
c) n character(s) immediately before the insertion point
d) n character(s) immediately after the insertion point
e) n,m character(s) immediately before/after the insertion point

        We'd also need to define what would be returned in the case where there 
is selected text.

> Incidentally, I had hoped I could achieve a similar effect with 
> some sort of validation, but I can't figure out how to do that without 
> creating a bizObj and connecting the GUI to a database, and I'd rather 
> not drag in all that complexity.  Is there a way to just specify a 
> function that validates data in a particular text field?

        You could always override the form's validateField() method, using 
something like this:

def validateField(self, ctrl):
    if ctrl is self.MyEditBox:
        <do some validation stuff>
    else:
        super(dForm, self).validateField(ctrl)
 



-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to