How to automatically save IDE layout in Delphi XE2? - delphi

We are having an issue in Delphi XE2 with the automated saving of the desktop layout. Under environment options I do have the Autosave options - Project Desktop checked. However, changes to the layout of the desktop are not being saved and restored each time the IDE is launched.
The workaround we have in place is to use a custom destkop layout under View | Desktops. This requires us to manually save this layout each time we make a change.
Is there another setting that needs to be enabled in order for the desktop layout (window size, position, toolbar settings, etc) to persist from session to session without requiring the developer to manually save this layout?

The way to do this is to configure a custom desktop, and then save it. You can have multiple desktops (eg., normal and debug, among others) and easily switch between them using the "Desktop SpeedSetting" combobox (and associated toolbuttons) in the main menu/toolbar of the IDE. Saving is as easy as clicking the Save button and either accepting the current name or providing a new name, and switching is choosing a named desktop from the combobox.
"Autosave project desktop" saves the open files in the code editor, and whether you're on the design or code page for each form. It also saves the build configuration (debug or release). It will save which of the selected stored desktop layout you've chosen, but not any changes to that desktop layout.

Related

visual studio extension tool window opens every time visual studio opens up

I added a tool window to VSIX extension using these steps https://learn.microsoft.com/en-us/visualstudio/extensibility/creating-an-extension-with-a-tool-window?view=vs-2019
When the extension is installed the tool window must open once
But the tool window opens up every time the Visual studio opens.
How to open tool window only when it is required?
These are the attributes am using,
[ProvideToolWindow(typeof(MyWindow), Orientation = ToolWindowOrientation.Left, DocumentLikeTool = true, Style = Microsoft.VisualStudio.Shell.VsDockStyle.Tabbed)]
[ProvideToolWindowVisibility(typeof(MyWindow), VSConstants.UICONTEXT.SolutionExists_string, Name = "Extension Overview")]
Deepak,
By using VSConstants.UIContext.SolutionExists_string, you are registering the toolwindow to display whenever a solution exists in the VS IDE. If you don't want this behavior, remove the attribute.
Note, Toolwindows are almost always associated with a particular scenario or IDE state (like during debugging, building, or coding). This is typically where you would leverage the ProvideToolWindowVisibility attribute. To associate your toolwindow to a specific activity or state. However, if the user manually closes the toolwindow while in that UI state, the IDE will try to remember that. So that it no longer appear by default while (debugging, building, or coding, etc.). This is what is meant, when the toolwindow layout is described as being "sticky".
If you are curious as to what UI Contexts are currently active in the IDE (to figure out which you'd like your toolwindow to be visible with), I highly recommend using the Component Diagnostics extension, to monitor what UI Contexts are active, during the scenario(s) you want your toolwindow to show up under.

Where should I store IDE component editor user preferences?

I'm writing a component editor for the Delphi 10 Seattle IDE which has some form layout customization, such as re-sizing the form, positioning it, splitters to re-side panels, etc. I would like to save these settings so that each time the user opens this editor, it opens in the same layout they last left it.
I'm assuming the location to save such settings should reside somewhere within the HKCU section of the registry, along-side the specific Delphi IDE version settings.
Where in the registry should I save such settings?
After digging further into the registry, I'm pretty sure I found it.
HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\17.0\Property Editors\
It appears that other property and component editors keep their properties here, for example the TActionList. There are traces of editors storing their dimensions in this node.

How to change Delphi XE2 default behaviour for some panes?

After switching from Delphi2007 to XE2, I'm terribly unhappy with the behaviour of some Windows/Panes.
I'm designing in the 'Default layout', it changes to the 'Debug layout' when running/debugging.
'Autosave project desktop' is set in my environment options.
For 'Default layout':
How can I permanently hide the structure view(pane)?
Closing or un-pinning it does not hold between sessions.
How can I keep an opened group in the Tool Palette open between sessions?
All groups are closed again when I start a new IDE session.
For 'Debug layout':
A. How can I permanently hide the call stack view(pane)?
Closing or un-pinning it does not hold between sessions.
I have read How to set default compiler options for XE2? but that is about project options, not IDE configuration.
Thanks,
Jan
Like TLama already quoted you need to save your desktop layout. This was already possibly in your Delphi 2007 IDE.
Arrange the panels the way you want to, respectively hide/pin/unpin/... them. Then click "save your current desktop" in the Desktop panel.
Same goes for debugging. Layout your debug desktop while debugging and save it. But you have to make it your default debug desktop. Goto Menu > View > Desktops > Set Debug Desktop.
I don't know if you are able to keep opened groups in the tool palette.
I tried View > Desktops > Set Debug Desktop but it didn't seem to work correctly, instead what worked is View > Desktps > Save Desktop and then select the option Debug Layout in the window that appears and click OK.

How keep the debug layout the same as the desktop layout

I try to have a similar layout during editing as well debugging. When running the program my structure and object inspector disappear. I did create my own desktop speedsetting, set the debug desktop to it as well, but as soon as the program runs structure and obejct inspector disappear. How can I prevent that?
A question related to this: the edit menu changes as well. A right click on a procedure name results in a popup menu with the first item being "find declaration". When debugging the first item is "close page". I find the find declaration item a fast way to find some code. Apart from that it is frustrating to lose one's code because you click "no" on the question to save the information (I know, it's my fault but menu's shouldn't change in my opinion).
Thanks,
Arnold
What version of Delphi? Dialogs and menus change between versions (and even between SKUs of the same version).
For the first, open Tools->Options->Environment Options and uncheck Hide designers on run in the Running group box (D2010, XE, and XE2), or Tools->Options->Environment Options and unchecking Hide designers on run in the Compiling and Running group box (D2007).
For the second: The right-click menu is called a context menu, meaning it displays what is appropriate in the context of when it's being shown. It's entirely appropriate for it to change depending on when and how you're using it; that's the way it's supposed to work.
Right-clicking on a .zip file in Windows Explorer is different than right-clicking on a Word .doc file, because they have different options based on context - a zip file has an 'Extract to...' option that the Word document doesn't have, because 'extracting' a Word document doesn't apply. Same applies to right-clicking a .exe file, which has the Run as Administrator option (Win7), as opposed to right-clicking a .pas file, which doesn't offer that option.

Delphi 2009 RAD Studio - Desktop Selector not Working

In the Delphi 2009 RAD Studio, there is a drop-down combo box where you can select the desktop configuration, i.e. "Default Layout", "Debug Layout, "Classic Undocked", etc. This has stopped working for me, i.e. when I select a desktop, nothing happens. I think I once "customized" the toolbar, by removing the drop-down combo box, and then I added it again, and ever since it has been dead. Is this a known bug? Is there a cure?
Create a new user account on your computer, call it "Testing" and log in there. Now load up delphi and try this desktop layout button. If it's now working in this alternative desktop account, then it's something in your registry settings under this key:
HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0
Try setting the keys named DesktopName and RuntimeDesktopName under the Session key
HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Session\DesktopName=Default Layout
HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Session\RuntimeDesktopName=Debug Layout
Is it still switching configurations when you run the project or when you go back to coding?
Have you tried to create new custom configurations, save them and switch manually with the combo?
My guess is it's something wrong saved in the Registry. You could try (after saving your current registry) to get a (good) D2009 registry from another install where it works, and apply it to your machine. If it works again you'll have a way to figure it out by diffing the regs. If not you may have to reinstall D2009 (or at least try"repair").
DISCLAIMER: yadda yadda about touching the Registry...

Resources