• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best way to implement a calculator style display/input system?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to implement a calculator style display/input system?


  • Subject: Re: Best way to implement a calculator style display/input system?
  • From: "Mark A. Stratman" <email@hidden>
  • Date: Wed, 23 Jun 2004 20:34:28 -0500

Instead of an NSTextView, you could use an NSTextField like the ones in Interface Builder for labels (this will get rid of the insertion point, but you lose a lot of the NSTextView's functionality).

For the input control, I would probably just use buttons and call setKeyEquivalent: on each of them. If it's going to be a more dynamic layout, you could use an NSMatrix with buttons in the cells.
Tracking key events at the window seems a bit overkill, but it obviously depends on how complex the interface is going to be.

- Mark

On Jun 23, 2004, at 7:53 PM, Dave Camp wrote:

I was wondering if anyone might have suggestions for the best way to implement a "calculator" style (for lack of a better term) text display and input handler.

My app has a view like the standard Calculator app with a colored background and text and numbers displayed on top of that. I essentially want the user to be able to press keys and have the corresponding characters appended to the display and have the delete key work as well. Like the Calculator app, there are no visual indicators for the insertion point or focus.

My first thought was to have the window delegate implement keydown: and tack printable characters onto the end of a NSTextField. I would have to manually handle the delete key and remove characters as needed.

However, I thought a cleaner design might be possible with an NSTextView if there was an easy way to make it not display the focus ring and insertion point, and have it always be the first responder. It seems like it would be preferable to allow the text system to perform all the key event processing for me.

Any suggestions?

Dave
---
In English, every word can be verbed.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Best way to implement a calculator style display/input system? (From: Dave Camp <email@hidden>)

  • Prev by Date: Re: Best way to implement a calculator style display/input system?
  • Next by Date: multiple windowcontrollers
  • Previous by thread: Re: Best way to implement a calculator style display/input system?
  • Next by thread: Custom IB Palettes with Outlets and Actions
  • Index(es):
    • Date
    • Thread