by Silvio » Thu Mar 23, 2006 11:47 pm
Antonio not run ok !!!
I changed... but it compile but not run ok
Regards
- Code: Select all Expand view
#include "FiveWin.ch"
REQUEST DbfCdx
// --------------------
Function SetupCol()
// --------------------
Local oDlg
Local oSay
Local olbx1
Local oFontBro
Local oget:=Array(6)
Local oGet_:=Array(2)
Local oBit:=Array(17)
Local xGEt1:="Campo Numero 1"
Local xGEt2:="Campo Numero 2"
Local nVar1,nVvar2,nVar3
Public oIni:=TApplication()
IF !File(oIni:cFile)
Msginfo("l'Archivo Default.ini non esiste,"+CRLF+"Si caricano i parametri per default")
oIni:cFile:="Nessuno"
Endif
LeoIni(oIni:cFile) // Traigo el Ini Default.ini
RddSetDefault("DBFCDX")
* archivio di prova
USE Clientes INDEX Clientes SHARED NEW
DEFINE DIALOG oDlg RESOURCE "SETUPCOLOR"
REDEFINE SAY oSayArch VAR oIni:cFile ID 410 OF oDlg;
COLOR CLR_HRED Update
REDEFINE LISTBOX oLbx1 ;
FIELDS Clientes->Nombre,Clientes->Direccion;
HEADERS "Nome del Cliente", "Indirizzo del Cliente" ;
ID 108 OF Odlg
oLbx1:lDrawFooters :=.T.
Colbro(olbx1)
olbx1:SetFocus()
Olbx1:aFooters :={|| {"FColore1","Fcolore2"} }
REDEFINE BITMAP oBit[1] ID 200 OF Odlg;
ON CLICK (oIni:nClrForeHead:=ChooseColor(oIni:nClrForeHead),;
obit[1]:SetColor(,oIni:nClrForeHead),obit[1]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[2] ID 210 OF Odlg;
ON CLICK (oIni:nClrBackHead:=ChooseColor(oIni:nClrBackHead),;
obit[2]:SetColor(,oIni:nClrBackHead),obit[2]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[3] ID 220 OF Odlg;
ON CLICK (oIni:nClrFore:=ChooseColor(oIni:nClrFore),;
obit[3]:SetColor(,oIni:nClrFore),obit[3]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[4] ID 230 OF Odlg;
ON CLICK (oIni:nClrBack:=ChooseColor(oIni:nClrBack),;
obit[4]:SetColor(,oIni:nClrBack),obit[4]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[5] ID 240 OF Odlg;
ON CLICK (oIni:nClrForeFocus:=ChooseColor(oIni:nClrForeFocus),;
obit[5]:SetColor(,oIni:nClrForeFocus),obit[5]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[6] ID 245 OF Odlg;
ON CLICK (oIni:nClrNFFore:=ChooseColor(oIni:nClrNFFore),;
obit[6]:SetColor(,oIni:nClrNFFore),obit[6]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[7] ID 250 OF Odlg;
ON CLICK (oIni:nClrBackFocus:=ChooseColor(oIni:nClrBackFocus),;
obit[7]:SetColor(,oIni:nClrBackFocus),obit[7]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[8] ID 255 OF Odlg;
ON CLICK (oIni:nClrNFBack:=ChooseColor(oIni:nClrNFBack),;
obit[8]:SetColor(,oIni:nClrNFBack),obit[8]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[9] ID 256 OF Odlg;
ON CLICK (oIni:nClrFFore:=ChooseColor(oIni:nClrFFore),;
obit[9]:SetColor(,oIni:nClrFFore),obit[9]:refresh(),Colbro(Olbx1)) Update
REDEFINE BITMAP oBit[10] ID 257 OF Odlg;
ON CLICK (oIni:nClrFBack:=ChooseColor(oIni:nClrFBack),;
obit[10]:SetColor(,oIni:nClrFBack),obit[10]:refresh(),Colbro(Olbx1)) Update
REDEFINE CHECKBOX oCheck VAR oIni:InterLinea ID 260 OF Odlg;
ON CHANGE Colbro(Olbx1) Update
REDEFINE BITMAP oBit[11] ID 270 OF Odlg;
ON CLICK (oIni:Col1Interl:=ChooseColor(oIni:Col1Interl),;
obit[11]:SetColor(,oIni:Col1Interl),obit[11]:refresh(),Colbro(Olbx1));
When oIni:InterLinea Update
REDEFINE BITMAP oBit[12] ID 280 OF Odlg;
ON CLICK (oIni:Col2Interl:=ChooseColor(oIni:Col2Interl),;
obit[12]:SetColor(,oIni:Col2Interl),obit[12]:refresh(),Colbro(Olbx1));
When oIni:InterLinea Update
REDEFINE GET oGet[1] VAR oIni:nlinestyle ID 290 SPINNER MIN 0 MAX 10 PICTURE "@Z 99" OF Odlg ;
ON CHANGE Colbro(Olbx1) Update
REDEFINE BITMAP oBit[13] ID 300 OF Odlg;
ON CLICK (oIni:nClrLine:=ChooseColor(oIni:nClrLine),;
obit[13]:SetColor(,oIni:nClrLine),obit[13]:refresh(),Colbro(Olbx1)) Update
REDEFINE CHECKBOX oCheck2 VAR oIni:lCellStyle ID 310 OF Odlg;
ON CHANGE Colbro(Olbx1) Update
REDEFINE GET oGet[2] VAR oIni:FontBro ID 320 OF Odlg Update
REDEFINE BITMAP oBit[14] ID 330 RESOURCE "FONT" OF Odlg;
ON CLICK (olbx1:oFont:=SelectFont("B"),;
Colbro(Olbx1),aEval(odlg:acontrols,{|o|o:Refresh()}),olbx1:gotop())
REDEFINE GET oGet[3] VAR oIni:nHeaderHeight ID 340 SPINNER MIN 20 MAX 60 PICTURE "@Z 99" OF Odlg;
ON CHANGE (oLbx1:nHeaderHeight:=oIni:nHeaderHeight,oLbx1:Refresh()) UPDATE
REDEFINE GET oGet[4] VAR oInioIni:nLineHeight ID 350 SPINNER MIN 20 MAX 60 PICTURE "@Z 99" OF Odlg;
ON CHANGE (oLbx1:nLineHeight := oIni:nLineHeight, oLbx1:refresh()) Update
REDEFINE GET oGet[5] VAR oIni:nFooterHeight ID 360 SPINNER MIN 20 MAX 60 PICTURE "@Z 99" OF Odlg;
ON CHANGE (oLbx1:nFooterHeight := oIni:nFooterHeight, oLbx1:refresh()) Update
// Get's
REDEFINE GET oGet_[1] VAR xget1 ID 365 OF Odlg Update
REDEFINE GET oGet_[2] VAR xget2 ID 366 OF Odlg Update
oGet_[1]:oFont:=TFont():New( oIni:FonTGet, 0, -oIni:FsizeGet,, oIni:lBoldGet )
oGet_[2]:oFont:=oGet_[1]:oFont
REDEFINE BITMAP oBit[15] ID 380 OF Odlg ;
ON CLICK (oIni:cGotFocus:=ChooseColor(oIni:cGotFocus),obit[15]:SetColor(,oIni:cGotFocus),;
obit[15]:refresh(),ACTIVAGET(oGet_,oGet_[1]:oFont)) Update
REDEFINE BITMAP oBit[16] ID 390 OF Odlg ;
ON CLICK (oIni:cLostFocus:=ChooseColor(oIni:cLostFocus),obit[16]:SetColor(,oIni:cLostFocus),;
obit[16]:refresh(),ACTIVAGET(oGet_,oGet_[1]:oFont)) Update
REDEFINE GET oGet[6] VAR oIni:FontGet ID 391 OF Odlg Update
REDEFINE BITMAP oBit[17] ID 400 RESOURCE "FONT" OF Odlg ;
ON CLICK (oGet_[1]:oFont:=SelectFont("G"),oGet[7]:Refresh(),oGet_[1]:Refresh(),;
oGet_[2]:oFont:=oGet_[1]:oFont,oGet_[2]:Refresh(),ACTIVAGET(oget_,oGet_[1]:oFont),xGet1:="Get Modficado",oGet_[1]:Refresh(),;
oDlg:Update() ) Update
ColorBot(oBit)
ACTIVAGET(oget_,oGet_[1]:oFont)
ACTIVATE DIALOG oDlg CENTER ON IniT (BarraIni(oDlg,oLbx1,oBit))
RETURN NIL
// --------------------------------
FUNCTION SelectFont(Cual)
// --------------------------------
LOCAL oFont
LOCAL oNewFont
LOCAL NameFont
LOCAL SizeFont
LOCAL BoldFont
IF Cual = "B" // Browse
NameFont:=oIni:FontBro
SizeFont:=oIni:FSizebro
BoldFont:=oIni:lBoldbro
ENDIF
IF Cual = "G" // Gets
NameFont:=oIni:FontGet
SizeFont:=oIni:FsizeGet
BoldFont:=oIni:lBoldGet
ENDIF
nFondo :=oIni:nClrForeHead
IF BoldFont
DEFINE FONT oFont NAME NameFont ;
SIZE 0,-Round(SizeFont*13/10,0) BOLD
ELSE
DEFINE FONT oFont NAME NameFont ;
SIZE 0,-Round(SizeFont*13/10,0)
ENDIF
oFont:Choose(@nFondo)
IF oFont:cFaceName != NameFont .OR. ;
oFont:lBold != BoldFont .OR. ;
oFont:nHeight != -Round(SizeFont*13/10, 0)
NameFont:=oFont:cFaceName
SizeFont:=Abs(Int(oFont:nHeight*10/13))
BoldFont:=oFont:lBold
IF Cual = "B"
oIni:FontBro :=oFont:cFaceName
oIni:FSizebro:=Abs(Int(oFont:nHeight*10/13))
oIni:lBoldbro:=oFont:lBold
ENDIF
IF Cual = "G"
oIni:FontGet :=oFont:cFaceName
oIni:FsizeGet:=Abs(Int(oFont:nHeight*10/13))
oIni:lBoldGet:=oFont:lBold
ENDIF
IF BoldFont
DEFINE FONT oNewFont NAME NameFont ;
SIZE 0,-Abs(Int(oFont:nHeight*10/13)) BOLD
ELSE
DEFINE FONT oNewFont NAME NameFont ;
SIZE 0,-Abs(Int(oFont:nHeight*10/13))
ENDIF
ENDIF
oFont:End()
RETURN (oNewFont) //NIL
//--------------------------------------------------------------------------//
FUNCTION LeoIni(cFile)
INI oIni FILE (cFile)
// Browse
GET oIni:nClrForeHead SECTION "Browse Setup" ;
ENTRY "nClrForeHead" DEFAULT "0" OF oIni
GET oIni:nClrBackHead SECTION "Browse Setup" ;
ENTRY "nClrBackHead" DEFAULT "12632256" OF oIni
GET oIni:nClrFore SECTION "Browse Setup" ;
ENTRY "nClrFore" DEFAULT "0" OF oIni
GET oIni:nClrBack SECTION "Browse Setup" ;
ENTRY "nClrBack" DEFAULT "16777215" OF oIni
GET oIni:nClrForeFocus SECTION "Browse Setup";
ENTRY "nClrForeFocus" DEFAULT "16777215" OF oIni
GET oIni:nClrBackFocus SECTION "Browse Setup";
ENTRY "nClrBackFocus" DEFAULT "8404992" OF oIni
GET oIni:nClrNFBack SECTION "Browse Setup" ;
ENTRY "nClrNFBack" DEFAULT "8421504" OF oIni
GET oIni:nClrNFFore SECTION "Browse Setup" ;
ENTRY "nClrNFFore" DEFAULT "16777215" OF oIni
GET oIni:nClrFFore SECTION "Browse Setup" ;
ENTRY "nClrFFore" DEFAULT "0" OF oIni
GET oIni:nClrFBack SECTION "Browse Setup" ;
ENTRY "nClrFBack" DEFAULT "12632256" OF oIni
GET oIni:Interlinea SECTION "Browse Setup" ;
ENTRY "Interlinea" DEFAULT .F. OF oIni
GET oIni:Col1Interl SECTION "Browse Setup" ;
ENTRY "Col1Interl" DEFAULT "16777215" OF oIni
GET oIni:Col2Interl SECTION "Browse Setup" ;
ENTRY "Col2Interl" DEFAULT "16777215" OF oIni
GET oIni:nLinestyle SECTION "Browse Setup" ;
ENTRY "nLinestyle" DEFAULT "3" OF oIni
GET oIni:nClrLine SECTION "Browse Setup" ;
ENTRY "nClrline" DEFAULT "12632256" OF oIni
GET oIni:lCellStyle SECTION "Browse Setup" ;
ENTRY "lCellStyle" DEFAULT .F. OF oIni
GET oIni:FontBro SECTION "Browse Setup" ;
ENTRY "Font Name" DEFAULT "Ms Sans Serif" OF oIni
GET oIni:FsizeBro SECTION "Browse Setup" ;
ENTRY "Font Size" DEFAULT 8 OF oIni
GET oIni:lBoldBro SECTION "Browse Setup" ;
ENTRY "Font Bold" DEFAULT .F. OF oIni
GET oIni:nHeaderHeight SECTION "Browse Setup" ;
ENTRY "nHeaderHeight" DEFAULT 20 OF oIni
GET oIni:nLineHeight SECTION "Browse Setup" ;
ENTRY "nLineHeight" DEFAULT 20 OF oIni
GET oIni:nFooterHeight SECTION "Browse Setup" ;
ENTRY "nFooterHeight" DEFAULT 20 OF oIni
// Say
GET oIni:FontSay SECTION "Say Setup" ;
ENTRY "FontSay" DEFAULT "Ms Sans Serif" OF oIni
GET oIni:FsizeSay SECTION "Say Setup" ;
ENTRY "FsizeSay" DEFAULT 8 OF oIni
GET oIni:lBoldSay SECTION "Say Setup" ;
ENTRY "lBoldSay" DEFAULT .F. OF oIni
GET oIni:nClrTSay SECTION "Say Setup" ;
ENTRY "nClrTSay" DEFAULT "0" OF oIni
GET oIni:nClrBSay SECTION "Say Setup" ;
ENTRY "nClrBSay" DEFAULT "12632256" OF oIni
// GET
GET oIni:FontGet SECTION "Get Setup" ;
ENTRY "FontGet" DEFAULT "Ms Sans Serif" OF oIni
GET oIni:FsizeGet SECTION "Get Setup" ;
ENTRY "FsizeGet" DEFAULT 8 OF oIni
GET oIni:lBoldGet SECTION "Get Setup" ;
ENTRY "lBoldGet" DEFAULT .F. OF oIni
GET oIni:cGotFocus SECTION "Get Setup" ;
ENTRY "cGotFocus" DEFAULT "12632256" OF oIni
GET oIni:cLostFocus SECTION "Get Setup" ;
ENTRY "cLostFocus" DEFAULT "16777215" OF oIni
// Convertimos los Colores a Valores Numericos
oIni:nClrForeHead :=Val(oIni:nClrForeHead)
oIni:nClrBackHead :=Val(oIni:nClrBackHead)
oIni:nClrFore :=Val(oIni:nClrFore)
oIni:nClrBack :=Val(oIni:nClrBack)
oIni:nClrForeFocus :=Val(oIni:nClrForeFocus)
oIni:nClrBackFocus :=Val(oIni:nClrBackFocus)
oIni:nClrNFBack :=Val(oIni:nClrNFBack)
oIni:nClrNFFore :=Val(oIni:nClrNFFore)
oIni:nClrFFore :=Val(oIni:nClrFFore)
oIni:nClrFBack :=Val(oIni:nClrFBack)
oIni:Col1Interl :=Val(oIni:Col1Interl)
oIni:Col2Interl :=Val(oIni:Col2Interl)
oIni:nlinestyle :=VAl(oIni:nlinestyle)
oIni:nClrLine :=Val(oIni:nClrLine)
oIni:nClrTSay :=Val(oIni:nClrTSay)
oIni:nClrBSay :=Val(oIni:nClrBSay)
oIni:cGotFocus :=Val(oIni:cGotFocus)
oIni:cLostFocus :=Val(oIni:cLostFocus)
ENDINI
RETURN NIL
// -----------------------------------------------
Function GraboIni(cFile)
// -----------------------------------------------
LOCAL oIni
INI oIni FILE (cFile)
// BROWSE
SET SECTION "Browse Setup";
ENTRY "nClrForeHead" TO oIni:nClrForeHead OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrBackHead" TO oIni:nClrBackHead OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrFore" TO oIni:nClrFore OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrBack" TO oIni:nClrBack OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrForeFocus" TO oIni:nClrForeFocus OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrBackFocus" TO oIni:nClrBackFocus OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrNFBack" TO oIni:nClrNFBack OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrNFFore" TO oIni:nClrNFFore OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrFFore" TO oIni:nClrFFore OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrFBack" TO oIni:nClrFBack OF oIni
SET SECTION "Browse Setup";
ENTRY "Interlinea" TO oIni:Interlinea OF oIni
SET SECTION "Browse Setup";
ENTRY "Col1Interl" TO oIni:Col1Interl OF oIni
SET SECTION "Browse Setup";
ENTRY "Col2Interl" TO oIni:Col2Interl OF oIni
SET SECTION "Browse Setup";
ENTRY "nLinestyle" TO oIni:nLinestyle OF oIni
SET SECTION "Browse Setup";
ENTRY "nClrline" TO oIni:nClrLine OF oIni
SET SECTION "Browse Setup";
ENTRY "lCellStyle" TO oIni:lCellStyle OF oIni
SET SECTION "Browse Setup" ;
ENTRY "Font Name" TO oIni:FontBro OF oIni
SET SECTION "Browse Setup" ;
ENTRY "Font Size" TO oIni:FsizeBro OF oIni
SET SECTION "Browse Setup" ;
ENTRY "Font Bold" TO oIni:lBoldBro OF oIni
SET SECTION "Browse Setup" ;
ENTRY "nHeaderHeight" TO oIni:nHeaderHeight OF oIni
SET SECTION "Browse Setup" ;
ENTRY "nLineHeight" TO oIni:nLineHeight OF oIni
SET SECTION "Browse Setup" ;
ENTRY "nFooterHeight" TO oIni:nFooterHeight OF oIni
// Say
SET SECTION "Say Setup";
ENTRY "FontSay" TO oIni:FontSay OF oIni
SET SECTION "Say Setup";
ENTRY "FsizeSay" TO oIni:FsizeSay OF oIni
SET SECTION "Say Setup";
ENTRY "lBoldSay" TO oIni:lBoldSay OF oIni
SET SECTION "Say Setup";
ENTRY "nClrTSay" TO oIni:nClrTSay OF oIni
SET SECTION "Say Setup";
ENTRY "nClrBSay" TO oIni:nClrBSay OF oIni
// GET
SET SECTION "Get Setup";
ENTRY "FontGet" TO oIni:FontGet OF oIni
SET SECTION "Get Setup";
ENTRY "FsizeGet" TO oIni:FsizeGet OF oIni
SET SECTION "Get Setup";
ENTRY "lBoldGet" TO oIni:lBoldGet OF oIni
SET SECTION "Get Setup";
ENTRY "cGotFocus" TO oIni:cGotFocus OF oIni
SET SECTION "Get Setup";
ENTRY "cLostFocus" TO oIni:cLostFocus OF oIni
ENDINI
LeoIni(cFile)
RETURN NIL
// -----------------------------------------------
Function Colbro(Olbx)
// -----------------------------------------------
/* Esta es la Funcion que ejecuta todos los
cambios necesarios para configurar su
Browse de acuerdo al contenido de su Ini.
Esta sera llamada cada vez que uste haga
un nuevo browse. /*
/* Configuramos el Browse de Acuerdo a los parametros
del Ini */
/* colores del titulo de la columnas */
oLbx:nClrForeHead :=oIni:nClrForeHead
oLbx:nClrBackHead :=oIni:nClrBackHead
/*Colores del Cuerpo */
oLbx:SetColor( oIni:nClrFore,oIni:nClrBack)
/* Color de la Barra */
oLbx:nClrForeFocus:=oIni:nClrForeFocus
olbx:nClrBackFocus:=oInioIni:nClrBackFocus
// Para la Barra Cuando no esta Seleciona
Olbx:nClrNFBack:=Ini:nClrNFBack // nrgb(136,132,136)
oLbx:nClrNFFore:=oIni:nClrNFFore // nrgb(255,255,255)
// Para los Footers
oLbx:nClrFFore:=oIni:nClrFFore
oLbx:nClrFBack:=oIni:nClrFBack
/* Estilo de las Lineas */
olbx:nlinestyle :=oIni:nlinestyle
/* Color de las Lineas */
oLbx:nClrLine :=oIni:nClrLine
If oIni:interLinea
oLbx:nClrPane :={|| SelColor(olbx) }
Endif
Olbx:lCellStyle := oIni:lCellStyle
oLbx:nHeaderHeight:= oIni:nHeaderHeight
oLbx:nLineHeight := oIni:nLineHeight
oLbx:nFooterHeight:= oIni:nFooterHeight
oLbx:lAdjBrowse:=.T.
oLbx:oFont:=TFont():New( oIni:FontBro, 0, -oIni:Fsizebro,, oIni:lBoldBro )
olbx:Refresh()
Return NIL
// -----------------------------------------------
STATIC Function Selcolor(oLbx)
// -----------------------------------------------
/* Funcion Para Interlineado de Colores */
If olbx:cAlias = "Array"
x:=olbx:nAt/2
y:=Int(x)
Z:=x-y
Else
x:=&(oLbx:cAlias)->(ordKeyNo()) / 2
y:=Int(x)
Z:=x-y
Endif
IF Z = 0
nClr :=oIni:Col1Interl
Else
nClr :=oIni:Col2Interl
Endif
Return nClr
//---------------------------------------------------
/*
Esta Funcion activa los controles del array aTable
dandole un trato especial a los objetos get */
FUNCTION ACTIVAGET(aTable,oFont)
//---------------------------------------------------
aEval( aTable,{|o|o:Enable(),iif(o:classname=="TGET",ColGet(o,oFont),),;
IIF(o:classname<>"TRADMENU",o:Refresh(),) } )
Return aTable
//---------------------------------------------------
Function ColGet(oGet,oFont)
//---------------------------------------------------
/*
cambiar el Color de los Gets y la da el Font del Ini*/
Local nClrFocusText :=nRGB(0,0,0)
oGet:bGotFocus :={|| (oGet:Setpos(1),oGet:SetColor(nClrFocusText,Ini:cGotFocus))}
oGet:bLostFocus :={|| oGet:SetColor(nClrFocusText,Ini:cLostFocus)}
oGet:SetFont(oFont)
Return .T.
// --------------------------
CLASS TApplication
// --------------------------
// colores del titulo de la columnas //
DATA nClrForeHead
DATA nClrBackHead
// Colores del Cuerpo y Texto
DATA nClrFore
DATA nClrBack
// Color de la Barra //
DATA nClrForeFocus
DATA nClrBackFocus
// Para la Barra Cuando no esta Seleciona
DATA nClrNFBack
DATA nClrNFFore
// Para los Footers
DATA nClrFFore
DATA nClrFBack
// Color del Interlineado de Filas
DATA InterLinea // Interlineado de Colores .T. o .F.
DATA Col1Interl // Color Interlineado 1
DATA Col2Interl // Color Interlineado 2
// Estilo de las Lineas Separadoras //
DATA nlinestyle
// Color de las Lineas separadoras //
DATA nClrLine
// Caracteristicas del Browse
DATA lCellStyle // Estilo de Celdas .T. o .F.
// Varias //
DATA FontBro // Font del Bro
DATA FsizeBro // Size del Font
DATA lBoldBro // Bold .T. o .F.
DATA nHeaderHeight // Alto de las Cabeceras
Data nFooterHeight // Alto de los Footers
DATA nLineHeight // alto de la Linea de Registro del Browse
DATA lAdjLastCol // Estirar la Ultima Columna
DATA lAdjBrowse // Ajustar el Browse Hasta el Final del Control
// Say
DATA FontSay
DATA FsizeSay
DATA lBoldSay
DATA nClrTSay
DATA nClrBSay
// GET'S
DATA FontGet
DATA FsizeGet
DATA lBoldGet
DATA cgotFocus
DATA cLostFocus
// Ruta del Ini Default
DATA cFile INIT Curdrive()+":\"+GetCurDir()+"\Default.ini"
ENDCLASS
//----------------------------------------------------------------------------//
Function Open_save(nOpcion,oLbx1,oBit)
//----------------------------------------------------------------------------//
Local cFile
If nOpcion=1 // Abrir
cFile := cGetFile( "Archivi Ini (*.ini) | *.ini |" + ;
"Tutti i files (*.*) | *.* |",;
"Selezione Archivo ini per aprire ",1)
Else
cFile := cGetFile( "Archivi Ini (*.ini) | *.ini |" + ;
"Tutti i files (*.*) | *.* |",;
"Salvare Archivo ini",1,,.T.)
Endif
If !Empty(cFile) .And. nOpcion=1
oIni:cFile:=cFile
LeoIni(cFile)
Colbro(olbx1)
Endif
If !Empty(cFile) .And. nOpcion=2
oIni:cFile:=cFile
GraboIni(cFile)
LeoIni(cFile)
Colbro(olbx1)
Endif
ColorBot(oBit)
Return NIL
// -----------------------------------
Function ColorBot(oBit)
// -----------------------------------
oBit[1]:SetColor(,oIni:nClrForeHead)
obit[2]:SetColor(,oIni:nClrBackHead)
obit[3]:SetColor(,oIni:nClrFore)
obit[4]:SetColor(,oInioi:nClrBack)
obit[5]:SetColor(,oIni:nClrForeFocus)
obit[6]:SetColor(,oIni:nClrNFFore)
obit[7]:SetColor(,oIni:nClrBackFocus)
obit[8]:SetColor(,oIni:nClrNFBack)
obit[9]:SetColor(,oIni:nClrFFore)
obit[10]:SetColor(,oIni:nClrFBack)
obit[11]:SetColor(,oIni:Col1Interl)
obit[12]:SetColor(,oIni:Col2Interl)
obit[13]:SetColor(,oIni:nClrLine)
oBit[15]:SetColor(,oInioIni:cGotFocus)
oBit[16]:SetColor(,oIni:cLostFocus)
Return NIL
// ----------------------------- //
FUNCTION GetSysFont()
// ----------------------------- //
RETURN "Ms Sans Serif"
//--------------------------------------------------------------------------//
FUNCTION BarraINI(oWnd,oLbx1,oBit)
Local oBar
Local oBot:=Array(3)
DEFINE BUTTONBAR oBar 3D SIZE 26, 27 OF oWnd
DEFINE BUTTON oBot[1] RESOURCE "Abrir" OF oBar NOBORDER;
TOOLTIP "Abrir Ini" ; // ** OJO **
ACTION (Open_Save(1,oLbx1,oBit),oWnd:Update()) // No se Olvide colocar a todos los controles UPDATE
// Para que Funcione el oWnd:Update()
DEFINE BUTTON oBot[2] RESOURCE "Save" OF oBar NOBORDER;
TOOLTIP "Guardar ini" ;
ACTION (Open_Save(2,oLbx1,oBit),oWnd:Update())
DEFINE BUTTON oBot[3] RESOURCE "Exit2" OF oBar GROUP NOBORDER;
TOOLTIP "Salir" ;
ACTION OWnd:End()
oBar:bRClicked := {|| NIL }
oBar:bLClicked := {|| NIL }
RETURN oBar
Best Regards, Saludos
Falconi Silvio