About Do not allow a control gets the focus

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

About Do not allow a control gets the focus

Post by jparada »

Translated by Google,

In the following link:
viewtopic.php?f=20&t=466,

in the example that our friend Salamandra shows, I edit Main.Fmg, a part of the code is as follows:

Code: Select all

DEFINE LABEL Label_1 
         ROW 160 
         COL 10 
         WIDTH 300 
         HEIGHT 1 
         VALUE "" 
         FONTNAME "Arial" 
         Fontsize 9 
         ToolTip "" 
         FONTBOLD. F. 
         FONTITALIC. F. 
         FONTUNDERLINE. F. 
         FONTSTRIKEOUT. F. 
         HELP Nil 
         VISIBLE. T. 
         TRANSPARENT. F. 
         ACTION Nil 
         AutoSize. F. 
         BackColor (128128128) 
         Fontcolor NIL 
     END LABEL 
If I run the project from the IDE, the label control does not take focus when I navigate through the controls with the TAB key (which is right and what I need)

The same code I am trying to use an example (not using the IDE) and I do not get the same result, that is, the control gets the focus, navigating the controls with the TAB key.

What is the difference in behavior in the controls, there is something extra I should do?

Thanks

Greetings
Javier

Español,

En el siguiente link:
viewtopic.php?f=20&t=466,

en el ejemplo que muestra nuestro amigo Salamandra, Editando el archivo Main.Fmg, una parte del código es la siguiente:

Code: Select all

DEFINE LABEL Label_1
        ROW    160
        COL    10
        WIDTH  300
        HEIGHT 1
        VALUE ""
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR {128,128,128}
        FONTCOLOR NIL
    END LABEL
Si ejecuto el proyecto desde el IDE, el control label no toma el foco cuando navego por los controles con la tecla TAB, (lo cual es lo correcto y lo que yo necesito)

Este mismo código lo estoy tratando de utilizar en un ejemplo (No utilizo el IDE) y no obtengo el mismo resultado, quiero decir, el control, obtiene el foco, navegando por los controles con la tecla TAB.

A que se debe la diferencia del comportamiento en los controles?, hay algo adicional que deba hacer?

Gracias

Saludos
Javier
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: About Do not allow a control gets the focus

Post by jparada »

Sorry, I just notices that at the last control (green) by using the TAB key does not take the focus control Button1, I had not noticed that it gets the focus first tab of the Page control ( red), we made the mistake of saying that the control label (the line), taking the focus, pressing the TAB key again Button1 control now get the focus, but this behavior as I can avoid?, my code is more or less as follows:

Code: Select all

DEFINE TAB TabClientes ;
                           AT Linea(10), Columna(10) ;
                           WIDTH Columna(623) ;
                           HEIGHT Linea(425) ;
                           VALUE 1
		
     PAGE 'Datos Generales'
            @Linea(45) , Columna(15)  LABEL label1 VALUE 'Código:'                            
      END PAGE

      PAGE 'Facturación y Crédito'
                     @Linea(45) , Columna(155) TEXTBOX g_rfc
                        END PAGE
          	END TAB

       DEFINE LABEL Linea
              ROW    Linea(450)
              COL    Columna(0)
              WIDTH  665
              HEIGHT 1
              VALUE ""
              TOOLTIP ""
              ACTION Nil
              TRANSPARENT .F.
              BACKCOLOR {128,128,128}
              FONTCOLOR NIL
              AUTOSIZE
       END LABEL
                      
                    
          	DEFINE BUTTON BtnAceptar
		ROW	Linea(480)
		COL	Columna(350)
		CAPTION	'Aceptar'
		ACTION	MsgInfo('Aceptar')
		PICTURE	'..\imgs\Aceptar.Bmp'
                		WIDTH	110
		HEIGHT	35
		PICTALIGNMENT LEFT
	  END BUTTON
          
         	 DEFINE BUTTON BtnCancelar
		ROW	Linea(480)
		COL	Columna(520)
		CAPTION	'Cancelar'
		ACTION	THISWINDOW.RELEASE
		PICTURE	'..\imgs\Cancelar.Bmp'
		WIDTH	110
		HEIGHT	35
		PICTALIGNMENT LEFT
	  END BUTTON  


How can I avoid it after the last control on a tab control page, it takes the focus in this case Button1.

Thank you very much and I offer apologies for my mistake

Greetings
Javier
Attachments
img_foco.jpg
img_foco.jpg (42.52 KiB) Viewed 1800 times
Post Reply