1
votes

How to dock opened windows in Delphi 7 IDE? The IDE opens with the top toolbar only and the rest of the screen showing the app behind the IDE. I have two monitors and the windows can float on top of any other window and if I have two instances open, I don't know what window belongs to what instance and it's annoying. I would like all the windows to be contained inside the IDE and be docked like Visual Studio does. I read about pressing ctrl-key while dragging. I don't see any difference, with or without checking the "Auto drag docking" setting. Either it doesn't work or I don't know how to use the feature.

Sometimes when I maximize a window, instead of maximizing inside the IDE, it maximizes on the whole screen.

2
AFAIK, Delphi 7 did not have a docked IDE, nor such a setting. Where did you find the "Auto drag docking" setting? - Tom Brunberg
Tools => Environment Options => Preferences tab - Tony_Henrich
Wow indeed, but not complete. I could dock the Object Inspector and Object TreeView to the code editor, but not to the main window (the one with the menu bar). Also the code editor and designer don't seem to dock anywhere. Sorry, can not be of more help here. - Tom Brunberg
I don't recall Delphi 7 being dockable either. However I also don't recall any issue where the windows of one instance cover windows of another. If one instance is activated, all its windows should come to the front. Quick fix: Don't drag windows around. Put them where you want them, save them that way, and stick with it. - Jerry Dodge
@TomBrunberg: I was about to say the same thing. The fully dockable IDE (codenamed Galileo) that we see today was first introduced in C#Builder 1.0, then Delphi.NET was added to it in Delphi 8 for .NET, and then Delphi Win32 was added to it in Delphi 2005. The IDE that predated Galileo (and ended with Delphi 7) had minimal docking support. - Remy Lebeau

2 Answers

3
votes

You can't. The docked form designer wasn't introduced in Delphi until D2005 (and when it was, people complained about losing the floating designer from earlier versions, so they added it back in as an optional configuration).

In D7 and earlier, the main window for the IDE consisted of what is basically the menu and toolbar, along with the embedded component palette. The Object Inspector and Form Designer were entirely separate windows, as were most of the other available windows at the time.

In order to get the Visual Studio-style appearance and docking window support, you'll need to upgrade to at least D2005.

3
votes

In Delphi 7 there are 3 main window groups in the IDE:

  • IDE Tools and Component Palette
  • Form Designers
  • Everything Else (including the Code Editor)

The IDE Tools and Components window (the main IDE window that extends across the top of your screen in the default configuration). Exists in splendid isolation. Nothing can dock to it and it will not dock with anything else.

The Form Designers too exist in isolation. There was some logic in this arrangement since the position of the form on the screen could form part of the "design" of the form itself. By making the Form Design surface a free-floating window then the position of that window became a design property that was directly and visually manipulated.

Good application design however doesn't rely on such absolute and precise positioning of forms, and in multiple monitor situations in particular can lead to problems of it's own so this approach has gradually become less relevant and so the embedded form design approach more appropriate.

Ironically however, the 100% embedded approach means that you can no longer so easily work on your form designs on one monitor while having the code visible on a second (at least not without stretching your entire monolithically embedded IDE across both).

Dockable vs Monolithic

The idea that the Delphi 7 idea was not dockable is very far removed from the truth. When people say this what they really mean is that it had a floating form designer and was not a monolithic block of docked windows. Rather it took a more flexible approach.

Apart from the IDE Tools window and the Form Designers, all the remaining windows however can and could all be docked in more or less any combination you wished, though sometimes achieving precisely the layout you wished was difficult due to the way that the IDE handled the drag-and-dock interface, which could lead to many frustrated attempts to get things just how you wanted them.

Sometimes it can help to turn OFF the auto-dock feature.

With Auto Dock on (the default iirc) when you drag a window near to a place where it can be docked, you get a focus rectangle appear showing where the window will dock if released (dropped) at that point. If you do not wish to dock the window and only wish to move it, you can hold the ctrl key down to suppress the docking behaviour.

With Auto Dock turned OFF, this behaviour is reversed. That is, moving windows around is always just that - moving windows. If you wish to drag and dock and window, holding down the ctrl key whilst dragging will give you the preview rectangles and dock-when-dropped behaviour.

Multiple Layouts

Once you had your windows arranged how you wished however, you can then save that arrangement and give that layout a label. Different layouts could not only vary the layout but also the windows involved.

It was quite common to have a "Code" layout, with Messages View, Project Manager etc all docked to the Code Editor as these are useful for working with code and the Object Inspector docked with the Structure View (for example) as these are useful when working with the Form Designers.

Then in a separate layout, typically called "Debug", these windows are less relevant and would be hidden (i.e. not visible) and instead you would have the Stack Window, Local Variables, Watch Variables and Output Window, all docked with the Code Editor.

Here's how I have my Delphi 7 IDE layout configured, for example:

enter image description here

Note that the code editor appears cramped in this screen shot as I shrank things down to minimise the image size for posting to StackOverflow. On my Mac this layout fills my 2560x1440 display nicely, providing vast amounts of space for code etc. :)

Multiple Instances

None of this helps the situation where you have two instances of the IDE on your display simultaneously. The best you can do in this situation is devise a docked layout which keeps as many of your IDE windows together as possible, to minimise the opportunity for confusion.

However, this approach obviously does not work when it comes to the free-floating Form Designers and all you can do in that case is keep a close eye on which IDE becomes active when you focus a particular Form Designer.