is it possible to use the wheel button without using freeglut? - glut

I've heard somewhere that it's possible to use the wheel button by comparing the button variable to (3 / 4), but it seems that no events are triggered whenever i spin the wheel button.
what am i doing wrong here? i'm trying to avoid freeglut.

If you want to use the middle button, you can try GetAsyncKeyState()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspx
Example:
//Test if middle mouse button is pressed
if(GetAsyncKeyState(4)<-30000){
//do something
}

Related

How to hide a keypad for IOS in Titanium without using 'blur'

Can anyone please let me know how to hide the keypad without using 'blur' in titanium for IOS.
My scenario is I have a textfield, When I scan an item, that value will be shown on textfield. When textfield is focused, the scanner will be activated. In this scenario i need to focus the textfield, but should not show the keypad.
Can any one please share your ideas.
Thanks,
Swathi.
There is no possibility to hide keypad when textfield is focused on iOS. It is a system thing.
I think your approach is wrong. Why do you need textfield if you don't want to type text there?
Instead of it:
- create label (or label inside view) with proper background (looking like textfield),
- add 'click' event which will start scanning (i suppose you have that functionality for 'focus' event),
- if you need cursor blinking than create animation next to label.

How to create toggle buttons in Windows 8?

I need to create a group of 5 buttons. Only one can be pressed, like Radio Button, but I do not want to show the circle. I would like to use the button look.
Somebody do know which is the best way to do it?
I have found for WPF:
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" />
but it does not work for Windows 8.
Thank you
Is this a group of actual buttons with an action assigned to the click event of each, or are you just trying to remove the circle form a RadioButton type control?
Please note that the user will likely expect a RadioButton control to look and feel like a RadioButton. Changing this just for the sake of it may not be a good idea, but if you want to go ahead with it you could try one of the following options.
1) Edit the template for a radiobutton control to hide the selcetion circle. (I don't know if that's even possible in all honesty, but in theory, it should be)
or
2) Emulate the behaviour with a ListView with SelctionMode set to "Single"
Things get a little more complicated if you want to handle click events on each "button", but it is not impossible. In your ItemTemplate, add a button (presumable with a style of "TextButtonStyle") and set the event handler of the Click event to check which button was pressed and act accordingly.
There is a control called ToggleButton, why don't you use that?

On Mouse over / on Getting focus, The Button Disappers in windows 8 metro app, How to disable that effect?

In Many places in my application i am using buttons in the UI but my doubt is :-
1)when a button gets focus or when it is getting mouse over also , the button background disappears (i.e, it becomes invisible at that time),
After again coming away from button (button losing focus) it shows up the button as usual
so , On mouse over / Getting focus the button behaves in this way.
What should i do if i dont want this effect. Please let me know .
2)i might be wrong, but my guess is that there should be some visual state property behind this , which i need to disable , but i dont know where where to disable ?? , please let me know it .
Thanks in advance.
I believe you will need to retemplate the control so that you can override the visual states. You can do this easily inside Blend by right clicking in it and choosing to edit a copy of the style.

cocoa mousedown on a window and mouse up in another

I am developping a Cocoa application and I have a special need. In my main window, when I mouse down on a certain area, a new window (like a complex tooltip) appears. I want to be able to do:
- mouse down on the main window (mouse button stay pressed)
- user moves the mouse on the "tooltip" window and mouseup on it.
My issue is that the tooltip window does nto get any mousevent until the mouseup.
How can I fix this?
Thanks in advance for your help,
Regards,
And it won't since mouse is tracked by the main window. However, you can process mouseUp in the main window, transform click coordinates into the desktop space, get tooltip window frame and check whether the click occurred on the tooltip. After that, you can send a message to the tooltip window manually.
Or you can try to find another way to implement the final goal :) It is usually better to follow the rules, in this case - mouse tracking.

Simulate Winforms Button Click Animation

I have a button and inside my button I have an image control. When the users click on the image I'd like to animate the button so it appears the button was pressed. I don't really care whether the actual button press event fires or not--it's the illusion of a button press I want to see.
Note: the only options I see on the web involve writing directly to the Windows API--a level of complexity and non-upgradability I really don't want to get into.
Why not just use two different images, one for a normal state, and another for when your button is being pressed.
If you want to go for more complicated route try using GDI+. Here is a quick sample tutorial on how to do this.
Why are you using an image control inside your button control instead of using the button control's Image property?
Using the Image property of the button will give you a button with an image that the user can press and that will raise the OnClick event without doing any extra work or re-implementing features that are already available.
I ended up making my picturbox look like a button by giving it a raised border style. Then on the mouseclick event I simulate the look of a button press by changing the border style for a few hundred miliseconds.
Private Sub simulateButtonPress(ByRef pictureBox As Infragistics.Win.UltraWinEditors.UltraPictureBox)
pictureBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
Application.DoEvents()
System.Threading.Thread.Sleep(400)
pictureBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Raised
Application.DoEvents()
End Sub