xBrowse - multiselect on cells

xBrowse - multiselect on cells

Postby Robert Frank » Sun Sep 14, 2008 5:40 pm

Is this possible to create browser (xBrowse) with cell multiselect like on picture below?

Image

I want to select few cells and highlight they (on left mouse click).
Highlited cells (active laboratory test for me) I want to send to another function to create "order list".

Any ideas, exaples?

Regards
Robert Frank
User avatar
Robert Frank
 
Posts: 95
Joined: Fri Nov 23, 2007 4:43 am
Location: Gdynia-Poland

Postby Robert Frank » Sun Sep 14, 2008 8:42 pm

I've found an answer

example source code below

arrays:
xTABTMP - array to show
xTMPCOLORS - array for define colors

--->part of code:


For XXX:=1 To Len(xTABTMP)
// array for cell colors
AADD(aTMPCOLORS,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})
Next


oBRWLLPOD := TXBrowse():New( oDLGLLPOD )
oBRWLLPOD :SetArray( xTABTMP, .T. ,12 )
oBRWLLPOD :aCols[ 1]:cHeader := "Nr"
oBRWLLPOD :aCols[ 1]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,1]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 1]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,1]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,1]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 1]:nWidth:=100

oBRWLLPOD :aCols[ 2]:cHeader := "Nazwisko"
oBRWLLPOD :aCols[ 2]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,2]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 2]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,2]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,2]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 2]:nWidth:=100

oBRWLLPOD :aCols[ 3]:cHeader := "Imie"
oBRWLLPOD :aCols[ 3]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,3]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 3]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,3]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,3]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 3]:nWidth:=100

oBRWLLPOD :aCols[ 4]:cHeader := "Numer"
oBRWLLPOD :aCols[ 4]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,4]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 4]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,4]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,4]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 4]:nWidth:=100

oBRWLLPOD :aCols[ 5]:cHeader := "Info1"
oBRWLLPOD :aCols[ 5]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,5]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 5]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,5]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,5]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 5]:nWidth:=100

oBRWLLPOD :aCols[ 6]:cHeader := "Info2"
oBRWLLPOD :aCols[ 6]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,6]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 6]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,6]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,6]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 6]:nWidth:=100

oBRWLLPOD :aCols[ 7]:cHeader := "Info3"
oBRWLLPOD :aCols[ 7]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,7]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 7]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,7]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,7]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 7]:nWidth:=100

oBRWLLPOD :aCols[ 8]:cHeader := "Info4"
oBRWLLPOD :aCols[ 8]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,8]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 8]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,8]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,8]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 8]:nWidth:=100

oBRWLLPOD :aCols[ 9]:cHeader := "Info5"
oBRWLLPOD :aCols[ 9]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,9]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 9]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,9]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,9]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[ 9]:nWidth:=100

oBRWLLPOD :aCols[10]:cHeader := "Maski"
oBRWLLPOD :aCols[10]:bClrStd := {|| { nRGB(0,0,200),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,10]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[10]:bClrSelFocus := {|| { IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,10]=0, nRGB(0,0,200),nRGB(0,0,0) ),IIF( aTMPCOLORS[oBRWLLPOD:nArrayAT,10]=0, nRGB(200,200,200),nRGB(0,200,0) ) } }
oBRWLLPOD :aCols[10]:nWidth:=100

oBRWLLPOD :nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBRWLLPOD :nColDividerStyle := LINESTYLE_DARKGRAY
oBRWLLPOD :nRowDividerStyle := LINESTYLE_DARKGRAY
oBRWLLPOD :nHeaderHeight :=50
oBRWLLPOD :nRowHeight :=50

// THIS CODE MAKES CELL HIGHLITED
oBRWLLPOD :bLClicked:={ | nRow, nCol | IIF(aTMPCOLORS[oBRWLLPOD:nArrayAT,oBRWLLPOD:nColSel]=0,aTMPCOLORS[oBRWLLPOD:nArrayAT,oBRWLLPOD:nColSel]:=1,aTMPCOLORS[oBRWLLPOD:nArrayAT,oBRWLLPOD:nColSel]:=0),oBRWLLPOD:Refresh() }

oBRWLLPOD :CreateFromCode()
oBRWLLPOD:bKeyDown:={|nKEY| JAKILLPODKEY(nKEY,@xNR_L) }
oBRWLLPOD :nTop = 22
oBRWLLPOD :nLeft = 0
//oBRWLLPOD :nWidth =900
//oBRWLLPOD :nHeight =700

--->end of code

result:
Image
Robert Frank
User avatar
Robert Frank
 
Posts: 95
Joined: Fri Nov 23, 2007 4:43 am
Location: Gdynia-Poland


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests