Desplazamiento como en clipper

Moderator: Rathinagiri

Post Reply
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Desplazamiento como en clipper

Post by Mario Mansilla »

Hola :
Necesito implementar el desplazamiento en los controles de un formulario al igual que lo hace el get-read de clipper .
Intento implementarlo con ONKEY pero me da error , aparentemente solo funciona cunado esta ligado a un evento del control .
¿Como puedo detectar en que control está el foco?
Saludos .
Mario Mansilla
Hi
I need to implement scrolling in a form controls as does the get-read the clipper.
I try to implement it gives me error onkey but apparently only works in-law is linked to a control event.
How I can detect which is the focus control?
Saludos
Mario Mansilla
Attachments
Onkey.rar
(663.96 KiB) Downloaded 367 times
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Desplazamiento como en clipper

Post by danielmaximiliano »

Hola Mario:
Necesitas esto para navegar sobre los diferentes TextBox

Code: Select all

#include <hmg.ch>

Function Main
        set navigation extended
        Load Window Main
		On Key Up Of Main Action (Move_Focus()) 
        Main.Center
        Main.Activate

Return
Saludos
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Re: Desplazamiento como en clipper

Post by Mario Mansilla »

Hola Daniel :
Gracias por tu repuesta .
Cuando agrego el set navigation , con Enter puedo desplazarme hacia adelante , pero necesito solucionar cuando quiero regresar al control anterior .
Por eso cuando presiono UP , el procedimiento (Move_Focus()) me da un error .
Saludos
Mario Mansilla
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Desplazamiento como en clipper

Post by gfilatov »

Mario Mansilla wrote:...
Hi
I need to implement scrolling in a form controls as does the get-read the clipper.
I try to implement it gives me error onkey but apparently only works in-law is linked to a control event.
How I can detect which is the focus control?
Saludos
Mario Mansilla
Hola Mario,

Please try the following updated sample: :arrow:

Code: Select all

#include <hmg.ch>

Function Main

        Load Window Main
		On Key Up Of Main Action Move_Focus()
        Main.Center
        Main.Activate

Return Nil

*------------------------
Static Procedure Move_Focus
*------------------------
Local c_Objeto := This.FocusedControl

Do Case
  Case c_Objeto = "Text_2"
      Main.Text_1.Setfocus
  Case c_Objeto = "Text_3"
      Main.Text_2.Setfocus
Endcase

Return
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Re: Desplazamiento como en clipper

Post by Mario Mansilla »

Hola Grigory :
Perfecto , ahora funciona como lo necesito :) .
No conocia esta propiedad .
Muchas gracias
OK, now works as I need :) . did not know this property.
thank you very much

Saludos .
Mario Mansilla
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Desplazamiento como en clipper

Post by Rathinagiri »

Thanks Grigory.

Can we know what would be the next focus control by pressing tab?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Desplazamiento como en clipper

Post by gfilatov »

rathinagiri wrote:Thanks Grigory.

Can we know what would be the next focus control by pressing tab?
Rathi,

Try

NextControlHandle := GetNextDlgTabITem ( GetActiveWindow() , GetFocus() , .f. )

and then you can get the control's index by search in the Control Handles array
i := Ascan ( _HMG_aControlHandles , NextControlHandle )

Hope that give you an idea :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Desplazamiento como en clipper

Post by Rathinagiri »

Oh! That's nice.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply