FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A problem in TAB handling
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: A problem in TAB handling
Posted: Thu Nov 17, 2011 11:51 PM
This is the most recent code. please test with it, thanks:

Code (fw): Select all Collapse
METHOD GoNextCtrl( hCtrl ) CLASS TWindow

   local hCtlNext, nAt
   
   if ! Empty( ::aControls ) .and. hCtrl == ::LastActiveCtrl():hWnd .and. ;
      ! Empty( ::oWnd ) .and. ( ( Upper( ::oWnd:ClassName() ) $ "TFOLDER;TPAGES;TFOLDEREX" ) )
      hCtlNext = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd )
      ::hCtlFocus = hCtrl
      SetFocus( hCtlNext )
   else
      nAt = AScan( ::aControls, { | o | o:hWnd == hCtrl } )
      if nAt != 0
         nAt = If( nAt < Len( ::aControls ), nAt + 1, 1 )
         while ! lAnd( GetWindowLong( ::aControls[ nAt ]:hWnd, GWL_STYLE ), WS_TABSTOP ) .or. ;
               ! IsWindowEnabled( ::aControls[ nAt ]:hWnd )
            nAt = If( nAt < Len( ::aControls ), nAt + 1, 1 )
         end
         SetFocus( ::aControls[ nAt ]:hWnd )
      endif
   endif

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: A problem in TAB handling
Posted: Thu Nov 17, 2011 11:52 PM
The only remaining problem that we found is when the first control is a combobox, in this case this seems to be a valid workaround until we find a better solution:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oCbx, cValue := "One"

   DEFINE DIALOG oDlg
   
   @ 1, 2 COMBOBOX oCbx VAR cValue ITEMS { "One", "Two", "Three" }
   
   @ 3, 2 BUTTON "OK"

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( ATail( oDlg:aControls ):SetFocus(), SysRefresh(), SendKey( VK_TAB ), .F. )          
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: A problem in TAB handling
Posted: Wed Nov 23, 2011 09:32 PM

:-(

Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl

Continue the discussion