Tengo una funcion funcionando OK con RTF en DIALOGO, pero quiero hacer el dialogo con coordenadas.
Esta funcion usa TRichEdit5(), lo que hace es permitir que se actualice un codigo con colores y tipos de letras, y los guardo en un campo MEMO, solo que ahora lo quiero hacer con coordenadas la ctualizacion.
Como podria modificar el codigo.
Saludos
Antonio
Codigo Funcionando:
- Code: Select all Expand view
function Act_eco1(Folio1,aProfe)
local oDlg
local oRich
local lSyntaxHL := .f.
local cTxt := ""
Local oFont1,oFont2,oSay1,oSay2,oSay3,oSay4
Abre_dbf("TipExa",1,.f.,"")
Set inde to TipExa
Go top
if eof()
MsgStop(" ARCHIVO TIPOS DE EXAMENES VACIO")
Dbclosearea()
Return .f.
endif
// Simulo la lectura del contenido del campo
//cTxt := "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Microsoft Sans Serif;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}" + ;
// "{\colortbl ;\red128\green0\blue0;\red0\green0\blue0;\red0\green128\blue0;\red255\green0\blue0;}" + ;
// "\viewkind4\uc1\pard\cf1\b\i\f0\fs28 JH\cf2\b0\i0 - Sue let me \cf3 know\cf2 that their rep had noticed that they were not performing the yearly \cf4\ul\b\fs24 escrow\cf2\ulnone\b0\fs28 analysis.\cf0\f1\fs17\par" + ;
// "}"
if eof()
cTxt = ""
Else
cTxt:=a->Det_Exa
endif
Define Font oFont1 Name "Curier New" Size 0,16 BOLD
Define Font oFont2 Name "Curier New" Size 0,18 BOLD
Define Font oFont Name "Courier new" Size 0,22 BOLD
DEFINE DIALOG oDlg RESOURCE "#1011" Title "ACTUALIZA INFORME"
oDlg:lHelpIcon := .F.
/*
REDEFINE COMBOBOX oCod_pro1 VAR nCod_pro1 ITEMS ArrTranspose(aProfe)[2] ID 107 OF oDlg COLORS nRGB(9, 11, 10), nRGB(73, 250, 202);
ON CHANGE (cCod_pro1:=ArrTranspose(aProfe)[1][oCod_pro1:nAt])
*/
oRich := TRichEdit5():Redefine( 4001, bSETGET( cTxt ), oDlg )
REDEFINE BTNBMP ID 153 Resource "GRABA" OF oDlg TOOLTIP "Graba Informe" TRANSPARENT ADJUST 2007;
ACTION (cTxt := oRich:SaveAsRTF(),Graba(cTxt))
// REDEFINE BTNBMP ID 4012 Resource "#8034" OF oDlg TOOLTIP "Imprime Informe" TRANSPARENT ADJUST 2007;
// ACTION (MsgInfo( cTxt ))
REDEFINE BTNBMP ID 152 Resource "#8004" OF oDlg TOOLTIP "Volver a Lista de Pacientes" TRANSPARENT ADJUST 2007;
ACTION (oDlg:END())
ACTIVATE DIALOG oDlg CENTERED ; //
ON INIT ( oRich:LoadRtf( cTxt ), oRich:PostMsg( WM_KEYDOWN, VK_HOME, 0 ) ) ; //oRich:SetText( cTxt ) ; //
VALID ( cTxt := oRich:SaveAsRTF(), .T. ) // oRich:GetText(), .T. )
return nil
Static Function Graba(cTxt)
IF MsgYesNo( "DESEA GRABAR INFORME",, )
Sele a
go top
if !eof()
do while .t.
if flock()
Repl Det_Exa With cTxt // Grabo la Firma en la Dbf
DBCommit()
dbunlock()
exit
else
Msgwait( "Espere Archivo Ocupado","ESPERE",5 )
endif
enddo
endif
Tone( 3000 )
EndIf