-1

we have some Widget controls in a Delphi 2007 application. The widgets inherit from TWinControl. On the widget we call the TControl method ManualFloat to undock the widget.

The issue is that when MainFormOnTaskBar is true calling ManualFloat gives the widget StayOnTop like behavior causing it to float above all windows including other applications. This is an issue because if you open a modal dialog from a form then it appears behind the widget. When MainFormOnTaskBar is False then modal dialogs appear on top of the widgets.

Does anyone know how I can resolve this issue by not allowing the widgets to become topmost or at least shed some light on a possible solution/workaround? My guess is that the widget is getting parented to Application.MainForm.Handle and that is why I'm getting this behavior.

Thanks in advance.

There is no spoon
  • 1,775
  • 2
  • 22
  • 53
  • Why are you *guessing* about the parentage? What does the debugger tell you when you step through the code? If the debugger interferes with the behavior, what do you see when you throw some OutputDebugString calls in your code? How do we debug code we can't see? How do we reproduce the issue? – Ken White Nov 11 '16 at 02:19
  • **ManualFloat** is not (afaik) a property of any standard (i.e. "in the box) Delphi VCL controls. Nor are Delphi controls typically referred to as" widgets". I suspect that what you are describing is some 3rd party or custom control library and as such nobody is going to be able to help unless you at least tell us what control library (or controls) you are actually dealing with. – Deltics Nov 11 '16 at 06:08
  • Open DockEx sample. Add a toolbutton to the top toolbar. Add this code to its click handler: `DockWindows[0].ManualFloat(Rect(0, 0, 320, 240));` Run program. Click "White" button. Dock the white window. Press the button you added, the white window will "manual float". Observe it's not "StayOnTop". – Sertac Akyuz Nov 11 '16 at 17:36
  • It would be very nice if you could do a simple test and see if you can duplicate your problem yourself in a new project before posting the question. – Sertac Akyuz Nov 11 '16 at 17:37
  • @Deltics - [It's](http://docwiki.embarcadero.com/Libraries/en/Vcl.Controls.TControl.ManualFloat) part of the docking mechanism that the [IDE uses](http://docwiki.embarcadero.com/RADStudio/en/Docking_Tool_Windows). – Sertac Akyuz Nov 11 '16 at 17:44
  • @Sertac - Ah, right. Thanks for the clarification. – Deltics Nov 12 '16 at 03:43

1 Answers1

0

Did you try to force parent of your Widget as main form ?

MyWidget.manualFloat(screenpos);    
MyWidget.Parent := MyMainForm;
MyWidget.ParentWindow := MyMainForm.Handle;
MyWidget.left := left desired 
MyWidget.Top := Right.desired;