Pick.dpr 705 B

12345678910111213141516171819202122232425
  1. {: Basic interactive object picking
  2. This is a bare bones sample on the use of the GetPickedObject function.
  3. Two events are handled : OnMouseMove triggers a color change (grey/red) when
  4. the mouse is moved over an object, and a message popups when an object is
  5. clicked in OnMouseDown.
  6. In a real world proggie, both events should make use of the oldPick variable
  7. (since you can't click what is not under the mouse, the GetPickedObject in
  8. OnMouseDown returns what we already have in oldPick, set during the last
  9. OnMouseMove).
  10. }
  11. program Pick;
  12. uses
  13. Forms,
  14. fPick in 'fPick.pas' {Form1};
  15. {$R *.RES}
  16. begin
  17. Application.Initialize;
  18. Application.CreateForm(TForm1, Form1);
  19. Application.Run;
  20. end.