FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Share add on xbrowse setmysql(),ntotal(),auto mutilines
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Share add on xbrowse setmysql(),ntotal(),auto mutilines
Posted: Mon Dec 03, 2007 01:51 AM
1.
METHOD SetMySQL(oquery) CLASS TXBrowse

DEFAULT ::bGoTop := {|| oQuery: GoTop() },;
::bGoBottom := {|| oQuery: GoBottom() },;
::bSkip := {| n |oQuery: SKIP( n ) },;
::bSkipper := {| n |oQuery: SKIPPER( n ) },; // not reach eof() +1
::bBof := {|| oQuery: Bof() },;
::bEof := {|| oQuery: Eof() },;
::bBookMark := {| n | if( n == nil, oQuery:RecNo(),oQuery:Goto( n ))},;
::bKeyNo := ::bBookMark,;
::bKeyCount := {|| oQuery:LastRec() },;
::=oQuery

return nil

http://www.xtech.com.cn/down/tmysql.prg

2 .
Method nTotal() class TXbrowse
local i,i2,i1

::=.t.
if len(::acols)>1; ::acols[1]:="Total"; end

for i:=2 to len(::acols)
if len(::acols[i]:cfooter)>=1
::acols[i]:=" "
end
next
eval(::bgotop)
while !eval(::bEof)
if len(::aSelected)>0.and.aScan(::aSelected,(Eval(::bKeyNo)))==0; Eval(::bSkip); loop; end
for i2:=2 to len(::acols)
if len(::acols[i2]:cfooter)>=1
::acols[i2]:=cvaltochar(val(::acols[i2]:cfooter)+val(cvaltochar(eval(::acols[i2]:bStrData))))
end
next i2
eval(::bSkip)
end


::adjust()
::GoTop()
::Refresh()
Return Nil


3. Auto multi lines data
METHOD PaintData( nRow, nCol, nHeight, lHighLite, lSelected, nOrder ) CLASS TXBrwColumn


...

SetBkColor( hDC, aColors[ 2 ] )

// add the line
::nDataStyle := ::DefStyle( ::nDataStrAlign, (::dataheight()/::DataHeight()<2 ) )


DrawTextEx( hDC, cData,;
...

:-)

Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Share add on xbrowse setmysql(),ntotal(),auto mutilines
Posted: Mon Dec 03, 2007 02:11 AM

Hi ShumingWang,

Thanks for your code.

Regards,

Richard

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion