WKInterfacePicker: handle a tap event - watchkit

Trying to simplify the UX in a Watch application by getting rid of a redundant button which a user has to tap in order to choose a selected item in WKInterfacePicker and perform a next step. Just want to replace the tap on this button with the tap on a picker.
Cannot find such API in the class specification and the following quote haunts me:
The user interacts with a picker by tapping it, using the crown to scroll through items, and tapping again to select an item.
Everything points to the fact that an item can be selected by tapping on a picker and we can get an access to that action programatically. Has anyone faced this task?

To handle focus to picker did tap event use - pickerDidFocus.
If you want handle each tap now there are only one custom way. You need every time did focus picker programmaticaly call [picker resignFocus]
Put picker into group and set background border image to it if you want to customize focus. Set picker focus style to none.

just add a picker to your WKInterfaceController and create an IBAction to react on the pitch events:

Related

Is there a way to show tooltip on disabled QWidget

I have a Qt form, where I have a button and menu. For various reasons I can disable certain elements, e.g button or some actions in the menu.
Is there a way I could show a tooltip or when the mouse is hovered over the disabled button or menu item with an explanation as to why it is disabled?
I am using Qt 4.8.
Thanks!
You can set the tooltip dynamically based on the state of the QWidget or by simply toggling both at the same time. Upon disabling/enabling the widget from somewhere just call QWidget::setToolTip(...) with the QString you want the tooltip to display when hovering with the mouse over the given widget. For example if you have a public slot called toggleButton(bool toggleFlag) which toggles the enable-setting of a button you can do:
void MyWidget::toggleButton(bool toggleFlag) {
this->ui->myButton->setEnabled(toggleFlag);
this->ui->myButton->setToolTip(toggleFlag ? QString("Enabled wohoo!") : QString("Disabled because I like it"));
}
You can of course do also change the tooltip by calling QWidget::isEnabled() and act upon its return value. Since you haven't given any code I can only assume how you toggle your button(s) so that's all I can give you for now.
UPDATE: It was pointed in the comments that tooltips don't work with disabled widgets due not receiving mouse events. Both statements are not true (note that I have used the same tooltip message since due to lack of minimal working example I didn't want to write a whole new project from scratch and used an existing one of mine instead):
Hovering a disabled button triggers the tooltip
Hovering an enabled button triggers the tooltip

Make WKInterfaceButton keypress clearer in watchOS 2

I find the graphical feedback when pressing buttons (WKInterfaceButton) in watchOS2 is very weak. It is hard to see and even Apple seems to thinks this is the case as they e.g. in the unlock screen change the background to white on active buttons. The default behaviour is to dim the whole button.
How can I make a button press cleared in watchOS 2? I can e.g. change the button text color on activity but how do I easily change it back when it is no longer active?
There is currently no way to detect touch-down, or other events, on WKInterfaceButtons like you can on UIButtons on iOS. The only touch event you can detect is touch-up-inside, which calls the IBAction method.
Therefore what you wish to accomplish cannot be accomplished. Something you might consider is animating the button appearance once the action has been triggered. For example in my app upon button tap I animate the button's background color, then animate it back to the original color. That provides more visual confirmation to the user so they are certain the button was tapped.
I'd encourage you to file an enhancement request at bugreport.apple.com if you'd like to have more control with touch events.

Disable the button partially

I I'm using Raddatetimepicker to select began and enddate.
When user select two dates then he can click the button called fiter.
I want to show partially(it should appear when page load but in inactive mode) the button before user select the both end and began date. once he selected the both dates i should
show the button as activated.
How can I do it.
Please help me.
get two bool variables which are set false on Startup, set them true on each pick, if both true show button (visible=true or whatever)
just Disable the Filter button on window loads or initially in the Properties of the Filter Button ..use events to enable and disable the Filter button Dont use Visible==false as it may not seen when loads but if you use disabled the button can visible but it can't be clickable and using event you can enbale the filtet button using simple cade as
btnFilter.Enabled=true;

What is the proper name for a multibutton?

I'm trying to design a UI in Qt and I can't find anywhere in the designer a button which can be "droped down" like combobox. What I mean by that is that I would like to have this button with his "default" option choosen so if I like it I would have to just click on it but if I would like to choose different option I would be able to clik the little arrow on the right side of this button and then pick option suitable for me at that moment.
You're looking for a QToolButton that has a set of actions or a menu set on it. From the documentation, the QToolButton::ToolButtonPopupMode...
Describes how a menu should be popped up for tool buttons that has a menu set or contains a list of actions.
Of it's values, the two that I see most frequently are DelayedPopup:
After pressing and holding the tool button down for a certain amount of time (the timeout is style dependant, see QStyle::SH_ToolButton_PopupDelay), the menu is displayed. A typical application example is the "back" button in some web browsers's tool bars. If the user clicks it, the browser simply browses back to the previous page. If the user presses and holds the button down for a while, the tool button shows a menu containing the current history list
And MenuButtonPopup:
In this mode the tool button displays a special arrow to indicate that a menu is present. The menu is displayed when the arrow part of the button is pressed.

can two overlapping buttons recieve the same click?

I am new to flex and as3 and I need to create a workaround for a button issue. I don't know how to have one button created by one class send a click event to another item created in a different class
Therefore, I'd like to place both of my buttons on top of one another, alpha one of them out and have both buttons receive the same click.
Is this possible? How?
One button's click handler can dispatch another button's click event. See this: http://livedocs.adobe.com/flex/3/html/createevents_3.html

Resources