xBrowse Database fields

xBrowse Database fields

Postby Ehab Samir Aziz » Fri Nov 02, 2007 5:42 pm

What method to be used to choose certain fields in certain order to browse using xbrowse.
Code: Select all  Expand view  RUN
method browser()

   local oDlg,oBrw,oMeter,oFont,oCol,nFor,oChild

   ::setOrder(2)
   ::gotop()


   define font oFont name "Ms Sans Serif" size 0,-14 BOLD

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "meter reads browse "

   oBrw := TXBrowse():New( oDlg )
   oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   oBrw:nColDividerStyle    := LINESTYLE_BLACK
   oBrw:nRowDividerStyle    := LINESTYLE_BLACK
   oBrw:lColDividerComplete := .t.
   oBrw:nHeaderLines        := 1
   oBrw:nFooterLines        := 1
   oBrw:nDataLines          := 1
   oBrw:lFooter             := .t.
   oBrw:CreateFromCode()
   oBrw:nTop = 0
   oBrw:nLeft = 0
   oBrw:nWidth = 1000
   oBrw:nHeight =600
   oBrw:SetRDD()
   


      for nFor := 1 to ::Fcount()
         oBrw:aCols[ nFor ]:oDataFont := oFont
      next
   
   // Setup for using database class
   oBrw:cAlias:= ::cAlias
   oBrw:bSkip:= {|nRecs| ::skipper( nRecs ) }
   oBrw:bGotop:= {|| ::gotop() }
   oBrw:bGoBottom:= {|| ::goBottom() }
   oBrw:bBookMark := {| n | iif( n == nil, ::RecNo() , ::Goto( n ) ) }
   

oMeter:= self

ACTIVATE DIALOG oDlg ON INIT (oBrw:SetSize( 1000, 600 ), BuildButtons( oMeter,oBrw,oDlg),oBrw:Refresh(.t.), oDlg:Refresh(.t.))






RETURN nil
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Otto » Fri Nov 02, 2007 6:35 pm

Hello Ehab,
maybe this can help you.

http://fivetechsoft.com/forums/viewtopic.php?t=8684
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Ehab Samir Aziz » Sat Nov 03, 2007 10:43 am

No I mean to force fields from a database using code and fix (always) browse .
Thanks
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Otto » Sat Nov 03, 2007 12:43 pm

I don’t know if I understand you well.

Do you mean you want selected fields of a dbf file not all and these in a certain order.

Then you have to use not:
oBrw:SetRDD()
for nFor := 1 to ::Fcount()
oBrw:aCols[ nFor ]:oDataFont := oFont
next

but for every field you want something like this:

oBrw:nRowHeight := 18
// 2
oCol := oBrw:AddCol()
oCol:cHeader := "LAST"
oCol:bStrData := { || _FIELD->LAST}
oCol:nWidth := 146
// 1
oCol := oBrw:AddCol()
oCol:cHeader := "FIRST"
oCol:bStrData := { || _FIELD->FIRST}
oCol:nWidth := 146
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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