B4J Question ABMCanvas - Text Wont Drag

codie01

Active Member
Licensed User
Longtime User
Good Day all,

I am having an issue with ABMCanvas where I create an a text based canvasObject on the canvas fine, but once created it wont drag.

The code for the canvas creation as follows:

Canvas Creation:
    Dim canvas1 As ABMCanvas
    canvas1.Initialize(page, "canvas1", ABM.COLOR_Grey, ABM.INTENSITY_LIGHTEN3,canvasWidth,canvasHeight, True)

I then use a button to add a text object as follows:

Single text object adds to canvas fine:
    Dim myContainer0 As ABMContainer = page.component("sectionCanvas0")
    Dim myCanvas1 As ABMCanvas =myContainer0.Component("canvas1")
    Dim text1 As ABMCanvasObject
    text1.beginPath
    text1.InitializeAsRectangle(page, "text1", 1,1,300,300, True)
    text1.font("Arial",22)
    text1.fillStyleColor("#000000")
    text1.fill
    text1.textBaseline(ABM.CANVAS_TEXTBASELINE_MIDDLE)
    text1.textAlign(ABM.CANVAS_TEXTALIGN_LEFT)
    text1.fillText2("MYLABEL",10,10,canvasWidth)
    text1.SetDragZone(1,1,600,1000)
    text1.shadowBlur(2.5)
    text1.closePath
    myCanvas1.AddObject(text1)
    myCanvas1.Refresh

I would expect that I could then move the text object around on the canvas with the mouse, but is does not.

Any helpful ideas would be appreciated.

Phil
 
Solution
Sorry All I have resolved the above issue. I made the rectangle the same size as the canvas, so it could not move on the canvas!

Was : text1.InitializeAsRectangle(page, "text1", 1,1,300,300, True)
Now: text1.InitializeAsRectangle(page, "text1", 1,1,12,100, True)

codie01

Active Member
Licensed User
Longtime User
Sorry All I have resolved the above issue. I made the rectangle the same size as the canvas, so it could not move on the canvas!

Was : text1.InitializeAsRectangle(page, "text1", 1,1,300,300, True)
Now: text1.InitializeAsRectangle(page, "text1", 1,1,12,100, True)
 
Upvote 0
Solution
Top