• 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: Tableviews like Excel ones
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tableviews like Excel ones


  • Subject: Re: Tableviews like Excel ones
  • From: Andre <email@hidden>
  • Date: Wed, 31 Aug 2005 12:58:29 +0900

I've done one myself, I could send the code but its pretty flakey right now...
Its a complete subclass of NSTableview, though most of all the methods are overridden!
I'm not sure its even a NSTableView subclass anymore...


It can be done, but speed will be slow until you override the layout methods (row column calculation) and
avoid NSTableColumn as much as possible....


If you planned it right (like I didn't) you could have a killer spreadsheet app.

- Cocoa text drawing is very costly when you have large numbers of cells, even when being smart about the region updated. I ended up having to go directly to ATSUI in order to achieve acceptable text drawing speeds.
Well, I found text drawing to be fine using NSTextfieldCell... I found the bottleneck to be layout methods... but everyone has their opinion...

In any case, be prepared to fight NSTextView behavior... a lot.
Specifically selection is row/column only, so is copying etc, its a lot of work, almost as much as making it yourself...


On 平成 17/08/31, at 10:48, Ryan Britton wrote:

In my case, I did a complete custom view. There were three main components to it: WorksheetCell, Worksheet, and Spreadsheet. Worksheet was much like NSTableView is in that it was composed of an actual content view in a wrapper scroll view that provided "rulers" for both horizontal and vertical that acted as the row and column markers (here is where NSTableView would be a pain because it does not provide row markers).

I no longer have that code or I'd be willing to provide something for an example though. I do have a few warnings though:

- Cocoa text drawing is very costly when you have large numbers of cells, even when being smart about the region updated. I ended up having to go directly to ATSUI in order to achieve acceptable text drawing speeds.

- Ditto for Cocoa drawing. I used the CG* functions directly instead and pre-rendered images where I could get away with it.




Here are a few of the early rendering pictures if you're curious:

http://www.vector-inc.com/images/spreadsheet.png
http://www.vector-inc.com/images/spreadsheet2.png
http://www.vector-inc.com/images/spreadsheet3.png
http://www.vector-inc.com/images/spreadsheet4.png


On Aug 30, 2005, at 5:39 PM, Manfred Bergmann wrote:



Am 31.08.2005 um 10:27 schrieb Ryan Britton:



NSMatrix as it stands is not a good choice for this unless you subclass and override some stuff. I've tried it for exactly this purpose and its behaviors do not coincide with spreadsheet behaviors. For one, NSMatrix allows non-contiguous selections where a normal spreadsheet does not. NSMatrix also has some oddities when it comes to cell size. I found it easier to write a custom class that did only what I needed.



Did you implement a complete custom class or a subclass of NSTableView?



cya, Manfred






On Aug 30, 2005, at 3:24 PM, Sanri Parov wrote:




On Wed, 31 Aug 2005 08:01:41 +1000, Manfred Bergmann wrote:




Hi Sanri.

I'm thinking of doing something like this, too.
But I guess this is not posible with a plain NSTableView.
I thought of making it with a NSMatrix where you can use any kind of
data cell.
You can respond on the Key events to do the navigation you want.






[homerSimpsonVoice:TRUE]

"mmmmmhhhhhh ... NSMatrix... sounds good, but it doesn't have any IB
palette or something similar to easily figure out what to do.
Are there good, and PLAIN, SIMPLE examples on how to use it?
Sorry Apple, but when it comes to PLAIN AND SIMPLE source code, you're
not the no. 1 :-((


[homerSimpsonVoice:FALSE]

--
Sanri Parov






_______________________________________________ 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


_______________________________________________ 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
  • Follow-Ups:
    • Re: Tableviews like Excel ones
      • From: Sanri Parov <email@hidden>
References: 
 >Tableviews like Excel ones (From: email@hidden)
 >Re: Tableviews like Excel ones (From: Manfred Bergmann <email@hidden>)
 >Re: Tableviews like Excel ones (From: Sanri Parov <email@hidden>)
 >Re: Tableviews like Excel ones (From: Ryan Britton <email@hidden>)
 >Re: Tableviews like Excel ones (From: Manfred Bergmann <email@hidden>)
 >Re: Tableviews like Excel ones (From: Ryan Britton <email@hidden>)

  • Prev by Date: Re: NSTextView auto scroll up behaviour
  • Next by Date: Re: NSTextView auto scroll up behaviour
  • Previous by thread: Re: Tableviews like Excel ones
  • Next by thread: Re: Tableviews like Excel ones
  • Index(es):
    • Date
    • Thread