• 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: Can I subclass text field in NSForm? Drawing 3D rectangle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I subclass text field in NSForm? Drawing 3D rectangle


  • Subject: Re: Can I subclass text field in NSForm? Drawing 3D rectangle
  • From: Magnus Strand <email@hidden>
  • Date: Wed, 19 Jan 2005 11:58:52 +0100

Hi Uli!

Thanks!

I am making my own Custom Field Editor now.
I will try to catch keyDown messages with it.

Regards,
Magnus



M. Uli Kusterer wrote:

At 12:26 Uhr +0100 18.01.2005, Magnus Strand wrote:

I would like to know if I can I subclass the text fields in NSForm?
I would like to use my own subclass of NSTextView.


An NSForm contains NSTextFieldCells. So, either set it to use your custom cell subclass, or replace the field editor for your window with your NSTextView subclass.

I also wonder how to draw a 3d rectangle that NSTextField has as frame?


There's no Cocoa API that does this correctly right now. There is a function to draw a next-style text field box, but that looks different enough from Aqua's that it doesn't really work.

You can, however, use Carbon APIs to do this. There's the older Appearance APIs (which would require you to set up a Quickdraw port for the current Quartz graphics context, though). If you can require 10.3 (or maybe it's already in 10.2), you could use the HIToolbox's HIThemeDraw APIs. Those take a Quartz CGContext and give you a lot of flexibility for drawing edit field boxes, slider and scrollbar parts etc.



-- Med vänliga hälsningar

Magnus Strand
System Developer, MSc

email@hidden
Direct: +46 40 601 57 16
Office: +46 40 601 57 00
Mobile: +46 704 20 57 16

Teknik i Media AB
Södra Förstadsgatan 2
SE-211 43 Malmö
Sweden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Can I subclass text field in NSForm? Drawing 3D rectangle (From: Magnus Strand <email@hidden>)
 >Re: Can I subclass text field in NSForm? Drawing 3D rectangle (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Dragging of messages from Mail
  • Next by Date: Re: development / deployment
  • Previous by thread: Re: Can I subclass text field in NSForm? Drawing 3D rectangle
  • Next by thread: dismissing one sheet for another problem
  • Index(es):
    • Date
    • Thread