The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'

Moderator: Rathinagiri

Post Reply
User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'

Post by andyglezl » Thu Aug 27, 2015 2:48 am

Hola a todos

Estoy tratando de desplegar información en una ventana tipo PANEL, pero no funcionan
las propiedades de "FONTCOLOR" ni "TRANSPARENT"... Alguna idea ?
(Estoy trabajando con la version 3.4)
-------------------------------------------------------------------------------------------------------------
Hello everyone

I'm trying to display information in a window PANEL type, but do not work
properties "FONTCOLOR" or "transparent" ... Any ideas?
(I'm working with version 3.4)
WinPanel.jpg
WinPanel.jpg (53.16 KiB) Viewed 1629 times

Code: Select all

#include "HMG.CH"
#define  COLORFDO  	{ 176, 224, 230 }	
#define  cTITLE		"PRUEBA..."

STATIC  aActi, aTOpc, aTTip, aColo

FUNCTION MAIN()

	aActi := { "N", "N", "N", "N", "N", "N", "N", "N", "N", "N" }
	aTOpc := { "OPTION 1", "OPTION 2", "OPTION 3", "OPTION 4", "OPTION 5", "OPTION 6", "OPTION 7", "OPTION 8", "OPTION 9", "OPTION 10" }
			   
	DEFINE WINDOW Form_1 AT 000,000 WIDTH 800 HEIGHT 640 MAIN BACKCOLOR COLORFDO TITLE cTITLE NOMAXIMIZE NOMINIMIZE
		
		@ 050,010 LABEL LB_A1 VALUE "Opcion 1" WIDTH 150 HEIGHT 22 FONT "Consolas" SIZE 12 FONTCOLOR BLACK BACKCOLOR { 210, 233, 255 }  BORDER ;
						 ACTION LlenaPanel( "1" ) CENTERALIGN
		
		DEFINE WINDOW Form_2 ROW 050 COL 170 WIDTH 600 HEIGHT 545 VIRTUALWIDTH 601 VIRTUALHEIGHT 700 WINDOWTYPE PANEL BACKCOLOR {  70, 130, 180 }
			
			*

		END WINDOW

	END WINDOW
	CENTER WINDOW Form_1  
	ACTIVATE WINDOW Form_1
Return Nil
FUNCTION LlenaPanel( cOpc )
	LOCAL nRen, cCtrlPso
	
	nRen := 50 
	FOR i1 = 1 TO LEN( aActi )
		cCtrlPso := "LB_x"+STRZERO( i1, 2 )
		@ nRen,010 LABEL &cCtrlPso. OF Form_2 VALUE aTOpc[ i1 ] + ":" WIDTH 160 HEIGHT 22 FONT "Consolas" SIZE 12 ;
					FONTCOLOR BLUE BACKCOLOR { 210, 233, 255 } RIGHTALIGN  TRANSPARENT		//  <=== The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'
		nRen += 25 
	NEXT 
	@ 050,180 LABEL LB_x11 OF Form_2 VALUE "<=== The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'" WIDTH 330 HEIGHT 35 FONT "Consolas" SIZE 10 ;
					FONTCOLOR RED BACKCOLOR { 210, 233, 255 } TRANSPARENT
	
	MSGINFO( "OPCION "+cOpc )
	
	FOR i1 = 1 TO 11
		cCtrlPso := "LB_x"+STRZERO( i1, 2 )
		Form_2.&cCtrlPso..Release
	NEXT 
Return Nil
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Thu Aug 27, 2015 3:24 am

No funciona en forma automática porque estas creado los controles en forma dinámica y no en forma estática dentro del DEFINE WINDOW.
Para que funcione tu ejemplo tenes que forzar el repintado de la ventana, pone antes del MSGINFO( "OPCION "+cOpc ) lo siguiente:
RedrawWindow ( Form_2.Handle )

It does not work automatically because these controls are created dynamically and not statically within the DEFINE WINDOW.
To work fine your example, you got to force repainting of the window, put before MsgInfo ("Option" + COPC) the following:
RedrawWindow (Form_2.Handle)
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Thu Aug 27, 2015 5:03 am

Gracias Dr. Claudio, funciona OK.

Hice una prueba con esto:
BT_ClientAreaInvalidateAll( "Form_1", .F.)
BT_ClientAreaInvalidateAll( "Form_2", .F.)
y tambien funcionó.
Viva HMG !!!
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Sat Aug 29, 2015 9:38 pm

Hola

Tengo otra situacion con el siguiente ejemplo.
La Función EVAL() no se ejecuta, alguna ayuda...
-----------------------------------------------------------
Hello

I have another situation with the next example ...
EVAL() is not running, any help...

Code: Select all

#include "HMG.CH"
#define  COLORFDO     { 176, 224, 230 }   
#define  cTITLE      "PRUEBA..."

STATIC  aActi, aTOpc, aTTip, aColo

FUNCTION MAIN()

   aActi := { "N", "N", "N", "N", "N", "N", "N", "N", "N", "N" }
   aTOpc := { "OPTION 1", "OPTION 2", "OPTION 3", "OPTION 4", "OPTION 5", "OPTION 6", "OPTION 7", "OPTION 8", "OPTION 9", "OPTION 10" }
            
   DEFINE WINDOW Form_1 AT 000,000 WIDTH 800 HEIGHT 640 MAIN BACKCOLOR COLORFDO TITLE cTITLE NOMAXIMIZE NOMINIMIZE
      
      @ 050,010 LABEL LB_A1 VALUE "Opcion 1" WIDTH 150 HEIGHT 22 FONT "Consolas" SIZE 12 FONTCOLOR BLACK BACKCOLOR { 210, 233, 255 }  BORDER ;
                   ACTION LlenaPanel( "2" ) CENTERALIGN
                   *ACTION LlenaPanel( "1" ) CENTERALIGN
      
      DEFINE WINDOW Form_2 ROW 050 COL 170 WIDTH 600 HEIGHT 545 VIRTUALWIDTH 601 VIRTUALHEIGHT 700 WINDOWTYPE PANEL BACKCOLOR {  70, 130, 180 }
         
         *

      END WINDOW

   END WINDOW
   CENTER WINDOW Form_1 
   ACTIVATE WINDOW Form_1
Return Nil
FUNCTION LlenaPanel( cOpc )
   LOCAL nRen, cCtrlPso

	IF cOpc = "1"
		nRen := 50
		FOR i1 = 1 TO LEN( aActi )
			cCtrlPso := "LB_x"+STRZERO( i1, 2 )
			@ nRen,010 LABEL &cCtrlPso. OF Form_2 VALUE aTOpc[ i1 ] + ":" WIDTH 160 HEIGHT 22 FONT "Consolas" SIZE 12 ;
					   FONTCOLOR BLUE BACKCOLOR { 210, 233, 255 } RIGHTALIGN  TRANSPARENT      //  <=== The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'
			nRen += 25
		NEXT
		@ 050,180 LABEL LB_x11 OF Form_2 VALUE "<=== The FONTCOLOR, TRANSPARENT properties do not work 'Windows Panel'" WIDTH 330 HEIGHT 35 FONT "Consolas" SIZE 10 ;
				  FONTCOLOR RED BACKCOLOR { 210, 233, 255 } TRANSPARENT
	
		RedrawWindow ( Form_2.Handle )		// OK,  Dr. Claudio
		MSGINFO( "OPCION "+cOpc )
		FOR i1 = 1 TO 11
			cCtrlPso := "LB_x"+STRZERO( i1, 2 )
			Form_2.&cCtrlPso..Release
		NEXT
	ELSE		// "2"
		nRen := 5 
		nColS := 10
		FOR i1 = 1 TO 10
			cCtrlPso := "IMG_"+STRZERO( i1, 2 )
			@ nRen,nColS IMAGE &cCtrlPso. OF Form_2 PICTURE "Boton1.jpg" WIDTH 200 HEIGHT 32 STRETCH  ;
						 ACTION ( cOpc := "IMG_" + SUBSTR( This.Name, 5, 2 ) + "( " + SUBSTR( This.Name, 5, 2 ) + " )", ;		// IMG_0x( x )
						 EVAL( { || cOpc } ), MSGINFO( cOpc ) )			// <===  No se ejecuta el EVAL(), pero si el MSGINFO()  ???
			IF RIGHT( ALLTRIM( STR( i1, 2 ) ), 1 ) $ "2.4.6.8.0"
                nColS := 10
				nRen += 35
			ELSE
                nColS += 205
			ENDIF
		NEXT
	ENDIF
Return Nil
FUNCTION IMG_01( nOpc )
	MSGINFO( "Estoy dentro de la funcion: " + STRZERO( nOpc, 2 ) )
RETURN Nil
Anexo imagen .../ Annex picture ...
Boton1.jpg
Boton1.jpg (12.43 KiB) Viewed 1557 times
Andrés González López
Desde Guadalajara, Jalisco. México.

Post Reply