Get and xBrowse

Get and xBrowse

Postby Romano » Tue Feb 01, 2011 6:55 pm

Hi All,
I need add, or simply modify, the Gets created by an DBF with xBrowse.
I have succeeded in creating the Gets, but I don't succeed in modifying them. I succeed in modifying the names in xBrowse, but not to transfer the change to the Gets, this it happens only after having gone out and reentered in the program.
I in advance thank for the help.
Regards
G. Romano

#Include "Fivewin.ch"
#Include "xBrowse.ch"
*-----------------*
Function Main()
*-----------------*
LOCAL oDlg, oBrw, oCol, cAlias, oBmp , oFont
Local nI := 0 //1
local oGet:= ARRAY(28)
dbUseArea( .t.,, "Campo.Dbf",, .f.)
Campo->( dbSetOrder(2) ) //--> Cognome
cAlias := Alias()
dbSelectArea(cAlias)

for nI := 1 to Len(oGet) //Reccount() //Len(cAlias) //28 posti
oGet[nI]:= (cAlias)->(FieldGet(2)) //Campo->(FieldGet(2) )
skip
next
(cAlias)->( dbGoTop() )

DEFINE FONT oFont NAME "Arial" SIZE 0,-12 Bold
DEFINE DIALOG oDlg RESOURCE "DIALOGO" COLOR "N/W*"

// AggiornaGet(nI,oGet,oDlg)

oBrw := TXBrowse():New( oDlg )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:SetRDD()

for nI := 2 to len( oBrw:aCols ) // Editabile solo Colonna 2
oCol := oBrw:aCols[ nI ]
oCol:nEditType := 1
oCol:cEditPicture := "@!"
oCol:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, FieldPut( o:nCreationOrder, v ), ) }
next

oBrw:CreateFromResource(101)
oBrw:aCols[1]:cHeader:= "Boa"
oBrw:aCols[2]:cHeader:= "Cognome "
oBrw:aCols[1]:oHeaderFont:= oFont
oBrw:aCols[2]:oHeaderFont:= oFont
oBrw:lFastEdit := .T.
oBrw:bClrStd:= { || If(( oBrw:cAlias)->(OrdKeyNo()) % 2 == 0, ;
{ CLR_BLACK, RGB( 224, 236, 255 ) }, ;
{ CLR_BLACK, RGB( 189, 211, 253 ) } ) }

oBrw:nRecSelColor := CLR_WHITE //RGB(238,232,170) //(135,206,235) //(127,255,212)

// oBrw:lHScroll:= .f.
// oBrw:bChange:= {||oGet[nI]:=(cAlias)->Nome,oDlg:Refresh() } ?????

REDEFINE GET oGet[1] ID 102 OF oDlg UPDATE
REDEFINE GET oGet[2] ID 103 OF oDlg
REDEFINE GET oGet[3 ] ID 104 OF oDlg
REDEFINE GET oGet[4 ] ID 105 OF oDlg

REDEFINE GET oGet[5 ] ID 106 OF oDlg
REDEFINE GET oGet[6 ] ID 107 OF oDlg
REDEFINE GET oGet[7 ] ID 108 OF oDlg
REDEFINE GET oGet[8 ] ID 109 OF oDlg

REDEFINE GET oGet[9 ] ID 110 OF oDlg
REDEFINE GET oGet[10 ] ID 111 OF oDlg
REDEFINE GET oGet[11 ] ID 112 OF oDlg
REDEFINE GET oGet[12 ] ID 113 OF oDlg

REDEFINE GET oGet[13 ] ID 114 OF oDlg
REDEFINE GET oGet[14 ] ID 115 OF oDlg
REDEFINE GET oGet[15 ] ID 116 OF oDlg
REDEFINE GET oGet[16 ] ID 117 OF oDlg

REDEFINE GET oGet[17 ] ID 118 OF oDlg
REDEFINE GET oGet[18 ] ID 119 OF oDlg
REDEFINE GET oGet[19 ] ID 120 OF oDlg
REDEFINE GET oGet[20 ] ID 121 OF oDlg

REDEFINE GET oGet[21 ] ID 122 OF oDlg
REDEFINE GET oGet[22 ] ID 123 OF oDlg
REDEFINE GET oGet[23 ] ID 124 OF oDlg
REDEFINE GET oGet[24 ] ID 125 OF oDlg

REDEFINE GET oGet[25 ] ID 126 OF oDlg
REDEFINE GET oGet[26 ] ID 127 OF oDlg
REDEFINE GET oGet[27 ] ID 128 OF oDlg
REDEFINE GET oGet[28] ID 129 OF oDlg

REDEFINE BITMAP oBmp RESOURCE "BOA" ID 1 OF oDlg
ACTIVATE DIALOG oDlg ON INIT oBrw:SetFocus()
Campo->(DbCloseArea() )
RETURN NIL

/*
static function AggiornaGet(nI,oGet,oDlg) // ????????

for nI := 1 to Len(oGet) //Reccount()
oGet[nI]:= CAMPO->(FieldGet(2))
skip
next

Campo->( dbGoTop() )

// oDlg:Refresh()

Return Nil
*----------------------------------------------------

*/
Romano
 
Posts: 19
Joined: Thu Oct 01, 2009 7:15 am

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests