-
NSTextField's lack of filter capabilities
I love Cocoa, but it seems that some simple things are missing. For example, NSTextField doesn't have the ability to filter text input as the user is typing. A friend reminded me that this is a feature that PowerPlant had ages ago. Cocoa has NSFormatters which allow the field to be validated after text is input, but in many cases, the right way to restrict input is to prevent it from being typed. I like NSFormatters and have created a very complex one to handle multiple currencies in ReceiptWallet, but I realized I needed something else.
So, I present FilteringTextField. The attached code can be freely used in commercial and non-commercial projects. While I'd like some credit in the about box, it isn't necessary. This code has no warranty and you assume all risk for using it.
The subclass of NSTextField, has 3 methods.
- (void) setAcceptableCharacterSet:(NSCharacterSet *) inCharacterSet; - (void) setMaximumLength:(int) inLength; - (void) setMaximumValue:(int) inValue;
The first lets you set the characters that can be typed; anything that isn't in the set is eaten. The second, only allows x characters to be typed and the last limits the value if the user is typing in a number. This class can easily be extended to handle other constraints. Pasting in text is also filtered.
If anyone finds problems with this code, please let me know.
-
Cool Cheap Camcorder
Last Sunday, I saw on Richard Wanderman's blog a note about David Pogue's review of the Flip Ultra. Last year I was contemplating getting an HD video camera to record our son's first year and eventually his first steps. I spent a long time researching and thinking about it. I was about to purchase one, but decided against it as it isn't all that convenient to use any camcorder.
When I saw the Flip Ultra, I said cool. The resolution, 640x480 is four times the resolution of the video clips on our digital camera, so what did I have to lose in getting one. I ordered on Sunday from Amazon for about $142 and received it yesterday. It is so easy to use, it's unbelievable. I've only taken a few clips with it, but I can see us using it a lot and hopefully we'll always have it handy to record our son.
The only downside I see right now is that it uses the 3ivx codec. Why is that a problem? Well, if you want to playback the video, you have to install the codec and if we want to post video online, others have to also download the codec which isn't all that easy for novices. However, since I have QuickTime Pro, I can export video to H.264 which pretty much everyone can view these days. (I realized today why they chose 3ivx; it has to do with money. The H.264 and AAC codecs could amount to several dollars per unit shipped and with the Flip Ultra costing $140, a few dollars can make a huge difference.)
I think that I'm going to be quite happy with this as the main purpose was to shoot better video than what our digital camera does and at the resolution it does, it easily meets that requirement.
-
Oh the irony
Today I was digging through some files in my file cabinet looking for my business tax certificate. I mentioned this to a friend and he said "You do realize the irony here, right?". Yeah, I realize that I've written this awesome program for dealing with documents and here I am digging through paper. I do have a good reason for this. I like to keep my business and personal documents separate, so I never scanned in my business documents into DocumentWallet and didn't scan my receipts into ReceiptWallet. Now that ReceiptWallet handles multiple libraries, separating business and personal is quite simple, so I've begun to put business documents into a separate ReceiptWallet document library.
Before ReceiptWallet 2.0, doing this was not very practical. While there have been some user rumblings about some of the ReceiptWallet 2.0 changes including multiple libraries, this experience shows me that the multiple library decision was definitely a correct one. It may take some time for users to get used to multiple libraries, but in the end, I think that users will find many uses for them.
-
Can't buy reviews like this!
A few friends of mine pointed me to a ReceiptWallet review today over at The Apple Blog. I had no idea that a review was being written and that it would be so glowing! While the user base of ReceiptWallet is increasing, I usually don't hear from users unless they are having problems. Reading reviews like this makes me smile and know that all my hard work is appreciated.
Any other reviews out there? Let me know.