Olá, galera!
Sou novato no xHarbour e tenho uma dúvida: Tenho 2 browse's na tela e em determinado momento, preciso saber qual deles está em foco. Como identificar isso?
Versão: xHarbour 123 HWGui
Moderador: Moderadores
oBrwMaster:SetFocus()
oBrwSlave:Setfocus()
hwg_SetFocus( handle )
Sets the keyboard focus to the specified GUI element (window or control).
handle - handle of a GUI element;
Return value - handle to the GUI element that previously had the keyboard focus.
hwg_GetFocus()
Retrieves the handle to the GUI element (window or control) that has the keyboard focus.
Return value - handle to the GUI element that has the keyboard focus.
hwg_GetSkip( oParent, hCtrl, nSkip )
Sets the input focus to other GET item.
oParent - an object of a parent window;
hCtrl - a handle of a control;
nSkip - a number of GET items to skip (positive or negative).
Versão: xHarbour 123 HWGui
Deveria ser algo semelhante à função que vc citou hwg_GetFocus(), mas estou usando XHarbour com Minigui
...
SET KEY 0,VK_F2 TO {|| PontoPed_Seleciona()}
...
Browse 1:
@ 37,32 BROWSE oBrowseFabr ARRAY SIZE 517,335 ;
STYLE WS_TABSTOP ;
FONT HFont():Add( 'Arial Narrow',0,-13,400,,,);
WHEN {||_BFocus := 'oBrowseFabr'}
...
Browse 2:
@ 589,32 BROWSE oBrowseSecao ARRAY SIZE 271,335 ;
STYLE WS_TABSTOP ;
FONT HFont():Add( 'Arial Narrow',0,-13,400,,,);
WHEN {||_BFocus := 'oBrowseSecao'}
...
*
* Função que trata o F2
*
FUNCTION PontoPed_Seleciona()
Local _vPos
If _BFocus == 'oBrowseFabr'
_vPos := oBrowseFabr
For i := 1 To Len(_aFabr)
_aFabr[i,3] := !_selFabr
Next
_selFabr := !_selFabr
oBrowseFabr := _vPos
oBrowseFabr:Refresh()
Else
If _BFocus == 'oBrowseSecao'
_vPos := oBrowseSecao
For i := 1 To Len(_aSecao)
_aSecao[i,3] := !_selSecao
Next
_selSecao := !_selSecao
oBrowseSecao := _vPos
oBrowseSecao:Refresh()
EndIf
EndIf
Return .T.
if oBrowseFabr:handle == hwg_GetFocus()
...
elseif oBrowseSecao:handle == hwg_GetFocus()
...
* source/window.c
+ HB_FUNC( SELFFOCUS )
compares two handlers returning logical values. When only one parameter is passed, the comparison is made as GetFocus()
Usuários vendo este fórum: Nenhum usuário registrado online e 4 visitantes