New Firemonkey iOS application - File not found unit1.lfm - delphi

I started my first iOS application in Firemonkey, and the compiler immediately started complaining "File not found unit1.lfm". There is no such file in my project, and my application has no main form, just a unit with a form referenced...
{$R *.lfm}
What's wrong?

I'm asking/answering this Q/A style. I faced this issue and quickly knew what was wrong, and a lot of other people are bound to face this.
This is because the IDE's form designer for iOS (and all Firemonkey) applications requires that you have the "Embedded Designer" enabled. By default, this is enabled in these later versions of Delphi which have the option. However, many people disable this to mimic the old fashioned Delphi versions (where the forms are floating separate from everything else). These forms cannot be shown as their own windows in Delphi XE2, so they need to be designed in the embedded designer.
To fix this, go to "Tools > Options > VCL Designer" and then check the option "Embedded Designer". This will require you to restart your IDE for it to take effect.
Unfortunately, you will have to delete any saved files and create your project again. The links are broken after you've started a new project with this disabled. (technically it can be recovered, but it's easier to start over anyway)

Related

Getting back into old XE5 C++Builder platform

I have an instance of C++Builder XE5, which was installed years ago and hasn't been touched for quite a while. I need to create a new application and have forgotten everything about how to get a project up. The help documentation for that platform isn't the easiest to navigate, to say the least.
The closest I've come to is a demo on Youtube, that says to create a VCL Application - on my installation that isn't available, only a VCL Forms Application. I've tried to find out what a VCL Forms Application is, but once again the IDE help system just seems to assume that you already know that.
So, my question is simple: Will a VCL Forms Application do what I want, which is to create a basic GUI screen and run some C++ code behind it?
Also, what's the essential difference between the two project types?
The closest I've come to is a demo on Youtube, that says to create a VCL Application - on my installation that isn't available, only a VCL Forms Application.
They are the same thing.
Will a VCL Forms Application do what I want, which is to create a basic GUI screen and run some C++ code behind it?
Yes. It will create a VCL-based project with a default MainForm added to it, which you can then customize as needed.
Also, what's the essential difference between the two project types?
Well, since there is no `VCL Application" project type, the question is moot.

Delphi runtime theme enabled, but not used

In a legacy application (created in Delphi 6 under WinXP in 32-bit, recently ported to Delphi XE2 under Win7 in 64-bit) at design time, the standard controls look "modern", with color gradients etc. In run-time though, they look just like an old Win95 version.
That would not bother me much if, in particular, the default colors in TPageControl and TTabControl wouldn't make it really difficult to tell which tab is currently selected.
So my questions are:
What could make the theme not active at run time?
Is it possible to easily (e.g. through IDE configuration) make the design time look like the run time?
Note:
In the project options, I enabled runtime themes for each existing target. It didn't help.
I also tried to enable GlassFrame in the forms containing those controls. Unfortunately, the runtime look and feel stayed unthemed.
This application is built on a lot of in-house and external code that
I don't master (just a dwarf standing on shoulders of giants),
but whose source are available to me. Suspecting that some
instruction would disable themes at application startup, I looked for
some keywords like "Theme", "Skin", "TStyleManager", "SetWindowTheme"
hoping to solve this by myself. I could not find anything significant (to me, at least).
I tried to skin a small application as a test, using infos from
Question
Delphi XE2 VCL styles tutorial - how to change the style at runtime,
and it worked perfectly.
Skinning my application is not my goal. I just would like to be able to visually tune some GUI elements at design time, and it is easier if design and run time look alike.
It turns out that removing the line "{$R *.res}" in the dpr file had made the themes unavailable.
Under D6, I disabled version information in the project and replaced "{$R *.res}" with "{$R 'myApp.res' 'myApp.rc'}", to use my own rc file to have the version information in a separate, easy to edit file, and not to be forced to go through the project options.
Under XE2, that did not work anymore because the resource would often be overwritten (or not taken into account, I'm not quite sure) by Delphi during the build. I had to rename the rc file so that it does not match the application name, thus replacing "{$R 'myApp.res' 'myApp.rc'}" with "{$R 'myApp_rc.res' 'myApp_rc.rc'}".
Putting the "{$R *.res}" again (along with "{$R 'myApp.res' 'myApp.rc'}") seems to make things right with themes and not break the version information.
Thank you Brian for having me look in the good direction.
In my experience this is often due to project differences between DEBUG mode (used by default when in the IDE) and RELEASE mode. Open your project options and scroll to application (where themes styles and icon are defined). Notice that the platform and build option combo at the top holds separate values for each setting and I expect you will find that your DEBUG build config has runtime themes enabled but RELEASE does not.

`Project Page Options` is missing from the IDE, what to do?

While I was using D2007 I've really got used to Project > Project Page Options feature to keep and view some free-form project notes, external references (these almost never being comfortably viewable in built-in HTML designer) etc. Now I have Delphi XE and Project Page Options is missing from Project menu, moreover, projpageide150.bpl mentioned in the documentation is not present in bin directory. How do i fix it? I'm really finding ability to view (not edit!) HTML documents in the IDE a very convenient feature.
It looks like it was dropped but has been re-instated. In my XE2 installation the projpageide160.bpl file is there, as is the Project | Project Page options menu. Neither are present in my D2010 installation.

Can't find Code Explorer Window in Delphi 6 running on Windows 7 64-bit. How to get it back?

I'm having a really strange problem with the Delphi 6 IDE running on Windows 7 (64-bit edition). I just can't find the Code Explorer window pane. Usually it's docked against the left side of the Code Editor window. If not there, then you can find it by opening the View menu and selecting Code Explorer. But the Code Explorer is not docked to the Code Editor and when I drop down the View Menu the Code Explorer option is simply not there. All the other options are: Project Manager, Object Inspector, Object TreeView, etc. but just not the Code Explorer. Everything else about the IDE works great. Has anybody else had this problem and if so, what can I do to get it back? I rely on that view quite heavily.
Also, once I undock a view it doesn't seem to want to dock again. I hover over the usual areas in the edit window and it won't accept it the orphaned view as a docking client.
-- roschler
I can't reproduce the missing Code Explorer menu item. It works fine for me.
Regarding the non-dockable windows have you tried right clicking on the troublesome floating window and making sure that Dockable is ticked?
One thing to try when Delphi's IDE is giving you grief is to delete any .dsk files.
Finally, Delphi 6 pre-dates UAC and assumes that you can write to the installation directory. Have you made sure that Delphi is able to do this one way or another?
Sorry I don't have a definitive answer, but this is all I can think of.
For the record,
I had the same problem as you Robert.
Configuration:
Delphi 6 Enterprise, installed to a custom location.
Update Pack 2
Several Third Party Components
Windows 7, Spanish and English languages in Regional and language settings, and keyboard layout settings. Default language 'spanish',
default keyboard distribution 'english'.
Issues:
No 'code explorer' context menu item,
In editor, no 'complete class at cursor'.
Ctrl+Shift+C not working
Ctrl+Shift+Up/Down Arrow not working.
I uninstalled Delphi, uninstalled English language, removed keymappings to change keyboard layout (Ctrl+Shift).
Then I installed Delphi again, custom location, execute the installer as administator -> no issues.
I installed the third party components -> no issues
To install the update pack, this time, I opened the exe with winrar, decompressed the file, changed the files 'setup.exe', '_ISDel.exe' and '_BDEL.EXE' to execute always as administrator for all users. Run 'setup.exe' as administrator.
I don't know exactly which step did the trick but now I have no Issues.
I just tried with Delphi 6 on Win64, and have all the windows. And all expected menu items. Sometimes, there is some problems of refresh, but when I restart the IDE, everything is back there.
But I've installed:
Delphi 6 Suite Entreprise;
Update pack 2;
DDevExtension;
Delphi SpeedUp;
CnPack.
All is installed not in C:\Program Files but in a custom C:\Progs directory, which has all security rights set for all authenticated users. You should not install Delphi 6 under C:\Program Files, in all cases.
Works like a charm. Perhaps one of the add-ons fixed the issue.

Make Windows Integrated Form Style In Delphi 7

Every Delphi 7 developer knows that if he compile a application on Delphi 7, the style will be as Windows 2000 applications, but there is any method to make this better as the application can have the default theme of the Windows version, as C++ and C# applications?
Try adding the TXPManifest component to the main form of your application. located in the Win32 Tab.
The TXPManifest component has no methods or properties. All it does is include the XPMan unit in your project. This in turn causes a certain resource file to be included in your project's executable file. The resource includes a manifest - a small piece of XML that contains information about the application you are writing as well as information concerning the version of the comctl32.dll to use.
Alternatively add your own manifest resource manually - which allows you to tap into the even newer Windows 7 features, if you can be bothered to fathom out the syntax. See this link for more info but ignore the bit about enabling runtime themes as this doesn't exist in D7 (I don't think).

Resources