Does it mean, if a Panel is deleted, all the elements related with that will be removed?
Sure
Final question: all the allocated memory will be released?
I am not ...sure.
For example, if a button has an image, the allocated memory of the image will be also released automatically?
No,..this depend on your Pointer.
Panel.bmap = bmap_create(...); -> This Image will be removed if the panel is deleted
----
BMAP* bmp = bmap_create(...);
Panel.bmap = bmp; -> This Image will not be removed if the panel is deleted (if global )