area.inc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. Function ptc_area_create(left, top, right, bottom : Integer) : TPTC_AREA;
  2. Begin
  3. Try
  4. ptc_area_create := TPTC_AREA(TPTCArea.Create(left, top, right, bottom));
  5. Except
  6. On error : TPTCError Do
  7. Begin
  8. ptc_exception_handle(error);
  9. ptc_area_create := Nil;
  10. End;
  11. End;
  12. End;
  13. Procedure ptc_area_destroy(obj : TPTC_AREA);
  14. Begin
  15. If obj = Nil Then
  16. Exit;
  17. Try
  18. TPTCArea(obj).Destroy;
  19. Except
  20. On error : TPTCError Do
  21. Begin
  22. ptc_exception_handle(error);
  23. End;
  24. End;
  25. End;
  26. Function ptc_area_left(obj : TPTC_AREA) : Integer;
  27. Begin
  28. Try
  29. ptc_area_left := TPTCArea(obj).left;
  30. Except
  31. On error : TPTCError Do
  32. Begin
  33. ptc_exception_handle(error);
  34. ptc_area_left := 0;
  35. End;
  36. End;
  37. End;
  38. Function ptc_area_top(obj : TPTC_AREA) : Integer;
  39. Begin
  40. Try
  41. ptc_area_top := TPTCArea(obj).top;
  42. Except
  43. On error : TPTCError Do
  44. Begin
  45. ptc_exception_handle(error);
  46. ptc_area_top := 0;
  47. End;
  48. End;
  49. End;
  50. Function ptc_area_right(obj : TPTC_AREA) : Integer;
  51. Begin
  52. Try
  53. ptc_area_right := TPTCArea(obj).right;
  54. Except
  55. On error : TPTCError Do
  56. Begin
  57. ptc_exception_handle(error);
  58. ptc_area_right := 0;
  59. End;
  60. End;
  61. End;
  62. Function ptc_area_bottom(obj : TPTC_AREA) : Integer;
  63. Begin
  64. Try
  65. ptc_area_bottom := TPTCArea(obj).bottom;
  66. Except
  67. On error : TPTCError Do
  68. Begin
  69. ptc_exception_handle(error);
  70. ptc_area_bottom := 0;
  71. End;
  72. End;
  73. End;
  74. Function ptc_area_width(obj : TPTC_AREA) : Integer;
  75. Begin
  76. Try
  77. ptc_area_width := TPTCArea(obj).width;
  78. Except
  79. On error : TPTCError Do
  80. Begin
  81. ptc_exception_handle(error);
  82. ptc_area_width := 0;
  83. End;
  84. End;
  85. End;
  86. Function ptc_area_height(obj : TPTC_AREA) : Integer;
  87. Begin
  88. Try
  89. ptc_area_height := TPTCArea(obj).height;
  90. Except
  91. On error : TPTCError Do
  92. Begin
  93. ptc_exception_handle(error);
  94. ptc_area_height := 0;
  95. End;
  96. End;
  97. End;
  98. Procedure ptc_area_assign(obj, area : TPTC_AREA);
  99. Begin
  100. Try
  101. TPTCArea(obj).ASSign(TPTCArea(area));
  102. Except
  103. On error : TPTCError Do
  104. Begin
  105. ptc_exception_handle(error);
  106. End;
  107. End;
  108. End;
  109. Function ptc_area_equals(obj, area : TPTC_AREA) : Boolean;
  110. Begin
  111. Try
  112. ptc_area_equals := TPTCArea(obj).Equals(TPTCArea(area));
  113. Except
  114. On error : TPTCError Do
  115. Begin
  116. ptc_exception_handle(error);
  117. ptc_area_equals := False;
  118. End;
  119. End;
  120. End;