Archivo de texto en xBrowse
Posted: Wed Oct 17, 2012 11:54 am
Es posible mostrar un archivo de texto en un control xBrowse ? y si es posible, donde puedo buscar un ejemplo. Gracias.
Saludos
Saludos
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
https://forums.fivetechsupport.com/viewtopic.php?f=6&t=25036
static function xBrwTextFile( cFileTxt, cTitle )
local oDlg, oBrw, oCol, oSay, oBtn
local oFont
local lExit:= FALSE
local oTxt := TTxtFile():New( cFileTxt )
local aGrad:= { { 1/20, RGB( 235, 244, 253 ), RGB( 235, 244, 253 ) }, ;
{ 1/20, RGB( 125, 162, 206 ), RGB( 125, 162, 206 ) }, ;
{ 16/20, RGB( 220, 235, 252 ), RGB( 193, 219, 252 ) }, ;
{ 1/20, RGB( 125, 162, 206 ), RGB( 125, 162, 206 ) }, ;
{ 1/20, RGB( 235, 244, 253 ), RGB( 235, 244, 253 ) } }
DEFAULT cTitle:= "BROWSE DE ARCHIVO TEXTO"
DEFINE FONT oFont NAME "Arial" SIZE 08, 15 BOLD
DEFINE DIALOG oDlg RESOURCE "Browse_Texto" TITLE "Movimiento de Articulos" ICON ovarsis:aBitmaps[ BMP32_ICON ] TRANSPARENT FONT oFont
REDEFINE XBROWSE oBrw ID 200 OF oDlg;
COLUMNS "cLine";
OBJECT oTxt;
FOOTERS
WITH OBJECT oBrw:cLine
:bFooter:= {|| "Linea = " + LTrim( Str( oTxt:RecNo() ) ) + " / " + LTrim( Str( oTxt:RecCount() ) )}
:cHeader:= cTitle
END
WITH OBJECT oBrw
:nfreeze := 1
:bClrSelFocus := {|| { CLR_BLACK, aGrad } }
:nMarqueeStyle:= 4
:nStretchCol := 1
:nRowHeight := 20
END
oDlg:oClient:= oBrw
REDEFINE BTNBMP oBtn ID 300 OF oDlg 2007;
CENTER;
PROMPT "Salir";
ACTION ( lExit:=TRUE, oDlg:End() )
oBtn:bClrGrad:= {|lInvert| If( lInvert, aClrGradInvert(), aClrGradRed() )}
oDlg:lHelpIcon:= .F.
ACTIVATE DIALOG oDlg;
VALID lExit;
CENTERED
// Clierra el Archivo Abierto
IF !FClose( oTxt:hFile )
MsgAlert( "Error Cerrando Archivo " + cFileTxt )
ENDIF
RETURN nil