A problem in TAB handling

Re: A problem in TAB handling

Postby Antonio Linares » Thu Nov 17, 2011 11:51 pm

This is the most recent code. please test with it, thanks:

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: A problem in TAB handling

Postby Antonio Linares » 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: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: A problem in TAB handling

Postby Patricio Avalos Aguirre » Wed Nov 23, 2011 9: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
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests