Page 1 of 1

Mr. Rao, oCol:oBarGet does not take focus with oBrw:bKeychar

Posted: Mon Aug 28, 2017 3:29 pm
by albeiroval
Hello Mr Rao,

I try to use oBrw:bKeyChar with oBarGet but it does not take focus, for the input of the search string.
Here is the code I use

Code: Select all

Function Main()
  ...
  
  oBrw::bKeyChar = {|nKey| QuerySeekWild( oBrw, oQry, cQuery, nKey )}

 ...

RETURN Nil

Static Function QuerySeekWild( oBrw,  oQry, cQuery, nKey )

  ...

  oBrw:lGetBar   = .T.
  oBrw:nGetBarHeight  = 40
  AEval( oBrw:aCols, {|o| o:uBarGetVal := "", o:bClrEdit   := {|| { CLR_BLACK, CLR_YELLOW } } } )
  oBrw:Refresh()

  ...

  oCol:uBarGetVal = uSeek  
  oCol:CreateBarGet()

  oCol:oBarGet:SetFocus() <--- // Here I need to activate control get with oCol:oBarGet
                               // the get control does not take focus
                               // for the user enters the search string
  ...

  oBrw:lGetBar = .F.
  oBrw:Refresh()
  
RETURN uSeek
 
Thanks for the help

Re: Mr. Rao, why oCol:oBarGet does not take focus?

Posted: Wed Aug 30, 2017 2:28 pm
by albeiroval
Up

Re: Mr. Rao, why oCol:oBarGet does not take focus?

Posted: Wed Aug 30, 2017 5:26 pm
by ukoenig
Albeiro,

activate the seekbar with a mouseclick on a selected column-header ( index ).

1. Seekbar

WITH OBJECT oBrw1
:lSeekBar := .t.
:bClrEdits := { || { CLR_HRED, CLR_YELLOW } }

...
...
END

2. using SAY

@ 250, 220 SAY oBrw2:oSeek PROMPT oBrw2:cSeek SIZE 50, 12 PIXEL BORDER ;
OF oFld1:aDialogs[1] COLOR CLR_BLACK,CLR_YELLOW PICTURE '@!'
oBrw2:oSeek:Setfont( oSFont )


Image

regards
Uwe :D

Re: Mr. Rao, why oCol:oBarGet does not take focus?

Posted: Thu Aug 31, 2017 2:00 pm
by albeiroval
Uwe, thanks for answering,

I understand that by clicking on the header of the column I order the data, and oBrw: lGetBar = .T. activate the Tget oCol:oGetBar, and clicking on oCol:oGetBar I can edit.

I require is to activate oCol:oGetBar when user type keyboard then call oBrw:bKeychar, here user edit string search,
and disable oCol:oGetBar, when user type VK_ENTER or VK_ESCAPE.

Excuse my English

Re: Mr. Rao, oCol:oBarGet does not take focus with oBrw:bKeychar

Posted: Sat Aug 24, 2019 12:31 pm
by Marcelo Roggeri
Hola buenos dias, necesito que al abrir un dialogo el foco valla al get buscador de cierta columna

Code: Select all

.....
               // BARRA DE BUSQUEDA
               ::oBrw:lGetBar       := .T.
               ::oBrw:nGetBarHeight := 30

               ::oBrw:aCols[1]:uBarGetVal    := Space(100)
               ::oBrw:aCols[1]:cBarGetBmp    := "BB_SEARCH(30x30)"
               ::oBrw:aCols[1]:bBarGetAction := {|| ::SetFilterRegistro(::oBrw,::oQry) }
               ::oBrw:aCols[1]:bBarGetValid  := {|x| ::SetFilterRegistro(::oBrw,::oQry), .T.}


               ::oBrw:aCols[2]:uBarGetVal    := Space(11)
               ::oBrw:aCols[2]:aBarGetList   := ::aEspecialidades
               ::oBrw:aCols[2]:bBarGetChange := {|| ::SetFilterRegistro(::oBrw,::oQry) }

               ::oBrw:bClrEdits := { || { CLR_BLACK,rgb(255,250,240) } }
               // BARRA DE BUSQUEDA

.....
ACTIVATE DIALOG oDlg CENTERED ON INIT oSelf:oBrw:aCols[1]:oBarGet:SetFocus()
 
en una window lo hace pero en un dialog no
Espero ayuda, gracias
Marcelo

Re: Mr. Rao, oCol:oBarGet does not take focus with oBrw:bKeychar

Posted: Sun Aug 25, 2019 11:48 am
by nageswaragunupudi
albeiroval wrote:Hello Mr Rao,

I try to use oBrw:bKeyChar with oBarGet but it does not take focus, for the input of the search string.
Here is the code I use

Code: Select all

Function Main()
  ...
  
  oBrw::bKeyChar = {|nKey| QuerySeekWild( oBrw, oQry, cQuery, nKey )}

 ...

RETURN Nil

Static Function QuerySeekWild( oBrw,  oQry, cQuery, nKey )

  ...

  oBrw:lGetBar   = .T.
  oBrw:nGetBarHeight  = 40
  AEval( oBrw:aCols, {|o| o:uBarGetVal := "", o:bClrEdit   := {|| { CLR_BLACK, CLR_YELLOW } } } )
  oBrw:Refresh()

  ...

  oCol:uBarGetVal = uSeek  
  oCol:CreateBarGet()

  oCol:oBarGet:SetFocus() <--- // Here I need to activate control get with oCol:oBarGet
                               // the get control does not take focus
                               // for the user enters the search string
  ...

  oBrw:lGetBar = .F.
  oBrw:Refresh()
  
RETURN uSeek
 
Thanks for the help
Do not use bKeyChar !!!

Simply set

Code: Select all

oCol:lBarGetOnKey := .t.
 

Re: Mr. Rao, oCol:oBarGet does not take focus with oBrw:bKeychar

Posted: Sun Aug 25, 2019 12:09 pm
by Marcelo Roggeri
Muchas gracias Mr. Rao por su ayuda
Saludos
Marcelo