简体   繁体   中英

NSMatrix for spreadsheet implementation?

Okay, so I'd like to implement something similar to this image using NSMatrix.

在此处输入图片说明

My "table" will be large (scrollable in both directions).

I realize the prerequisite that NSMatrix cells are all the same size.

Here's a proposed solution:

  1. The white cells comprise the main NSMatrix
  2. The top row of dark gray header cells (except the leftmost one), are another NSMatrix
  3. The leftmost column of cells (including the top one), are another NSMatrix.

I would embed the white cells in a NSClipView/NSScrollView, with visible scrollers. I would also embed the top and left matrices similarly but with separate NSClipView/NSScrollView pairs, without visible scrollers.

Then, the main visible NSScrollView would notify the other NSScrollView's of movement as appropriate.

Is this a typical solution to this issue? Or is there some other custom-ish view I'm unaware of?

One other thing: if the content of the main NSMatrix is bound to an NSArrayController, how is the 2D-ness of the matrix fleshed out with a single-dimension NSArray?

确实有一些自定义的视图: LIGridControlMBTableGrid

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM