Problems with leaving ComboBox on Delphi 7 - delphi

I have just noticed a strange behavior of ComboBox component. I am using it in DropDownList style. If I click on it, it drops down the list of items, as usual. But then if I click on some other component on the form, the combobox will not let me leave it, unless I select one of the items. I thought of adding onmouseleave event, but in that case it would close even if I move mouse out of combobox area a little, which is undesirable. What I would like to see is combobox losing focus whenever i click somewhere outside of its area. Is that possible?

Actually, I just did what you did: started a new application and threw ComboBox and TEdit. Ran the program. It drops down the list just as you said when you clicked on it. Also, when I clicked on the TEdit, the combobox closed automatically as expected. So, I don't know what is the problem with your program.

Related

How to disable the popup menu of TMemo?

I'm using Firemonkey TMemo component in my desktop application, I hope that when the user right-clicks or Long-Taps on the Memo , the default menu will not been pop up.
This is actually easy.
Just drop a new TPopupMenu on your form and give it a good name (pmRecipe, say). Make sure not to add any menu items to it! Then simply assign it to your memo's PopupMenu property.
However, as a user of your application, I expect a context menu, so I might get annoyed by the lack of such a menu. (I'd also be annoyed by the fact that the app is FMX and not VCL and that the control isn't the native Windows EDIT control, but maybe that's just me.)

Unable to get my Application to detect the Delete button

I apologize in advance for this vague question but can anyone give me a pointer to this problem?
The Delete key does not work as normal in my application. e.g. The Delete key has no effect in an editbox (i.e. it will not delete highlighted text) but Shift Delete does work. This seems to be the case thoughout the application. I have disabled all keypreviews and OnKey events in case they were causing it but the problem persists.
Can anyone suggest where I might look for the problem?
Running Windows 10 Delphi 10.3.3
If this happens only in this particular application, it is likely that you have a TActionList or TActionManager with an action using Delete as its shortcut, or a simple menu item with such a shortcut.
For instance, you might have an Edit menu with a Clear item using Delete as its shortcut:
Then that action or menu item will respond to Delete, not allowing the focused control to do its own thing.
This kind of mistake is surprisingly common. For instance, in the Delphi IDE, you have an edit field above the editor, showing you the current class:
If you select this text and press Ctrl+C, you expect it to end up in the clipboard. But no! Instead, the selected text in the code editor (if any) is copied, even though the code editor didn't have keyboard focus.

Is it possible to get a general OnClick on a form no matter where or what object I click?

I am working on a label printing project and I am using FastReports and also a TJvWizard from the JEDI Components Library.
I embedded the report's designer on a TpageControl and I added buttons and other components to the form so that I can interact from Delphi to the report's designer and add components to the report or modify their properties.
the problem I am having is that I need to know when the user selects (Clicks) a component in the report so that I show the correct properties for the component type that was selected. and I already asked on the fastreport support but there is no such event or any way the report notifies when it happens.
so, my question, is there any way to set a general on click event or something similar that lets my form know that the mouse was clicked, no matter where or what the user clicked but to be notified about the action itself of clicking.
I already tried setting the OnMouseDown event for the TTabSheet where the report's designer is embedded but It doesn’t trigger anything.
if it helps, I have my form and the TJvWizard in it, the wizard has some JvWizardIneriorPage and in one of those is my TPageControl which has two TTabSheet and I embedded the designer in one of those.
Edit:
in This other question provided by Sertac in the comments I found what I needed.

Vaadin 8 Grid cell focus

I have a large project on Vaadin, it works fine on Vaadin 7. But i have start to upgrade it to 8.0 and then to 8.1 versions. Everything is fine but focusing on ComboBoxes inside Grid. It sometimes works, but sometimes not. I look at debug console online and see that there is command to set focus received. But it not always really set focus on right component. On Chrome focus can lost from all components, in Firefox focus stays on previously focused component.
I have created simple testing Servlet with Grid component, which has some ComboBoxes as columns. It must imitate problem from large project's Servlet.
On each ComboBox added valueChangeListener, which moves focus to next ComboBox. At the last ComboBox there is moving focus on next line first ComboBox. And so on, until to last line, where it move focus on first line first ComboBox.
In test Servlet i cannot find error, all works like i want. Almost two weeks i tried to solve my problem, but cannot.
Update 2017-10-18:
I think i found my problem. There is an focus lost occured if line with focused component moves to another position.
I attach simple example. It is an Vaadin Servlet with 2-columns Grid. For focus testing i added static trigger with button. Open servlet in two browsers, select some values in ComboBoxes and play with buttons. On press button in first page it must react on second page and mix two lines. Periodically check focus on second page. On some button press line with focused ComboBox will move to another place and lost focus.
Link to example source on Vaadin forum
Link to example source on Dropbox

Forms' focus malfunctioning when both have ribbon

I encountered yet another problem with ribbon. When I have two forms (one of them is main) and I put ribbon on both of them, they behave strangely. When I open the second form by Form2.Show;, every time I click a ribbon menu button on the second form, it loses focus and the main form gets it.
This happens at pure blank project, so what could I possibly be doing wrong?
Here is a video, just in case: Watch YT
And to be clear, the Action1 button has only Caption:='a'; code.
The ribbon control assumes that there is only one per application, and misbehaves if it is not the only control. You could try to modify the Ribbon.pas code, but it is doing some hacks that probably rely on Ribbon.Parent being Application.MainForm only.

Resources