my Navigation Control
I have a Navigation Control (navCountry) with set up OnClick event with
MsgBox "Hello World"
in the [Event Procedure].
Why clicking on the Country buttons within the navCountry doesnt trigger the [Event Procedure]? I even tried to click on the Navigation Control frame/area without touching the buttons themselves. Is this OnClick event useless for this object?
Why does it work only if i set up OnClick event
MsgBox "Hello World"
for each button within navCountry (btnDE, btnFR, btnIT etc.)?
Thank you for helping me out understanding that feature.
Related
When mouse cursor is over some menu item (TMainMenu) then the item is highlighted. I would like to add a text inside my status bar describing the menu item but I have no OnMouseMove or any similiar event for TMenuItem to do this. How to achive this?
I'm using C++ Builder XE6.
Thanks!
The VCL can handle this automatically for you.
Assign your desired text to the TMenuItem.Hint property:
Specifies the text string that can appear when the user moves the mouse pointer over a menu item.
Set Hint to a string that provides more information about the meaning of the menu item than the Caption. The hint text appears in the Status Bar when the user pauses with the mouse over the menu item if Help Hints are enabled (that is, if the Form's and the Application's ShowHint properties are True). It is also available for the code in the application's OnHint event handler.
And then set the TStatusBar.AutoHint property to true.
Specifies whether the status bar's text is set automatically to the current hint.
Use AutoHint to specify whether the status bar's text is set automatically to the current hint. When AutoHint is True, the status bar automatically responds to hint actions by displaying the long version of the hint's text in the first panel.
Any changes to the TApplication.Hint property, such as when the mouse moves over a UI control or menu item, will propagate to the TStatusBar automatically.
It is possible to do in most other environments, but i'm unable to find a way to do this with Embarcadero.
The closest thing that was found is setting the DropDownMenu property on a button with bsSplitButton property... however this has a problem that it only works with Vista (so in fact i cannot even test if it works at all).
Alternatively it is currently possible to add a regular right button drop down.
Is there a way to connect button's left button click event to a specific drop down menu?
Your button's OnClick event handler can call the Popup() method of a TPopupMenu component. You do not have to assign the PopupMenu to the button unless you want it to handle right-clicking.
I'm trying to build an editing view for a mobile app powered by Backbone.js and Trigger.io. The user goes to a note view and makes changes by tapping "edit" in the top right. When the "edit" button is tapped, we focus on the textarea containing the content and the "edit" button goes away and a "save" button appears. Whenever "edit" is tapped, however, a mouseUp event is firing which results in the textarea losing focus.
The mouseUp event does not fire if the edit button gets hidden and nothing replaces it. The mouseUp does fire if the edit button either A) remains or B) is hidden and save button replaces it.
The only way I've found to fix it is by setting a 200ms+ timeout between hiding the "edit" button and displaying the "save" button.
Is there something with mouseup events firing after click events and/or having them target separate elements? I'd post code but it's all over the place and would not provide much context. If you really need the code, I can post it in parts.
I believe iOs places a delay on the mouseup, to determine if a long touch is being performed. This might help:
http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone
It appears Onclick events are not processed for menu items that have sub-items.
I realize I could create a leaf item which users could use instead, but I would like to have my menu folders respond to OnClick (in my case to "launch" all sub-items)
Is there any way around this limitation?
Menu items that have sub-items do indeed fire OnClick events. But they fire when the sub-menu opens rather than when you click on the parent menu item.
I'm pretty sure you don't want to invoke all sub-items when that happens. The OnClick event for a parent menu fires whenever the sub-menu is opened. Either when you click on the parent menu item, hover over it, or press the right arrow key when the menu item is selected via the keyboard.
So, the OnClick event for a parent menu corresponds to opening the sub-menu. Invoking all the child menu item actions when the sub-menu is opened goes against all standard expected UI behaviour. What you should do is add another sub-item that can be used to invoke all actions. Don't go against the platform standard UI unless there are no sane alternatives.
I'm using Delphi 2010 and I have a TToolButton contained by a TToolBar. Assigned to the 'DropdownMenu' property of my TToolButton is a standard TPopupMenu.
The only way I can get the menu to appear is to click on the area pointed to by the red arrow in the image. Currently, clicking the area pointed to by the green arrow shows the button as pressed, but the dropdown menu does not appear.
What I want is if the user clicks anywhere (pointed to by green arrow or red arrow) for the menu to appear. Is it possible to enable this functionality?
The idea of the tbsDropDown style is to have a button that triggers some default action when clicked, but provides more variations of that action in the drop down menu.
If you don't care about the down arrow disappearing, you can set the style to tbsButton and no matter where the button is clicked, it will show the popup menu.
If you are like me and you do want to have the arrow there to indicate that there are more options behind this button, you can call CheckMenuDropdown in the button's OnClicked event handler.
Set Style to tbsButton. Then you can click anywhere to show the drop-down menu, but you will lose the arrow.