hat jemand mit XbpCellGroup() Erfahrung ? Ich will mir damit eine eigene
Class myColume schreiben um damit Bitmaps per Array zu browsen.
Code: Alles auswählen
#define BORDERSIZE 3
CLASS XbpBitmapColumn FROM XbpColumn
INLINE METHOD create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::dataArea:= XbpBitmapCellGroup():new( self, self )
RETURN ::XbpColumn:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
CLASS XbpBitmapCellGroup FROM XbpCellGroup
INLINE METHOD create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::XbpCellGroup:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
::ClipChildren := .T.
RETURN self
INLNE METHOD XbpMemoBitmapCellGroup:creaBmps( nPosStart, nPosEnd )
LOCAL aPos
LOCAL aSize
LOCAL nCont
LOCAL myPos
LOCAL mySize := {48,32}
aPos := ::cellRect( nPosStart, [lInnerRect] )
aSize := { aPos[ 3 ] - aPos[ 1 ], aPos[ 4 ] - aPos[ 2 ] }
myPos := { aPos[1]-(BORDERSIZE) , aPos[2]+(BORDERSIZE) ,;
aPos[3]+(BORDERSIZE*2), aPos[4]+(BORDERSIZE*2) }
FOR nCont:= nPosStart TO nPosEnd
* ::aoBmps[ nCont ] := XbpMemoBitmapStatic():new( self,, ::cellRect( nCont, [lInnerRect] ), aSize )
::aoBmps[ nCont ] := XbpMemoBitmapStatic():new( self,, myPos, mySize )
::aoBmps[ nCont ]:create()
NEXT
RETURN self
CLASS XbpBitmapStatic FROM XbpStatic
INLINE METHOD create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::XbpStatic:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
::ClipParent := .T.
::type := XBPSTATIC_TYPE_BITMAP
RETURN self
ist nun das dass Bitmap, im XbpBitmapStatic(), von der Grösse nicht der
des XbpBitmapCellGroup() entspricht ?
Dazu hab ich mich ::cellRect() bedient welches mir mit .T. die "innen"-
und mit .F. die "aussen"-abmessung geben sollte (Differenz = 1+1+1 ? )
Code: Alles auswählen
oColumn := oBrowse:getColumn(oBrowse:colPos)
aRect := oColumn:dataArea:cellRect( oBrowse:rowPos,[lInnerRect] )
...
aRect := ::cellRect( nPosStart, .F. )
->
aRect = {0,-6,48,32} // erste
aRect = {0,137,48,175} // letzte
aRect := ::cellRect( nPosStart, .T. )
->
aRect = {3,-3,45,29}
aRect = {0,140,45,172}
wenn ich nun die Size aus aRect berechne
Code: Alles auswählen
aSize := {aRect[3]-aRect[1], aRect[4]-aRect[2]}
Code: Alles auswählen
cellRect( nPosStart, .F. ) -> {48-0, 32 - -6} -> {48,38}
{48-0, 175-137} -> {48,38}
cellRect( nPosStart, .T. ) -> {45-3, 29 - -3} -> {42,32}
{45-0,172-140} -> {45,32} ?!
also wie bekomme ich die "0,0" Koordinaten für mein XbpBitmapStatic()
und wie setzte ich ::ClipChildren bzw. ::ClipParent "richtig" damit ich
eine "voll gefüllte" XbpBitmapCellGroup() von {48x32} bekomme ?
gruss by OHR
Jimmy