How can I make an action for a picture? - xcode4

In my program, I want the users could touch a picture so that an action will be activated. However, the function IBAction cannot allow me to connect it with the picture. Is there any method that can help me to trigger a function when the users touch the picture? Thank you!

You can activate the User Interaction for that picture, and then detect taps on it and trigger the action based on them.
But the simplest solution would be to just put a button behind it, and connect the IBAction to that button. That's what we do in such cases.

Related

can we manually drag custom time bar? or is there any way to trigger timechanged event after setCustomTime method?

can we manually drag custom time bar? or is there any way to trigger timechanged event after setCustomTime method?
if I need to request a feature please do advise
Yes, as you can see on this example, the custom-time bar can be moved manually.
And after the setCustomTime method, you can get the time as you can see on the same example.

I need different button titles for different users in telegram group

I'm going to make vote-bot based on Schulze-method, so I need to show individual buttons for every user. Is it possible?
No possible to make different inline keyboard for each user in same chat at this time.
But I think you can use a button with url parameter contain https://t.me/Bot?start=vote_uniqueId, and when user click it, your bot will receive /start vote_uniqueId. And then you can give they different keyboard to vote now. :)

MFC: Is there any way to active button without On_Bn_Clicked() event?

I have a task that are hiding a dialog but I need to click the button belong to this dialog to
implement some function before go to the next dialog.
But when I hide this dialog, I can't click the button. Is there any way to implement this button without On_Bn_Clicked() event? I mean that when the dialog is called, the button is also activated.
Thank for the helps.
When you click the button a few Windows messages are sent. The important ones are WM_LBUTTONDOWN, WM_LBUTTONUP which tells the button you clicked the left mouse button down and up. Then some time later a WM_COMMAND message is sent to the parent window to handle the button click. At that point your ON_COMMAND() MFC handler is called. MFC abstracts this all away from you for the most part.
You could go and simulate this using the Win32 SendMessage API but if the message pump is blocking your button may not be clicked when you think it will. If you want a quick answer to your question then this is an approach to "get it done". It would look something like this:
SendMessage(button.GetSafeHwnd(), WM_LBUTTONDOWN, MK_LBUTTON, 0);
SendMessage(button.GetSafeHwnd(), WM_LBUTTONUP, MK_LBUTTON, 0);
I think a more sensible approach is to take the code that is in this On_Bn_Clicked() event handler and simply move it to a reusable function. This way you can call the code in On_Bn_Clicked() from anywhere in your program.
Just call On_Bn_Clicked() directly from your code. There is no harm in doing so. (I suppose you don't want to actually click the hidden button with the mouse...)

Trigger Gallery OnFling without GUI Input

How can you trigger an onFling() without the user actually touching the device?
Actually my need is a little different than that. I have a horizontally-scrolling Gallery, and below that is a row of buttons. I want the user to be able to advance the gallery to the next View just by tapping a bottom-row button. Let's call this method next().
I envision calling the next() from the OnClickListener.
As it happens, there is a method available to Gallery. It is setSelected(int index).

Tree Show toolTip during drag

I am denying a user the ability to drop into my tree during certain conditions, it's all going well, but I want to tell the user why I'm denying the drop. I would prefer to do it with a toolTip, but it doesn't seem to work. Can I not have a toolTip during a drag operation? How can I force one?
Flex seems to treat toolTips as a property of the UI component, with the component deciding when and if to show it. I would like it to force it to be like doing one in javaScript where it was always just like saying "Show it now" "stop showing it now"
Does anyone know about doing this during drag?
Thanks
~Mike
What you could try is to show the tooltip yourself with the mx.managers.ToolTipManager. Create for example a VBox that implements mx.controls.ToolTip and displays the message you want to show to the user.
You can see a working example at FlexExamples.
Another idea is to show a programmatic mouse cursor when the drop is denied. I've just read an article about that on Inside Ria.

Resources