How to tell if item was selected or menu dismissed from comboBoxWillDismiss in NSComboBox? - cocoa

I have a dialog where changing the value in an NSComboBox triggers changes to other parts of the dialog. We apply the changes in controlTextDidEndEditing and comboBoxWillDismiss, but it turns out that if the user used the keyboard to select an item but then presses escape to cancel the selection, indexOfSelectedItem returns that item, even though the text doesn't get updated to that selection. How can we tell whether the user selected an item or dismissed the menu without selecting an item?

Related

Show NSSearchFields clear button at all times

I want to use the clear ✖️ button of an NSSearchField to close a search pane. Therefore I have manually set the action and target of the clear button cell. Now the button only appears when the search field has text in it and I can't find a way to override this behavior.
Is it possible to show the clear button at all times, wether there is text or not?

In Xamarin Forms how can I stop the keyboard from being dismissed? (Android)

I have an Entry and ListView.
The Entry allows the user to filter the items in the LisView.
Each item in the ListView is selectable, which means that when the user taps on the item a check mark is added in the right.
He can select multiple items.
When the user starts typing in the Keyboard the ListView gets filtered and he can select items.
in iOS when the user selects an item the Keyboard is NOT dismissed, which is the behaviour I want.
in ANDROID when the user selects an item the Keyboard is dismissed.
How can I make Android to have the same iOS behaviour and keep the Keyboard on when tapping in the ListView items?
Thanks

Change ListBox selected item on finger tap, not on finger release

The Windows Phone ListBox control changes the selected item when the user releases the finger after having tapped the item. I would like the selected item to change as soon as the user taps the item, without waiting the finger to be released. Is there any way to achieve this?
Actually what I want to do is to handle the ListBox "Hold" event to do something on the selected item. Currently, two taps are needed (one short tap for selecting the item, and another one for the hold behavior), and I would like one tap to be enough bor both changing the selected item, and the hold behavior.
Use the Hold gesture instead.
If you need a context menu, use the ContextMenu from the [Silverlight Toolkit].

How do I keep focus on TextBox after a button was pushed?

I have a XAML ListBox, a TextBox inside the ItemTemplate. A user edits text inside the TextBox, and then presses a button in the application bar. How do I keep the focus on the TextBox after the button in the application bar was pushed?
You don't. You set it back afterwards.
You can use Focus() method to do this.
You can also use the SelectionStart and SelectionLength to highlight a specific part of the text.

How to require explicit dismissal of a yui popup menu?

I have a page with a couple of widgets on it, each of which, when clicked, brings up a yui popup menu: If I click on widget 1, its menu comes up. If I now click on widget 2, widget 1's menu gets a hide event, and widget 2's menu gets a show event and comes up. I'd like to change this so that, when widget 1's menu is up, it must be explicitly dismissed by a click on the page background (and/or, perhaps, another click on the widget or the escape key) before the menu attached to widget 2 is allowed to appear.
I've set up some beforeShowEvent and beforeHideEvent handlers on the menus, hoping to be able to use some method (a global variable? ick) of keeping track of when a menu is present and showing or hiding accordingly, but it's not working -- these handlers can't tell the difference between a click on the page background and a click on widget 2 (at least, not as I've done it so far). Is there any way to do what I'm trying to do? Thanks!
I think that a combination of clicktohide: false
Boolean indicating if the Menu will automatically be hidden if the user clicks outside of it. This property is only applied when the "position" configuration property is set to dynamic and is automatically applied to all submenus.
and keepopen: true
Boolean indicating if the menu should remain open when clicked.
will take care of this.
http://developer.yahoo.com/yui/menu/#configref

Resources