Radiogroup no recibe el foco al salir de un Textbox
Moderator: Rathinagiri
Radiogroup no recibe el foco al salir de un Textbox
Este es un ejemplo modificado de samples de HMG 3.0.42
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
DEFINE MAIN MENU
POPUP 'M&isc'
ITEM 'Set RadioGroup 1 ReadOnly Property To {.T.,.T.,.T.,.T.}' ACTION Form_1.Radio_1.ReadOnly := { .T. , .T. , .T. , .T. }
ITEM 'Set RadioGroup 1 ReadOnly Property To {.F.,.F.,.F.,.F.}' ACTION Form_1.Radio_1.ReadOnly := { .F. , .F. , .F. , .F. }
ITEM 'Set RadioGroup 1 ReadOnly Property To {.F.,.T.,.F.,.T.}' ACTION Form_1.Radio_1.ReadOnly := { .F. , .T. , .F. , .T. }
SEPARATOR
ITEM 'Set RadioGroup 2 ReadOnly Property To {.T.,.T.,.T.,.T.}' ACTION Form_1.Radio_2.ReadOnly := { .T. , .T. , .T. , .T. }
ITEM 'Set RadioGroup 2 ReadOnly Property To {.F.,.F.,.F.,.F.}' ACTION Form_1.Radio_2.ReadOnly := { .F. , .F. , .F. , .F. }
ITEM 'Set RadioGroup 2 ReadOnly Property To {.F.,.T.,.F.,.T.}' ACTION Form_1.Radio_2.ReadOnly := { .F. , .T. , .F. , .T. }
SEPARATOR
ITEM 'Get RadioGroup 1 ReadOnly Property' ACTION MsgInfo ( LogicalArrayToString ( Form_1.Radio_1.ReadOnly ) )
ITEM 'Get RadioGroup 2 ReadOnly Property' ACTION MsgInfo ( LogicalArrayToString ( Form_1.Radio_2.ReadOnly ) )
END POPUP
END MENU
@ 10,10 TEXTBOX Text_1 ;
VALUE ' ' ;
TOOLTIP 'Date TextBox 1' ;
ON LOSTFOCUS form_1.Radio_1.setfocus()
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
// Form_1.date_1.SetFocus
Form_1.Text_1.SetFocus
Form_1.Center
Form_1.Activate
Return Nil
Function LogicalArrayToString ( lArray )
Local RetVal := '{ ' , I
For I := 1 To Len ( lArray )
If lArray
RetVal := RetVal + ' ".T." '
Else
RetVal := RetVal + ' ".F." '
EndIf
Next I
Return RetVal + ' }'
Lo que hice fue agregarle un Textbox y en el Lostfocus tratar de poner el foco en uno de los RadioGroup, pero resulta que no sale del Textbox al darle Enter, con el mouse si todo funciona bárbaro, pero el tema es al darle Enter.
Antonio
Sistemas
Resipol
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
DEFINE MAIN MENU
POPUP 'M&isc'
ITEM 'Set RadioGroup 1 ReadOnly Property To {.T.,.T.,.T.,.T.}' ACTION Form_1.Radio_1.ReadOnly := { .T. , .T. , .T. , .T. }
ITEM 'Set RadioGroup 1 ReadOnly Property To {.F.,.F.,.F.,.F.}' ACTION Form_1.Radio_1.ReadOnly := { .F. , .F. , .F. , .F. }
ITEM 'Set RadioGroup 1 ReadOnly Property To {.F.,.T.,.F.,.T.}' ACTION Form_1.Radio_1.ReadOnly := { .F. , .T. , .F. , .T. }
SEPARATOR
ITEM 'Set RadioGroup 2 ReadOnly Property To {.T.,.T.,.T.,.T.}' ACTION Form_1.Radio_2.ReadOnly := { .T. , .T. , .T. , .T. }
ITEM 'Set RadioGroup 2 ReadOnly Property To {.F.,.F.,.F.,.F.}' ACTION Form_1.Radio_2.ReadOnly := { .F. , .F. , .F. , .F. }
ITEM 'Set RadioGroup 2 ReadOnly Property To {.F.,.T.,.F.,.T.}' ACTION Form_1.Radio_2.ReadOnly := { .F. , .T. , .F. , .T. }
SEPARATOR
ITEM 'Get RadioGroup 1 ReadOnly Property' ACTION MsgInfo ( LogicalArrayToString ( Form_1.Radio_1.ReadOnly ) )
ITEM 'Get RadioGroup 2 ReadOnly Property' ACTION MsgInfo ( LogicalArrayToString ( Form_1.Radio_2.ReadOnly ) )
END POPUP
END MENU
@ 10,10 TEXTBOX Text_1 ;
VALUE ' ' ;
TOOLTIP 'Date TextBox 1' ;
ON LOSTFOCUS form_1.Radio_1.setfocus()
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
// Form_1.date_1.SetFocus
Form_1.Text_1.SetFocus
Form_1.Center
Form_1.Activate
Return Nil
Function LogicalArrayToString ( lArray )
Local RetVal := '{ ' , I
For I := 1 To Len ( lArray )
If lArray
RetVal := RetVal + ' ".T." '
Else
RetVal := RetVal + ' ".F." '
EndIf
Next I
Return RetVal + ' }'
Lo que hice fue agregarle un Textbox y en el Lostfocus tratar de poner el foco en uno de los RadioGroup, pero resulta que no sale del Textbox al darle Enter, con el mouse si todo funciona bárbaro, pero el tema es al darle Enter.
Antonio
Sistemas
Resipol
Antonio
Sistemas
Resipol
Sistemas
Resipol
-
- Posts: 245
- Joined: Sat Aug 02, 2008 5:03 pm
Re: Radiogroup no recibe el foco al salir de un Textbox
Hi
Antonio
Intenta sacando el onlostfocus event y agregando el comando SET NAVIGATION EXTENDED
Es conveniente traducir el mensaje en ingles (google) para ampliar los que te pueden ayudar
e-trans
Try removing de onlostfocus event and adding the command SET NAVIGATION EXTENDED
Antonio
Intenta sacando el onlostfocus event y agregando el comando SET NAVIGATION EXTENDED
Es conveniente traducir el mensaje en ingles (google) para ampliar los que te pueden ayudar
e-trans
Try removing de onlostfocus event and adding the command SET NAVIGATION EXTENDED
Regards/Saludos, Carlos (bcd12a)
Re: Radiogroup no recibe el foco al salir de un Textbox
Gracias funcionó poniendo el SET NAVIGATION EXTENDED
e-trans
Thanks worked putting the SET NAVIGATION EXTENDED
Antonio
Sistemas
Resipol
e-trans
Thanks worked putting the SET NAVIGATION EXTENDED
Antonio
Sistemas
Resipol
Carlos Britos wrote:Hi
Antonio
Intenta sacando el onlostfocus event y agregando el comando SET NAVIGATION EXTENDED
Es conveniente traducir el mensaje en ingles (google) para ampliar los que te pueden ayudar
e-trans
Try removing de onlostfocus event and adding the command SET NAVIGATION EXTENDED
Antonio
Sistemas
Resipol
Sistemas
Resipol
Re: Radiogroup no recibe el foco al salir de un Textbox
En el ejemplo anterior se solucionó el problema de darle el foco al radiogroup activando el SET NAVIGATION EXTENDED. Pense que eso mismo iba a solucionar lo siguiente:
#include "hmg.ch"
Function Main
set navigation extended
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
cTexto:=space(12)
@ 10,10 Label label1 VALUE "Texto a consultar "
DEFINE TEXTBOX Text1
ROW 10
COL 120
WIDTH 120
VALUE cTexto
INPUTMASK "!!!!!!!!!!!!"
ON CHANGE {|| if( !Empty( right(Form_1.Text1.value,1 ) ),form_1.radio_1.setfocus(),Nil ) }
END TEXTBOX
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil
Si no se completan los 12 caracteres en el Textbox al darle Enter anda todo bien, pero si se completan los 12 caracteres que tiene el INPUTMASK para llenar, debería pasar al siguiente control, en este caso el radiogroup, y aca pasa lo mismo que en el ejemplo original sin el SET NAVIGATION, se queda en algún lugar que no es el Radiogroup.
Translate google
In the example above solved the problem of giving focus to radiogroup activating the SET NAVIGATION EXTENDED. I thought that it would solve the following:
#include "hmg.ch"
Function Main
set navigation extended
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
cTexto:=space(12)
@ 10,10 Label label1 VALUE "Texto a consultar "
DEFINE TEXTBOX Text1
ROW 10
COL 120
WIDTH 120
VALUE cTexto
INPUTMASK "!!!!!!!!!!!!"
ON CHANGE {|| if( !Empty( right(Form_1.Text1.value,1 ) ),form_1.radio_1.setfocus(),Nil ) }
END TEXTBOX
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil
Failure to complete the 12 characters in the Textbox Enter to give everything goes well, but if you complete the 12 characters that have the InputMask to fill, should move to the next control, in this case the radiogroup, and the same happens here in the original example without the NAVIGATION SET, falls somewhere that is not the RadioGroup.
#include "hmg.ch"
Function Main
set navigation extended
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
cTexto:=space(12)
@ 10,10 Label label1 VALUE "Texto a consultar "
DEFINE TEXTBOX Text1
ROW 10
COL 120
WIDTH 120
VALUE cTexto
INPUTMASK "!!!!!!!!!!!!"
ON CHANGE {|| if( !Empty( right(Form_1.Text1.value,1 ) ),form_1.radio_1.setfocus(),Nil ) }
END TEXTBOX
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil
Si no se completan los 12 caracteres en el Textbox al darle Enter anda todo bien, pero si se completan los 12 caracteres que tiene el INPUTMASK para llenar, debería pasar al siguiente control, en este caso el radiogroup, y aca pasa lo mismo que en el ejemplo original sin el SET NAVIGATION, se queda en algún lugar que no es el Radiogroup.
Translate google
In the example above solved the problem of giving focus to radiogroup activating the SET NAVIGATION EXTENDED. I thought that it would solve the following:
#include "hmg.ch"
Function Main
set navigation extended
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'HMG Demo' ;
ICON 'DEMO.ICO' ;
MAIN ;
FONT 'Arial' SIZE 10
cTexto:=space(12)
@ 10,10 Label label1 VALUE "Texto a consultar "
DEFINE TEXTBOX Text1
ROW 10
COL 120
WIDTH 120
VALUE cTexto
INPUTMASK "!!!!!!!!!!!!"
ON CHANGE {|| if( !Empty( right(Form_1.Text1.value,1 ) ),form_1.radio_1.setfocus(),Nil ) }
END TEXTBOX
DEFINE RADIOGROUP Radio_1
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
ROW 40
COL 10
END RADIOGROUP
DEFINE RADIOGROUP Radio_2
ROW 70
COL 150
OPTIONS { 'One' , 'Two' , 'Three', 'Four' }
VALUE 1
WIDTH 100
TOOLTIP 'RadioGroup'
READONLY { .F. , .T. , .F. , .T. }
END RADIOGROUP
@ 150,10 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil
Failure to complete the 12 characters in the Textbox Enter to give everything goes well, but if you complete the 12 characters that have the InputMask to fill, should move to the next control, in this case the radiogroup, and the same happens here in the original example without the NAVIGATION SET, falls somewhere that is not the RadioGroup.
Antonio
Sistemas
Resipol
Sistemas
Resipol
-
- Posts: 245
- Joined: Sat Aug 02, 2008 5:03 pm
Re: Radiogroup no recibe el foco al salir de un Textbox
Hola
En los samples puedes encontrar el comando
e-trans
I'm not sure but try sending the tab key instead of form_1.radio_1.setfocus()
In the samples you can find the command.
No estoy seguro pero prueba enviar la tecla TAb en lugar de form_1.radio_1.setfocus()citro wrote: DEFINE TEXTBOX Text1
ROW 10
COL 120
WIDTH 120
VALUE cTexto
INPUTMASK "!!!!!!!!!!!!"
ON CHANGE {|| if( !Empty( right(Form_1.Text1.value,1 ) ),form_1.radio_1.setfocus(),Nil ) }
END TEXTBOX
En los samples puedes encontrar el comando
e-trans
I'm not sure but try sending the tab key instead of form_1.radio_1.setfocus()
In the samples you can find the command.
Regards/Saludos, Carlos (bcd12a)
Re: Radiogroup no recibe el foco al salir de un Textbox
No encontré en samples cual es el comando que hace esto, pero en el foro hay un post que habla de una función GuiKeyBoard, pero cuando la utilizo aparece un mensaje en el archivo build.log que diceCarlos Britos wrote:Hola
citro wrote: No estoy seguro pero prueba enviar la tecla TAb en lugar de form_1.radio_1.setfocus()
En los samples puedes encontrar el comando
referencia a `HB_FUN_GUIKEYBOARD' sin definir
En el ejemplo que hay en el foro es como que la función se crea en C, pero no explica como se vincula esa creación con HMG
Not found in samples which is the command that does this, but there is a forum post that talks about GuiKeyBoard function, but when I use it a message appears saying the file build.log
reference to `HB_FUN_GUIKEYBOARD 'undefined
In the example at this point is how the function is created in C, but does not explain how that creation is linked with HMG
Antonio
Sistemas
Resipol
Sistemas
Resipol
- danielmaximiliano
- Posts: 2613
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Radiogroup no recibe el foco al salir de un Textbox
Hola Antonio:citro wrote:No encontré en samples cual es el comando que hace esto, pero en el foro hay un post que habla de una función GuiKeyBoard, pero cuando la utilizo aparece un mensaje en el archivo build.log que diceCarlos Britos wrote:Hola
citro wrote: No estoy seguro pero prueba enviar la tecla TAb en lugar de form_1.radio_1.setfocus()
En los samples puedes encontrar el comando
referencia a `HB_FUN_GUIKEYBOARD' sin definir
En el ejemplo que hay en el foro es como que la función se crea en C, pero no explica como se vincula esa creación con HMG
Not found in samples which is the command that does this, but there is a forum post that talks about GuiKeyBoard function, but when I use it a message appears saying the file build.log
reference to `HB_FUN_GUIKEYBOARD 'undefined
In the example at this point is how the function is created in C, but does not explain how that creation is linked with HMG
el Hilo es este: http://hmgforum.com/viewtopic.php?f=5&t ... ard#p19844
Solo tienes que agregar este pequeno codigo en tu aplicacion.
Code: Select all
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
HB_FUNC( GUIKEYBOARD )
{
keybd_event( hb_parni(1), hb_parni(2), hb_parni(3), hb_parni(4) );
}
#pragma ENDDUMP
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
-
- Posts: 245
- Joined: Sat Aug 02, 2008 5:03 pm
Re: Radiogroup no recibe el foco al salir de un Textbox
HMG tiene en el codigo incorporadas las funciones InserTab() y InsertShiftTab()citro wrote: No encontré en samples cual es el comando que hace esto
Regards/Saludos, Carlos (bcd12a)
Re: Radiogroup no recibe el foco al salir de un Textbox
Hola Antonio:
el Hilo es este: http://hmgforum.com/viewtopic.php?f=5&t ... ard#p19844
Solo tienes que agregar este pequeno codigo en tu aplicacion.
[/quote]
Gracias Daniel, funcionó perfecto, lo único que hice fue cambiar "VK_RETURN" del ejemplo por "VK_TAB"
el Hilo es este: http://hmgforum.com/viewtopic.php?f=5&t ... ard#p19844
Solo tienes que agregar este pequeno codigo en tu aplicacion.
Code: Select all
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
HB_FUNC( GUIKEYBOARD )
{
keybd_event( hb_parni(1), hb_parni(2), hb_parni(3), hb_parni(4) );
}
#pragma ENDDUMP
Gracias Daniel, funcionó perfecto, lo único que hice fue cambiar "VK_RETURN" del ejemplo por "VK_TAB"
Antonio
Sistemas
Resipol
Sistemas
Resipol