Author Topic: Docking / Undocking forms  (Read 6365 times)

slickMark

  • Community Member
  • Posts: 11
  • Hero Points: 0
Docking / Undocking forms
« on: December 05, 2006, 02:58:56 PM »
Hi,

I have developed a form that has some controls on it including a Tab Control. The tab control is initialized with one tab. During the use of the form the number of tabs may increase. If I dock the form
it seems that the control is destroyed and the number of tabs goes back to one. The same occurs when
I undock the form.

I noticed that the on_destroy() also gets called when docking / undocking the form. I display the form
by doing the following:
   show('-mdi -xy -hideondel LidTool');

I've tried the "-hideondel" and the "-reinit" (I'm running on SunOS) and they seem to make
no difference.

Is there any way to change this behaviour? Am I missing something here?


Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Docking / Undocking forms
« Reply #1 on: December 10, 2006, 09:52:55 AM »
Hi,

I have developed a form that has some controls on it including a Tab Control. The tab control is initialized with one tab. During the use of the form the number of tabs may increase. If I dock the form
it seems that the control is destroyed and the number of tabs goes back to one. The same occurs when
I undock the form.

I noticed that the on_destroy() also gets called when docking / undocking the form. I display the form
by doing the following:
   show('-mdi -xy -hideondel LidTool');

I've tried the "-hideondel" and the "-reinit" (I'm running on SunOS) and they seem to make
no difference.


Hi slickMark

I guess the problem is that the ownership of the form is changing when it is docked because it has to live in a containing window, whereas when it's undocked it's probably a top level window with no parent.  Windows and X11 (I think) have a SetParent function that allows to change the parent - I don't know if you can change from a top level window to a child window, or maybe this doesn't work on all platforms.  I got the impression from looking in slick toolbar code that the ownership of the form might also be changing when the form pops up from being auto-hidden so I'm wondering if your form will also get reconstructed every time its auto-shown.

Anyway, I guess you found a work-around by now.  I wonder what other IDEs do when windows are docked and undocked.

Graeme