Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #load "LWCs.fsx"
  2. #load "IumButton.fsx"
  3.  
  4. open System.Windows.Forms
  5. open System.Drawing
  6. open LWCs
  7. open IumButton
  8.  
  9. let f = new Form(Text="Editor PI",TopMost=true, Size=Size(980,600))
  10. f.Show()
  11.  
  12. type NavBut=
  13. | Load = 0
  14. | Save = 1
  15.  
  16. type NavBut2 =
  17. | Up = 0
  18. | Down = 1
  19. | Left = 2
  20. | Right = 3
  21. | RotateL = 4
  22. | RotateR = 5
  23. | ZoomUp = 6
  24. | ZoomDown = 7
  25. let mutable erase = false
  26.  
  27. type MyImage() as this =
  28. inherit LWC()
  29.  
  30. let mutable tasto = new NavBut()
  31. let mutable disegna = true
  32. let transformP (m:Drawing2D.Matrix) (p:PointF) =
  33. let a = [| PointF(single p.X, single p.Y) |]
  34. m.TransformPoints(a)
  35. a.[0]
  36.  
  37. member this.Tasto
  38. with get() = tasto
  39. and set(v) = tasto <- v
  40. member this.Disegna
  41. with get() = disegna
  42. and set(v) = disegna <- v
  43.  
  44. override this.OnMouseDown e =
  45. printfn "erase : %A" disegna
  46. if(erase) then
  47. disegna <- false
  48. //qui ci sara il selezionamento
  49.  
  50. base.OnMouseDown(e)
  51.  
  52.  
  53. type mysimulator() as this =
  54. inherit LWContainer()
  55.  
  56. let buttonsv = [
  57. new IumButton(Text="Load", Location=Pointf(0.f,single(f.ClientSize.Height)-64.f));
  58. new IumButton(Text="Save", Location=Pointf(64.f,single(f.ClientSize.Height)-64.f));
  59. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement