[Gambas-user] How to create a new drawing area

Fiddler63 mx4eva at ...626...
Tue Feb 2 09:24:03 CET 2010


I have a button which, when clicked created a new drawing area.
The following code does that fine (and I can move it with the mouse).

PRIVATE LCD_01 AS NEW Picture
PRIVATE LCD_02 AS NEW Picture

PUBLIC SUB NewLCD_Btn_Click()
 
 LCD_01 = Picture.Load("Pix_C.png")
 LCD_02 = Picture.Load("Pix_A.png")
 DrawingArea2.X = 500                       
 DrawingArea2.Y = 300
 
 DrawingArea2.Border = 2
 DrawingArea2.Resize(LCD_01.Width * 10, LCD_01.Height * 2)
END

PUBLIC SUB DrawingArea2_Draw()
 Draw.Picture(LCD_01, 5, 5)
 Draw.Picture(LCD_02, 43, 5)
END

PUBLIC SUB DrawingArea2_MouseMove()
 DrawingArea2.X += Mouse.X - Mouse.StartX
 DrawingArea2.Y += Mouse.Y - Mouse.StartY
END
'***************************************************

However when I click on the button, I get the same area drawn again
(actually the already drawn area moves back to the origin x,y co-ordinates)
I would like to create a new drawing area each time I click the button, i.e.
if I click the button 10 times, I get 10 new drawing areas.
Also I would like to be able to delete each drawing area as well.

Any suggestions how I could do this 

Ta
kim
-- 
View this message in context: http://old.nabble.com/How-to-create-a-new-drawing-area-tp27416835p27416835.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list