Results 1 to 4 of 4

Thread: How can I fix this?

  1. #1

    How can I fix this?

    Hi again
    I'm writing a Delphi VCL component (decendant of TCustomControl) that loads and displays X-Files and MD2-Files and i have a small problem.
    It works fine, if i drop it directly on the form. So for example if the Left and Top coords of my TMeshViewer component are 100 and 200, the scene will be drawn at X: 100 and Y: 200.
    However, If i put my component into, let's say a TPanel, the scene is drawn at X: 0 and Y: 0.
    I'm sure there is a way to fix that, but how?

    Thanks in advance
    Harry Hunt
    Ask me about the xcess game development kit

  2. #2

    How can I fix this?

    Greetz... since TPanel becomes owner of your component, the coordinates it have are relative to TPanel. One possible solution would be looping through Object owners and re-calculating the object position. For instance, RenderY:= Top + Owner.Top.

    Hope this helps,
    Lifepower

  3. #3

    How can I fix this?

    Would the Parent property of TControl not be more suitable than the Owner?
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  4. #4

    How can I fix this?

    Thanks for your help. I found a different way to fix it which works fine.
    Ask me about the xcess game development kit

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •