title: dynamically create popup menu tree from sql server table in Delphi
body: <p>I have a table like this:</p>
  
  <pre><code>id     parent_id     name
  1          1         Root
  2          1         Car
  3          1         Plane
  4          2         BMW
  5          4         CLK
  </code></pre>
  
  <p>How can I dynamically create popup menu with all subitems in Delphi?</p>
  
  <p>This is how it should look like:</p>
  
  <p><a href="https://i.stack.imgur.com/WyWIT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WyWIT.jpg" alt="image"></a>
  </p>