I'm constantly losing the sort order for the files in my Delphi projects:
How can I fix this? Is there a bug in my Delphi 10.4.2 IDE?
(Self answering because I finally found it, and I want to spare others the frustration)
You need to follow a specific sequence because the IDE interface closes the Sort By popup menu after every action:
If you click on e.g. Name, the IDE sorts the files once. The submenu closes immediately (i.e. no visual feedback) and nothing is remembered.
The trick is to first click on Auto Sort, then reopen the submenu, then click on Name.
Now when you save the project, the settings are written to the .local file and applied in later sessions:
<ProjectSortOrder AutoSort="-1" SortType="1">
Related
I'm new to Delphi, coming from Visual Studio it's a simple question (I guess): how do I prevent Delphi 10 Seattle to open last use project(group) when I start the IDE?
I've found some information about the .dsk file and what it does:
The .dsk file records your current settings for:
Desktop layout
Breakpoints
Watch items
Files currently open in the IDE
When you reopen the project later, the .dsk file is read, and your
desktop layout, your breakpoints, and your watches are all restored.
Also, all files that were opened when the project was closed are
opened again, regardless of whether they are used by the project.
I'm fine with that when I open a project. But please do not open it when I start the IDE. Mostly I want to start or open another project than the last one I was working on.
I've searched the options and the internet, but couldn't find a solution. Anyone?
Disable "Project desktop" in the IDE Autosave options (Tools\Options\Envinroment options).
But please do not open it when I start the IDE. Mostly I want to start or open another project than the last one
Granted, I do no have Seattle at hands, I settled in XE2.
But try changing the shortcut.
-np: No welcome page. Does not display the welcome page after starting the IDE. np also stands for No Project. Independently of Environment Options Project desktop the last opened project will not be opened
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/IDE_Command_Line_Switches_and_Options
saving the layout and position of the tool windows like Refactorings,
That is what the "Layout" combo-box on the "Desktop" toolbar does. Unless you want different layouts in different projects. R-click over your IDE's tool buttons or go View|Toolbars menu to turn "Desktop" bar on. Alternatively use View|Desktops menu.
Does anyone else have this problem or is my Delphi cursed somehow?
I'll have a bunch of forms and files open in tabs in the editor and I'll be typing away and then suddenly everything stops - my .pas file has, seemingly at random, become read-only.
Sometimes I can just right-click the tab at the top and uncheck "Read-Only" and continue, but sometimes this option is checked and greyed-out (disabled), meaning I can't uncheck it and I can't make any further edits to the file. This too seems to be random.
In the latter case, the only solution is to save the file in question, which works, despite Delphi's assertion that the file is read-only, close its tab in the editor, and re-open it. Not catastrophic, really, but it's starting to become annoying.
Could it be that I am hitting a keyboard command combination accidentally to do this or is this a bug in Delphi?
I'm in Delphi 2010, Windows 7. Doubt it's anything to do with installed packages, but if anyone wants the list I'll generate it and attach it here.
Skip to last paragraph for quick Solution :)
Yes! this just happened to me. I was typing a line of code... a line in Intraweb's ServerController.... OnBeforeDisbatch.. anyways. I was typing..
If
and then I typed a Space... so If <---- then space... and then the IDE autofilled in
If True then
after the above line was in the system all hell broke loose.... hell being that the file would stay in a read-only mode....
I edited the file manually and removed the line
if True then
and all is good.
just to update: I do believe it is file size... 125K and then bang. at least on the server controller... IW10/Delphi 2010
update again... 8 hours later...
I reduced my source file (iwservercontroller) from 125k to well under 80k and all was good. then now right when I first press the control key to paste over a value the file goes read-only!! like wow....
going to reduce file again..
Minutes later...
after shutting down d2010 and reloading project... I have narrowed down the problem to using the "paste" command.... the second I tried to paste a clipboard value read-only occurred... but a harddrive hit occurred for a instant before the read-only activated!
Final solution!!! I got it! I couldn't believe there is a "Read Only" option in the Right Click Menu.... Click on the left side Pane where the check box is when the Read-Only appears! no more need to restart IDE and reload everything etc etc...
All fixed... whoo hoo
Nope... not all fixed... 3 hours later... I reactivate IDE and I am just about to paste in some data and then the file goes in read only (not explorer's file attributes) and the Pop up menu value is now grayed out!! like wtf!!
Full day later.. trying everything.. I have a solution!! first time I got it to go off read-only without using the PUM/insert Key
simply just access the unit in question that is causing read-only and do a single character change with a outside app. (ultraedit) and save. upon saving d2010 will detect outside changes and go switch back to insert-mode even with the pop up menu is disabled.... whoo hoo...
* Final Solution *
Things are all good now and not a single read-only but the solution is not too elegant in terms of keeping my text edit habits in check.. but if you open settings and change the editor to keep insert mode on you will be laughing to the bank... at least things are all good for me now.
Delphi2010-->Options-->Editor Options-->["Insert Mode"] check that option.
Seems since i have had the above checkbox clicked not a single Read-only.... good luck.
This happened once to me. I think it's a bug, I can't find an existing report for it and when you find repeatable steps the please create QC report for it.
This happens to us all the time - once a file gets over a certain size/complexity Delphi starts randomly going read only - sometimes accompanied by freezing for several seconds.
We think it's something to do with the syntax highlighter failing on certain constructs - certainly it comes and goes in waves, and I've had times where I've been reduced to editing a file in notepad just to get some work done.
It happens on units with no related DFM, so it's not a component doing it, and it's not storage related (Delphi isn't writing to the disk when it fails).
Yes, this just started happening to me after I installed Model Maker 11. I think the Model Maker plug-in might be monkeying around with the read only setting of a source file. (I've been using Delphi 2010 for a year now without this issue ever happening, all of a sudden it started right around the time I got MM11.) I haven't tried uninstalling MM11 yet though. So --- do you have ModelMaker 11?
I've seen it many, many times in Delphi 7 which rules out some of the explanations others have suggested.
I haven't seen it on 2010 but I haven't done all that much with 2010.
I also see a switch to "readonly" for pas files in the D2010 editor. None of the above suggestions have always worked for me. I am transferring a large project from D6 to D2010 and am making many necessary changes. On way to overcome the problem for a file that has been marked "readonly" and where (right-click in the editor "[ ] Read Only") has been greyed out, is to close the file and reopen it.
After I installed cnPack, right clicking on a component in my form seems to have taken away any specific items that the component itself may have applied.
eg, right clicking on any Dev Express component will usually bring up version details. Now I get a bunch of other context menu items and the Dev Express ones have disappeared.
Is there a wizard or some other option I can disable to stop this? I can't find one anywhere.
Thanks
EDIT
Restarting Delphi fixed it in the short term - but has come back again so I'd still like to find a resolution to this....
Right-click menus are controlled by component editors, and AFAIK there can only be one component editor registered to a particular class type at a time. If CnPack's design-time package is loaded after DevExpress's design-time package, then CnPack's component editor will be the last one registered and take priority.
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 2007:
I have a projectgroup with a couple of projects (bpl/dll/exe). Whenever I start the Delphi IDE some of the project entries are expanded and some are not. I would like to see all of them compressed after the start but I cannot see a way to do that.
Any hints?
Chris
When you load the IDE (or a Project/ProjectGroup) does it automatically reopen whatever units you had opened in the editor the last time you closed it? If so, then I believe that the Project Explorer will always auto-expand the tree to show all active units' represenative nodes in the tree.