El 14/12/2013 18:42, Paul McNett escribió:
On 12/14/13 1:05 PM, Ricardo Aráoz wrote:
Sorry about all the questions today :-)

Still trying to get things going in windows.
I have this dNumericBox :

         objectRef = dabo.ui.dNumericBox(self, NameBase="TotalFc",
                                 DataSource="Compra", DataField="ImporteTotal",
                                 RegID='TotalCpra', ToolTipText='Total Compra',
                                 HelpText='Total Compra', DecimalWidth=2,
                                 IntegerWidth=8, AllowNegative=False,
                                 NumericBlankToZero=True, SelectOnEntry=True)
         objectRef.bindEvent(dEvents.KeyDown, self.guardaUltTecla)
         objectRef.bindEvent(dEvents.LostFocus, self.cambiaFocus)


Linked to these Methods:

     def guardaUltTecla(self, evt):
         print 'ultTecla=', evt.EventData
         data = evt.EventData
         evt.EventObject.ultTecla = data['keyChar']
         evt.EventObject.shiftUltTecla = data['shiftDown']

     def cambiaFocus(self, evt):
         print 'CambiaFocus'
         obj = evt.EventObject
         if obj.ultTecla == dKeys.key_Tab:
             print 'tab'
             if obj.shiftUltTecla:
                 print 'shift'
                 self.Form.Concepto.setFocus()
             else:
                 print 'noshift'
                 pnl = self.Form.GridItems.Parent
                 pnl.Parent.expand(pnl)
                 self.Form.GridItems.setFocus()

The method bound to the KeyDown event never gets called. When I type <Tab> I 
get the
LostFocus event but never the KeyDown event. Tried it also with
KeyUp/KeyChar/KeyEvent and same results. OTOH when I type characters the KeyDown
event gets called.
This is not what happens in linux, there the KeyDown event get called.
I need to get the KeyDown event in order to know which key was pressed for the 
object
to loose focus. If it was shift-Tab then I need the focus to go to the previous
object but if it was Tab then I need a dSlidePanelControl to expand one of its
dSlidePanels and set the focus to a grid inside this panel (haven't found a way 
to do
this with the keyboard).
Of course if there is other/easier way to do this it would be nice to know.
Try adding wx.WANTS_CHARS to the style.

Paul


I guess that's some wx thingy.
How do I add this to the dabo dNumericBox  object?
Looked it up in the api reference and there is no style where I can add this. Instantiated the NumericBox in an idle window and there is a getStyle() but nothing about it in the docs.


_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/52acd7f9.1010...@gmail.com

Reply via email to