FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Modificar la rayita del cursor: en GET
Posts: 418
Joined: Wed Nov 26, 2008 06:33 PM
Modificar la rayita del cursor: en GET
Posted: Thu Jun 04, 2015 04:26 PM

Saludote:

Examinando la clase tget, veo:

       Set( _SET_INSERT, ! Set( _SET_INSERT ) )
       DestroyCaret()
       if Set( _SET_INSERT )
          CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() - 1 )
       else
          CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
       endif
       ShowCaret( ::hWnd )

he intentado hacer que mi cursor en la edicion de TODOS los get'a, sea un poco mas ancho (del 2 al 3) poniendo en el metodo oGet:New() (ver en lugar de una simple rayita titilante del cursor, ver la misma pero con el doble de ancho)

       DestroyCaret()
       CreateCaret( ::hWnd, 0, 3, ::nGetChrHeight() ) // 3 o 4
       ShowCaret( ::hWnd )

y no me resulta, una manita porfa:

Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Modificar la rayita del cursor: en GET
Posted: Thu Jun 04, 2015 04:51 PM

Noe:

Supongo que la necesidad de ampliar el cursor es porque para el usuario no es claro
en que get está el cursor, si es así, una opción es que le cambies el color del fondo
cuando el get tenga el foco y se lo vuelves a cambiar cuando lo pierda.

Saludos

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 418
Joined: Wed Nov 26, 2008 06:33 PM
Re: Modificar la rayita del cursor: en GET
Posted: Thu Jun 04, 2015 08:44 PM

Gracias Armando.

precisamente asi tengo ya definido los gets, cambia de color con el foco, y cuando lo dejo.
Pero, en realidad como mensionas, para algunas personas por su vision se les complica identificar aun alli, la posicion del cursor.

entonces, debo tener la posibilidad de configurar en algunos casos asi el cursor.

Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Modificar la rayita del cursor: en GET
Posted: Fri Jun 05, 2015 09:11 AM

Noé,

Tendrías que modificar la clase TGet y buscar estas líneas:

CreateCaret( ::hWnd, 0, 1, ::nGetChrHeight() )

y reemplazarlas con:

CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() )

Puedes probar con otros valores diferentes a 6. Luego compila y enlaza el tget.prg modificado por ti
como si fuese un PRG más de tu aplicación.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 418
Joined: Wed Nov 26, 2008 06:33 PM
Re: Modificar la rayita del cursor: en GET
Posted: Fri Jun 05, 2015 05:53 PM

Antonio Linares:

De echo modificar el tget fue lo primero que hice
el metodo KeyDown() tiene

  case nKey == VK_INSERT .and. ! GetKeyState( VK_SHIFT ) ;
       .and. ! GetKeyState( VK_CONTROL )   // to copy to the clipboard

       Set( _SET_INSERT, ! Set( _SET_INSERT ) )
       DestroyCaret()
       if Set( _SET_INSERT )
          CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() - 1 )
       else
          CreateCaret( ::hWnd, 0, 3, ::nGetChrHeight() )
       endif
       ShowCaret( ::hWnd )
       return 0

y el GotFocus()

   if Set( _SET_INSERT )
      DestroyCaret()
      CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() - 1 )
      ShowCaret( ::hWnd )
   endif

y son las unicas lineas con la definicion del CreateCaret()

lo ligo a mi libreria y no lo hace, solo al teclear INSERT, pone el cursor como insercion, y al volver a oprimir INSERT si lo pone a 3 como lo modifico, pero solo en ese get, no en los demas. (no se de que version del tget me hables o de FWH

Ayuda.

Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Posts: 418
Joined: Wed Nov 26, 2008 06:33 PM
Re: Modificar la rayita del cursor: en GET
Posted: Fri Jun 05, 2015 06:04 PM

Antonio.

modifique la clase tget nuevamente:

delntro del metodo GotFocus()

if Set( _SET_INSERT )
DestroyCaret()
CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() - 1 )
ShowCaret( ::hWnd )
else
DestroyCaret()
CreateCaret( ::hWnd, 0, 3, ::nGetChrHeight() )
ShowCaret( ::hWnd )
endif

y ya me pone el curso a 3, pero como le puedria quitar el 'BLINK' (parpadear)

gracias.

Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Modificar la rayita del cursor: en GET
Posted: Fri Jun 05, 2015 07:42 PM
Noé,

Por lo visto hay una función de Windows a la que se puede llamar:

BOOL SetCaretBlinkTime(
UINT uMSeconds //blink time in milliseconds
);

Prueba a añadir esta nueva función a tu PRG principal

Code (fw): Select all Collapse
#include <windows.h>
#include <hbapi.h>

HB_FUNC( SETCARETBLINKTIME )
{
   hb_retl( SetCaretBlinkTime( hb_parnl( 1 ) ) );
}


Y desde tu PRG prueba a llamar a:

SetCaretBlinkTime( 0 )

Prueba con otros valores distintos a cero también
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion