THotKey does not work anymore under Delphi XE - delphi

I have upgraded an old project from Delphi 7 to Delphi XE.
The project has (among others) some THotKey controls. Under Delphi 7 the THotKey controls are working ok. But under Delphi XE they are like disabled. This means that they show nothing inside even if a shortcut (Alt+A for example) is assigned to them and I cannot edit them.
Anybody else has this issue?
Update:
I deleted ALL controls and all code from that project. Now I have ONLY the main form and a single THotKey control. Basically, after deleting all the controls my project is like a brand new created project without a single line of code. But the THotKey is still not working under Delphi XE and still works under D7.

Cause found (Delphi bug)
I compared my project with a new created project. I have seen that the old form had the 'double buffering' option set while in the new project this was not on, so I manually turned off this option in my old form. Guess what? The THotKey works!!!!!!! Every time I turn the 'double buffering' on, the THotKey goes ape.
Confirmed
Yes (by Andreas Rejbrand)
Solution (partial):
I have seen that it is not actually main form's DoubleBuffered property that causes this but rather THotKey's. So it is enough to turn off this property for THotKey, not for entire form. I think I can leave with that.
:)

Related

TFrame as Component, IDE changes object to inline on first use

I have created a Tframe unit with visual and DB controls. I registered the frame as a component using the sprig approach. The TFrame has a few published boolean properties.
Everything works OK, except I have noticed that if I start the IDE and open a project that uses that component, the IDE complains about the "unknown" published properties. And if one looks at the DFM, Delphi has changed the definition for the frame within the form it is embedded in from "object ..." to "inline ...". If I just close the project, without saving, and re-open it, all is good.
It only happens on the first project open.
Any suggestions would be appreciated.
The thing here is that registering a TFrame does work, but publishing properties almost always does not. I say "almost always" as i had this kind of issue in the past (Delphi XE2 as far as i remember) and there seems to be a bug in the designer deeply hidden somewhere. Debugging this issue gave me no results back then.
I suggest you simply move the published properties to public and set these properties in source code directly. This is a workaround but it works.

New Firemonkey iOS application - File not found unit1.lfm

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)

TDBText not updating in Delphi, other data aware controls work

I've taken over a project in Delphi XE4 and I've added some data aware controls to the project. The TDBGrid seems to work fine, but none of the TDBText controls are displaying anything - and it has me stumped. I can throw a TDBEdit on the form and hook it up and it works just fine.
Can anyone think of something that would prevent a TDBText control from working?

Delphi IDE locks because of a hidden modal window

Has someone else experienced something like this with Delphi and if so is there a known workaround!
I'm using the Delphi 2010 Rad Studio on Windows 7 64 bit.
A few times when editing the IDE hangs and I can't do any action either by keyboard or mouse. But there is a error-beep sound from windows like there is a modal window open somewhere, but hidden behind the ide it self.
Only by ending the ide via Task manager can I make this hidden modal window visible.
I see this often with various other dialogs as well.
Pressing "Alt-Tab" and reselecting Delphi you will cause the dialog to appear in the front again.
Note: This happens with other versions of Delphi as well.
I have the same problem with older versions of Delphi like D6.
My solution is use another tool like WinExp –Windows Explorer– or WinResQ to explore the existing active windows on system and reactivate it (BringToTop).
With this solution I get the Delphi IDE on Top and appears the window that cause the lock. This is the only option I have worked for me.
Regards.
Alt+Tab works, but you have to select another application, then Alt+Tab to return to Delphi, and then the dialog will show in front.

Why don't I get hotkey underlines in a Delphi TMainMenu

In a Delphi 2007 program I am using a TMainMenu referencing actions in a TAction list. I have prefixed the hotkeys of all main captions with an ampersand:
&File | &Edit | Ev&aluate | ...
In design view these hotkeys are underlined as I would expect, but when I start the program they no longer are underlined but they work nonetheless. In contrast to this, for all the submenu icons
&File
&New ...
&Open ...
the underline is shown as expected.
I am aware of the Windows pisplay properties option "Hide underlined letters or keyboard navigation until I press the Alt key." and have disabled it. In all other programs this works fine, including the Delphi IDE.
If I create a new VCL appliation and just add a TMainMenu and a few menu items, it works as expected.
This has me baffled, really.
Is there any property of the TMainMenu component or maybe an application option that I must change? The "Enable runtime themes" project option is grayed out for some reason, might that be the problem? If yes, what causes this?
This may not be a Delphi issue. I have just tried this with IE8 on WinXP. On my machine, with the display properties set to require the Alt key, the underlining works as expected. However, with the checkbox unchecked, the underlining never appears on the main menu items (even when using the Alt key), but always appears on the File,Edit,View etc submenus (as you describe) ........ unless Microsoft wrote IE8 in Delphi :-)
I asked the same question last year and there were some excellent answers:
Menu Accelerator Keys Not Showing Up Delphi 2009
In conclusion, it appears to be a Delphi bug, and I reported it to Embarcadero at:
http://qc.embarcadero.com/wc/qcmain.aspx?d=68816
However, they have no resolution to it, so unless others (maybe you) also complain, I don't expect it will get addressed.
Step's answer to my question refers to a possibly related bug reported on the Delphi forums:
ALT Key press causes controls to disappear under Themes in Vista and XP. This one is marked as "resolved" with several possible fixes listed in the comments. I have not had the opportunity to go through these.
By the way, since I asked that question last year, I got a new computer with Vista. The same problem still happens, even when the Vista Ease of Access Centre setting: "Underline keyboard shortcuts and access keys" is set. So the Delphi bug still exists.
I was very surprised to find the default was that this was unchecked. I guess in Vista, they want a cleaner looking menu with the assumption that not many people ever used the accelerator keys.
The easiest way to fix this problem seems to use TJvMainMenu from the jvcl instead of TMainMenu. I tried the current version 3.38, but it is possible that the problem was fixed already in earlier versions. Since I was using the jvcl anyway it does not add much to my program's size. Your mileage may vary though, the jvcl is a huge library.
Uses an empty image list for main menu, if it is possible. In this way you can force delphi to paint menu correctly. (But looks ugly in vista and w7)
Are you sure you don't have OwnerDraw set to true in the MainMenu?

Resources