Para Antonio - Combobox + bkeydown

Para Antonio - Combobox + bkeydown

Postby Rossine » Mon Apr 24, 2006 6:02 pm

Olá Antonio,

Veja no exemplo abaixo quando eu teclo "ESC" no GET ele me retorna a tecla pressionada. Já no COMBOBOX isto não está funcionando. Como fazer isto funcionar ?

Code: Select all  Expand view  RUN
#include "fivewin.ch"

function main()

   local oDlg, cCombo := "2", oCombo, oGet, cGet := space(10)
   local aItems := { "1", "2", "3" }

   DEFINE DIALOG oDlg FROM 2, 2 TO 18, 60 TITLE "Test" ;
      STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, 4 )

   @ 1, 1 get      oGet   var cGet   SIZE 50, 12

   oGet:bkeydown := { |nKey| msgstop( nKey ) }

   @ 2, 2 COMBOBOX oCombo var cCombo ITEMS aItems SIZE 200, 100

   oCombo:bkeydown := { |nKey| msgstop( nKey ) }

   ACTIVATE DIALOG oDlg CENTERED

return nil



Obrigado,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Rossine » Tue Apr 25, 2006 1:51 pm

Olá Antonio,

Eu fiz estas mudanças em COMBOBOX.PRG e funcionou :lol:

Code: Select all  Expand view  RUN
...
   METHOD KeyDown( nKey, nFlags )

   METHOD GetDlgCode( nLastKey )
...

//----------------------------------------------------------------------------//

METHOD KeyDown( nKey, nFlags ) CLASS TComboBox

   if ::bChange != nil
      Eval( ::bChange, nKey, nFlags, Self )
   endif

return Super:KeyDown( nKey, nFlags )

//----------------------------------------------------------------------------//

METHOD GetDlgCode( nLastKey ) CLASS TComboBox

   if Len( ::oWnd:aControls ) == 1
      return DLGC_WANTALLKEYS
   endif

  ::oWnd:nLastKey = nLastKey

return DLGC_WANTALLKEYS

//----------------------------------------------------------------------------//


Se isto estiver correto, seria possível incluir esta mudanças em FWH ? :D

Obrigado e abraços,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Antonio Linares » Wed Apr 26, 2006 9:10 am

Rossine,

La tecla ESC se ruta al contenedor, es decir, a la caja de diálogo.

Si cambias GetDlgCode() entonces si se la das al control, pero no es un comportamiento estandard.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rossine » Wed Apr 26, 2006 11:25 am

OK Antonio :)

Gracias,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests