Xbrowse config

Xbrowse config

Postby Silvio » Fri Jan 12, 2007 12:38 am

How I can create a config of colums of xbrowse and save the state ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby ShumingWang » Sat Jan 13, 2007 4:00 am

FUNCTION SaveState(obrow,cid)
local cState
cState:=obrow:SaveState()
if oServer:QueryData("select id from browseset where id='"+cid+"'")<>cid
oServer:Query("insert into browseset (id,cvalue) values ('"+cid+"','"+cState+"')")
else
oServer:Query("update browseset set cvalue='"+cState+"' where id='"+cid+"'")
endif
return

FUNCTION RestoreState(obrow,cid)
local cState
cState:=oServer:QueryData("select cvalue from browseset where id='"+cid+"'")
obrow:RestoreState(cState)
return
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Silvio » Tue Jan 16, 2007 5:07 pm

How I can create a browse to set hight, width, colors od eah columns of xbrowse and save it ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby ShumingWang » Wed Jan 17, 2007 1:28 am

obrow := TXBrowse():New(odlg)

oBrow:nMarqueeStyle := 6
obrow:bskip:=obrow:bskipper
obrow:bClrStd := {||{CLR_BLACK,if(odb1:ordinqty-odb1:ordouqty-odb1:minqty+odb1:allqty<0,CLR_HRED,if(EVAL(obrow:bBookMark)%2==0,CLR_1,CLR_2))}}
obrow:nfreeze:=1
obrow:nColDividerStyle := LINESTYLE_GREEN
obrow:nRowDividerStyle := LINESTYLE_GREEN

oCol := obrow:AddCol()
oCol:cHeader := "Unit"
oCol:bStrData := {||odb1:unit}

obrow:CreateFromResource(201)

define button id 101 of odlg action savestate(obrow,"browseid1")

activate dialog odlg on init (restorestate(obrow,"browseid1")
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests

cron