Can the clicking sound of UIDatePicker be disabled? - uidatepicker

I'm not sure if I am overlooking an obvious setting, but is there a way to disable the clicking of a UIDatePicker when the value of the date picker is changed (by the user of programmatically)?
During my search, I have come across an undocumented method, but that is not what I am planning to adopt.

At the time of writing, it seems that the clicks generated by UIPickerView can only be disabled by the user in the global settings of the device. This also disables the keyboard clicks as a result. A similar questions was asked here.

Related

Visually indicating the active control (for controls that don’t show focus rect)

I’m writing a little Windows application which has two list-view-controls. I have set it up so that the user can tab (focus) between the two, but I need a way of visually indicating which is the active control. I don’t want to go to the trouble of messing with owner-drawn controls, so I experimented with some of the different window styles like border and client edge, but none look good. I decided to toggle the disabled property because it looks best and is easy to use.
The problem now is that I have the controls set up so that whenever the user clicks on either one, it grabs the focus (calls SetFocus(), sets a handle to itself, etc.) but of course, disabled controls don’t get event notifications like mouse clicks.
Does anyone have a suggestion on how I can retain the visual distinction of the active control and also be able to toggle the active window with the mouse?
Hans’ suggestion of using CTRLCOLOR reminded me of using that a long time ago to easily make some changes to the colors of controls which then reminded me of CustomDraw.
I decided to use CustomDraw to indicate the currently active control because it is even easier, and yet provides even better control.

Prevent the SIP/Soft Keyboard from popping up when a TextBox get focus

In my Windows Phone 7 Silverlight application I have my own custom keypad that I want to use instead of the standard soft keyboard. The problem that I have is that I have not found a way to completely disable or prevent the SIP/Soft Keyboard for my application or for the TextBox component.
Is it possible to disable the soft input keyboard in my application?
Is it possible to prevent the soft input keyboard from popping up when a TextBox get focus?
Can I extend or override any functions in TextBox to make it behave the way I want?
I’ve seen solutions how to hide the keyboard when a certain key is entered by moving focus off the TextBox but I want to prevent it from ever showing up.
My problem is very similar to what's stated on How do I prevent the software keyboard from popping up? and How to prevent keyboard to show in EditText onTouch? but for Windows Phone 7 instead.
I am fully aware that some may think it is stupid to use your own keypad instead of the standard input but I have my reasons for doing it this way and I just want to know if it is possible to achieve what's described.
If you don't want to use the SIP, you don't need a TextBox.
Use a TextBlock and bind it to the input generated by the custom buttons.
Have a look at this blog post http://www.silverlightshow.net/items/Windows-Phone-7-Creating-Custom-Keyboard.aspx
Peter, consider using THIS, with customizations. I'm working in a project where we use a custom keyboard. With some extra codes and customizations I've made a custom softkeyboard, as you can see in the screenshot bellow. Right now, my softkeyboard is working properly, but with some issues to be resolved yet.
My custom WP keyboard problems are:
There's no caret cursor;
The TextBox in my screen is a AutoCompleteBox, and when it opens the completions, my keyboard loses focus, and so I need an extra tap (this is my greates problem now)
WP native keyboard try to slide up when I choose an item within the completions
IsHitTestVisble =false solve your issue

Disabling the auto-hiding of scroll bars on Lion

In Mac Lion, the scroll bar hides itself after a few seconds if no activity occurs. I have written an apple script to modify that behavior. I have to turn on the radio button every time my app launches. My question is, I have a cocoa application. Is it possible to keep the scroll enabled for the application always with out having to change the settings in system preferences.I don't want to enable for all the other apps always. And is the only way via the applescript. Or is there a defaults write to enable the scroll bars in lion ?.
I don't know about a defaults key to set up the style.
When you change the Appearance preference panel's "Show scroll bars", all the NSScrollView instances are notified and receive a setScrollerStyle: with the new style (through the NSPreferredScrollerStyleDidChangeNotification notification).
You can achieve the same result by explictly calling setScrollerStyle: on the NSScrollView with the NSScrollerStyleLegacy scroller style.
You can write to defaults to accomplish this.
The key is AppleShowScrollBars and it has three possible values:
Automatic
WhenScrolling
Always
To set it system-wide from the command line, you could do:
defaults write -g AppleShowScrollBars Always
It can also be done programmatically by modifying preferences in any of various ways. It can get a little tricky depending on application sandboxing. This blog post explains it in more detail.

Enable interaction with NSWindow when sheet is opened

I'm creating an app that calls a sheet, however, the interaction with the window must stay enabled while the sheet is open. Here's a mock-up:
The user must be able to use the play and record buttons. Does anyone knows a way to keep it enabled?
This seems a slightly questionable UI. But if you really want to do it, think the only solution will be to either:
Subclass NSWindow to force handling of the events
Run the event loop for that window while the sheet is visible, and dispatch desired events yourself
Sheets are intentionally designed to block interaction with the window they're attached to. If you don't want that behavior, you shouldn't be using a sheet.

How do I get keyboard events in an NSStatusWindowLevel window while my application is not frontmost?

After creating a translucent window (based on example code by Matt Gemmell) I want to get keyboard events in this window. It seems that there are only keyboard events when my application is the active application while I want keyboard events even when my application isn't active but the window is visible.
Basically I want behavior like that provided by the Quicksilver application (by blacktree).
Does anybody have any hints on how to do this?
There are two options:
Use GetEventMonitorTarget() with a tacked-on Carbon run loop to grab keyboard events. Sample code is available on this page at CocoaDev.
Register an event trap with CGEventTapCreate. Sample code can be found in this thread from the Apple developer mailing list.
Edit: Note that these methods only work if you check off “Enable access for assistive devices” in the Universal Access preference pane.
A simpler route that may work better for you is to make your app background-only. The discussion on CocoaDev of the LSUIElement plist key explains how to set it up. Basically, your application will not appear in the dock or the app switcher, and will not replace the current application's menu bar when activated. From a user perspective it's never the 'active' application, but any windows you open can get activated and respond to events normally. The only caveat is that you'll never get to show your menu bar, so you'll probably have to set up an NSStatusItem (one of those icon menus that show up on the right side of the menu bar) to control (i.e. quit, bring up prefs, etc.) your application.
Edit: I completely forgot about the Non-Activating Panel checkbox in Interface Builder. You need to use an NSPanel instead of an NSWindow to get this choice. This setting lets your panel accept clicks and keyboard input without activating your application. I'm betting that some mix of this setting and the Carbon Hot Keys API is what QuickSilver is using for their UI.
Update:
Apple actually seems to have changed everything again starting with 10.5 BTW (I recently upgraded and my sample code did not work as before).
Now you can indeed only capture keydown events setting up an event tap if you are either root or assistive devices are enabled, regardless on which level you plan to capture and regardless if you selected to capture (which allows you to modify and even discard events) or to be listen only. You can still get information when flags have changed (actually even change these) and other events, but keydown under no other circumstances.
However, using the carbon event handler and the method RegisterEventHotKey() allows you to register a hotkey and you'll get notified when it is pressed, you neither need to be root for that nor do you need anything like assistive devices enabled. I think Quicksilver is probably doing it that way.

Resources