I am trying to ensure that the text in a box is selected upon entry and it
works fine when tabbed into.  However, when I click on the field, the entry
does not highlight.  I stepped thru the code by binding to the gotfocus and
tracked the SelectionLength property thru the watch window.  I found that
initially, the text is highlighted, but when the code hits the
"self.raiseEvent(dEvents.GotFocus, evt)" line noted below the
SelectionLength goes to 0.

def mytext(dabo.ui.dTextBox)
        def afterInitAll(self):
                self.bindEvent(dEvents.GotFocus, self.setFocus) 
        
        def setFocus(self,evt):
#step here      if self.SelectOnEntry:
                        self.SelectionLength=len(str(self.Value))
                pass

Pemmixin.py
        def __onWxGotFocus(self, evt):
                if isinstance(self, dabo.ui.dGrid):
                        ## Continuation of ugly workaround for grid focus
event. Only raise the
                        ## Dabo event if we are reasonably sure it isn't a
repeat.
                        prev = self._lastGridFocusTimestamp
                        now = self._lastGridFocusTimestamp = time.time()
                        if now-prev < .05:
                                return
                self.raiseEvent(dEvents.GotFocus, evt)

Thanks,
Larry Long

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.10/943 - Release Date: 08/08/2007
5:38 PM
 



_______________________________________________
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/dabo-users/[EMAIL PROTECTED]

Reply via email to