FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour erase an object
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
erase an object
Posted: Fri Dec 11, 2009 06:17 PM

I insert a bitmap on window with drag
How I can erase this object ?

Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: erase an object
Posted: Fri Dec 11, 2009 06:55 PM

Maybe oBmp:hide()

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: erase an object
Posted: Fri Dec 11, 2009 10:58 PM

Silvio,

To destroy it use:

oBmp:End()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: erase an object
Posted: Sun Dec 13, 2009 10:46 AM

not run

Best Regards, Saludos



Falconi Silvio
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: erase an object
Posted: Sun Dec 13, 2009 01:09 PM

Silvio,

That code works fine since years :-)

Please provide a self contained example that shows your point, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: erase an object
Posted: Sun Dec 13, 2009 01:42 PM
@ nRow, nCol BITMAP oSprite;
RESOURCE cBitmap;
PIXEL NOBORDER of oWnd // SIZE 64,64

nTipo:=nItem

oSprite:lTransparent = .T. // NOT RUN

//TO MOVE


oSprite:Move(oSprite:nTop,;
oSprite:nLeft,;
,;
)
oSprite:HideDots() //not run !! I want no show the dots when I capture the object with the mouse

oSprite:lDrag := .T.

oSprite:bMoved := {|| oSprite:CoorsUpdate() ,;
nBmpRow := oSprite:nTop ,;
nBmpCol := oSprite:nLeft ;
}

oSprite:cargo := {cBitmap,nTipo } // ASSIGN THE CARGO FOR EACH SPRITE

oSprite:bRClicked = { | nRow, nCol | menu_action( oSprite, nRow, nCol ) }
oSprite:SetFocus()



return nil








function menu_action( oSprite, nRow, nCol )

local oMenu

MENU oMenu POPUP 2007
MENUITEM "&Cancel object" action delImg( oSprite,oWnd)
MENUITEM "&Text.." action msginfo(text)
ENDMENU

ACTIVATE MENU oMenu AT nRow, nCol OF oSprite

return nil





Function delImg(oSprite,oWnd)
if MsgYesNo( "Delete this symbol ?" )
oSprite:End()
ENDIF
oWnd:refresh()
return NIL
Best Regards, Saludos



Falconi Silvio

Continue the discussion