I would like to to fill a window painted by XPBMENU() with an image in the background
and in a DCSTATIC window too.
Merry Christmas to alle Users


you can´t modify normal XbpMenu() while "painting" is done by OS()obelix wrote:I would like to to fill a window painted by XPBMENU() with an image in the background
and in a DCSTATIC window too.
use Source from C:\ALASKA\XPPW32\Source\samples\basics\OWNERDRWobelix wrote:It just like the example, Jimmy demonstrated.
Code: Select all
oMbar := oDlg:menuBar()
oMbar:measureItem := {|nItem,aDims,self| MeasureMenubarItem(oDlg,self,nItem,aDims) }
oMbar:drawItem := {|oPS,aInfo,self | DrawMenubarItem(oDlg,self,oPS,aInfo) }
Code: Select all
PROCEDURE AppMenu( oMain )
LOCAL oMenuBar := oMain:menuBar()
LOCAL oLogo := XbpBitmap():new():create()
oLogo:load(,201)
oMenuBar:measureItem := {|nItem,aDims,oSelf| MeasureMenubarItem(oMain,oSelf,nItem,aDims) }
oMenuBar:drawItem := {|oPS,aInfo,oSelf | DrawMenubarItem(oMain,oSelf,oPS,aInfo,oLogo) }
Code: Select all
CLASS MyMenu FROM XbpMenu
...
FUNCTION DrawMenubarItem( oDlg, oMbar, oPS, aInfo, oLogo ) // add oLogo
...
LOCAL nMax := oMbar:numItems()
LOCAL nGraWide := oPS:SetPageSize()[1][1]
IF BAND( aInfo[ 2 ], XBP_DRAWACTION_DRAWALL ) != 0 .AND. aInfo[ 1 ] = nMax
oLogo:draw( oPS, { aInfo[4][3], aInfo[4][2], nGraWide, aInfo[4][4] },,,GRA_BLT_BBO_IGNORE )
ENDIF