CAMBIO DE ESTILO

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

CAMBIO DE ESTILO

Post by SALINETAS24 »

Hola a todos,

He cogido el ejemplo que viene en \SAMPLES\CONTROL\GRID_1 y le he añadido la siguiente línea para cambiar el marco de GRID al primero de ellos.

Code: Select all

		HMG_ChangeWindowStyle ( GetControlHandle("Grid_1","Form_1"), LVS_REPORT, NIL, .T. )	
El caso es que al hacer EDIT sobre una línea, lo hace desplazado algo arriba e izquierda.
¿Es posible saber el estilo de tengo en el GRID?

He probado con esto

Code: Select all

	MSGBOX(HMG_IsWindowStyle ( GetControlHandle("BrowseDbf","Win_MaAr1" )) ) 
Pero el resultado es siempre falso, y necesitaría saber si he modificado el formato, o saber que formato tengo.
Los estilos LVS_ICON, LVS_SMALLICON, LVS_LISTy LVS_REPORT
Muchas gracias...


Code: Select all

/*
* HMG Hello World Demo
* (c) 2002 Andrea M.
*/

#include "hmg.ch"

Function Main

Local aRows [20] [3]
Local aRows1 [20] [3]

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 550 ;
		TITLE 'Hello World!' ;
		MAIN 
		
		DEFINE MAIN MENU
			DEFINE POPUP 'File'
*				MENUITEM 'Cambio tabla' ACTION  Form_1.Grid_1.Item() := aRows1  
			END POPUP
		END MENU

		aRows [1]	:= {'Simpson','Homer','555-5555'}
		aRows [2]	:= {'Mulder','Fox','324-6432'} 
		aRows [3]	:= {'Smart','Max','432-5892'} 
		aRows [4]	:= {'Grillo','Pepe','894-2332'} 
		aRows [5]	:= {'Kirk','James','346-9873'} 
		aRows [6]	:= {'Barriga','Carlos','394-9654'} 
		aRows [7]	:= {'Flanders','Ned','435-3211'} 
		aRows [8]	:= {'Smith','John','123-1234'} 
		aRows [9]	:= {'Pedemonti','Flavio','000-0000'} 
		aRows [10]	:= {'Gomez','Juan','583-4832'} 
		aRows [11]	:= {'Fernandez','Raul','321-4332'} 
		aRows [12]	:= {'Borges','Javier','326-9430'} 
		aRows [13]	:= {'Alvarez','Alberto','543-7898'} 
		aRows [14]	:= {'Gonzalez','Ambo','437-8473'} 
		aRows [15]	:= {'Batistuta','Gol','485-2843'} 
		aRows [16]	:= {'Vinazzi','Amigo','394-5983'} 
		aRows [17]	:= {'Pedemonti','Flavio','534-7984'} 
		aRows [18]	:= {'Samarbide','Armando','854-7873'} 
		aRows [19]	:= {'Pradon','Alejandra','???-????'} 
		aRows [20]	:= {'Reyes','Monica','432-5836'} 
		
		aRows1 [1]	:= {'1Simpson','Homer','555-5555'}
		aRows1 [2]	:= {'2Mulder','Fox','324-6432'} 
		aRows1 [3]	:= {'3Smart','Max','432-5892'} 
		aRows1 [4]	:= {'4Grillo','Pepe','894-2332'} 
		aRows1 [5]	:= {'5Kirk','James','346-9873'} 
		aRows1 [6]	:= {'6Barriga','Carlos','394-9654'} 
		aRows1 [7]	:= {'7Flanders','Ned','435-3211'} 
		aRows1 [8]	:= {'8Smith','John','123-1234'} 
		aRows1 [9]	:= {'9Pedemonti','Flavio','000-0000'} 
		aRows1 [10]	:= {'0Gomez','Juan','583-4832'} 
		aRows1 [11]	:= {'1Fernandez','Raul','321-4332'} 
		aRows1 [12]	:= {'2Borges','Javier','326-9430'} 
		aRows1 [13]	:= {'3Alvarez','Alberto','543-7898'} 
		aRows1 [14]	:= {'4Gonzalez','Ambo','437-8473'} 
		aRows1 [15]	:= {'5Batistuta','Gol','485-2843'} 
		aRows1 [16]	:= {'6Vinazzi','Amigo','394-5983'} 
		aRows1 [17]	:= {'7Pedemonti','Flavio','534-7984'} 
		aRows1 [18]	:= {'8Samarbide','Armando','854-7873'} 
		aRows1 [19]	:= {'9Pradon','Alejandra','???-????'} 
		aRows1 [20]	:= {'0Reyes','Monica','432-5836'} 

		@ 10,10 GRID Grid_1 ;
			WIDTH 760 ;
			HEIGHT 240 ;
			HEADERS {'Last Name','First Name','Phone'} ;
			WIDTHS {140,140,140};
			ITEMS aRows ;
			VALUE {1,1} ;
			TOOLTIP 'Editable Grid Control' ;
			EDIT ;
	                JUSTIFY { GRID_JTFY_CENTER,GRID_JTFY_RIGHT, GRID_JTFY_RIGHT } ;
			CELLNAVIGATION 

		HMG_ChangeWindowStyle ( GetControlHandle("Grid_1","Form_1"), LVS_REPORT, NIL, .T. )	

		@ 250,10 GRID Grid_2 ;
			WIDTH 760 ;
			HEIGHT 240 ;
			HEADERS {'Last Name','First Name','Phone'} ;
			WIDTHS {140,140,140};
			ITEMS aRows1 ;
			VALUE 1 EDIT ;
			TOOLTIP 'Editable Grid Control' ;
			ON HEADCLICK { {||MsgInfo('Click 1')} , {||MsgInfo('Click 2')} , {||MsgInfo('Click 3')} } ;
                	JUSTIFY { GRID_JTFY_LEFT,GRID_JTFY_CENTER, GRID_JTFY_CENTER } 


	END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return



Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
ASESORMIX
Posts: 190
Joined: Thu Oct 25, 2012 8:08 pm
Location: Bqto, Venezuela

Re: CAMBIO DE ESTILO

Post by ASESORMIX »

Muchas Gracias por compartir
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: CAMBIO DE ESTILO

Post by AUGE_OHR »

hi,

LVM_GETVIEW message
https://docs.microsoft.com/en-us/window ... m-getview>

Code: Select all

#define LVM_FIRST 0x1000
#define LVM_SETVIEW      (LVM_FIRST+142)
#define LVM_GETVIEW      (LVM_FIRST+143)

   hwnd := GetControlHandle( cGrid, cForm )
   nView := HMG_CallDLL( "User32.dll", ,hwnd, LVM_GETVIEW, 0, 0)
i "think" HMG does not support other Style correct when have "no Icon" attached in Imagelist of GRID
LVS_ICON need Icon but this Style is not support under HMG :(
have fun
Jimmy
Post Reply