Distinguish buttons in swt spinner - swt

I need to understand what button was pressed on the swt spinner. I tried adding listeners to swt events, but the verify, modify and selection events seem to have the same values regardless of the button pressed. The idea of getting the MouseDown coordinates and checking the vertical coordinate doesn't seems right.
Thanks,
Nik

Related

Button with lost focus using PerspectiveTrasnform

Well, I make a Pane based on an example of JavaFX samples (Display Shelf), I put Panes with Labels, Buttons, ComboBox, TableView where's the ImageView. It is working, when I click on Pane, it does the animation correctly, but the buttons that I put in vertical on Right of Pane, receive the focus out of where they are. When I move the mouse button, nothing happens, but if I move the mouse to down of it, I can click in the button that so reveice the focus. The local where I have to move the mouse to button to receive the focus is increasingly far (down) if the button is below the other.
I'm using the Perspective Transform of JavaEX and all is in JavaFX Samples, just changed some params of size (width and height). This effect may be interfering in focus? Or can be another problem? If anyone already had this problem please help me. Thanks.

Untoggle all figure toolbar buttons

I want to add a new toggle button to the figure toolbar. When it is clicked, I want to "untoggle" any other buttons that were toggled. E.g, if the "rotation" or "zoom" toggle buttons were pressed, I want to untoggle them and their effect.
Simply getting all their handles does not work, as this does not deactivate their effect.
You should first find all of the children of toolbar. You can do it by the following command (Assuming that currentToggleButton is a handle to current toggle button):
get( get(currentToggleButton,'Parent'),'Children');
Then do the following:
set(children,'State','off');
Of course, you need to return the state of your current button to on.
set(currentToggleButton,'State','on');
By the way, if you are using GUIDE, you can add zoom,rotate and pan as pre-defined tools. In that case, Matlab will handle the toggling automatically.
In order to turn off the effect of zooming/pan/rotation, you can do:
zoom('off')
pan('off')
rotate3d('off')
or you can use another syntax version (as #Eitan also mentions)
zoom off
pan off
rotate3d off

GWT cells selection

I wish to make a drag and select application in GWT where I wish to have cell table or grid of say 20*100 columns*rows. I want to add a event such that I can drag something like a rectangle with my mouse and all the cells in that region get selected or I can fire an event for each cell and assign each of them a same ID. The main idea behind the thing is to perform a selection by dragging and then grouping all selected cells as one, something like Excel sheet selection. Can any one help me out in this?
I have once implemented GWT widget allowing to "select" some rectangular region of a table. Basically the idea was to subclass a Grid or FlexTable and do all the logic in various mouse event handlers (mouse down, mouse up, mouse out, mouse over).
The only minor hack I had to introduce was a method for getting the cell for any mouse event. There is a method HTMLTable#getCellForEvent that works for a click event, but when I looked into implementation of this method, I saw that it could actually work for any event, so I just implemented my own method for getting cell for any mouse event based on mentioned implementation.
Maybe it would be also possible to achieve this using HTMLTable#getEventTargetCell

how to do tooltip on button in iphone?

I am having download icon on my page i want that when the user takes his finger over the button a tooltip should show as showing download in text.
is there any option in iphone to show a tooltip???
Dan is absolutely right on how to do it but I'd answer you should rethink your design to not need the tooltip at all.
There's a reason that there isn't one by default - what if the user presses down on the button to see what it does, reads the tooltip and realises that's not what they want. They then have to be very careful not to let go while still over the button or it will press and do the wrong thing. (And most users don't know that they can press down over a button, move their finger off it and release it to cancel the press.)
You should rethink your design to make it obvious what the buttons do without the user having to interact with them first.
However, if you definitely still want a tooltip, Dan's method is fine.
Nothing built-in, no. If you think about it, generally a tooltip appears when you mouse over the target item. There's no "mousing over" with a touch interface.
You can definitely roll your own, though. Start by placing a view containing your tooltip contents exactly where you want it with an alpha of 0%. Make a custom button with no content that outlines your download icon, and hook its "touch down inside" action to a method that animates the tooltip view to an alpha of 100%. Hook your button's "touch up inside" , "touch down outside" and "touch up outside" actions (and maybe some others--you might want to experiment with that) to a method that animates the tooltip view back to an alpha of 0%.
There isn't native support for this in iOS. But you can create your own.
I ended up creating my custom tooltip/popover class.
Can be initalised with any content view and dynamically adjusts it's frame.
Hope it helps.
https://github.com/akeara/AKETooltip

which UIButton event can act as a mouse over event like in flash

i would like to create a UIButton it will zoom in when mouse over it,can anyone tell me which event can do this
There is no mouse, only touches. How can you hover over a button without tapping it on a touch based interface? I dont think it works the way you think it does.
Hop into interface builder. Drop in a button and look in the attribute window.
You'll see the section that has Title: Image: Background. If you click on the drop down that says 'ALL', you can select several button states and set them accordingly. Use the highlighted state for when the user presses down on the button.
This should get you to understand how it works. You can dig into the docs to find out how to do it programaticaly from there.
Hover on the iPhone is a touch. Unless you're tracking where the finger is and you want objects to react when you enter their bounds. But the highlighted state should get you there.