Giter Club home page Giter Club logo

fafoutlineview's Introduction

FAFOutlineView

Introduction

In the course of my programming activities, I have found that I tend to use outline views quite frequently, and am often having to deal with the same issues each time:

  • NSOutlineView auto-expands items on receiving drags, and this is often undesirable, not to mention having too short a timing delay.
  • NSOutlineView is missing (at least under Tiger) Finder-style 'long-click' renaming.
  • NSOutlineViews don't support representing the same model object in more than one place in the same outline view.

FAFOutlineView addresses these deficiencies, as well as adding a couple bonus points:

  • label colored rows,
  • column-spanning row cells,
  • a better controller model.

FAFOutlineView is used for both table views and outline views.

FAFOutlineView uses a very different data source and delegate methodology than NSOutlineView, so I highly recommend using FAFOutlineView only on new projects, until you are familiar with how it works. Trying to replace NSOutlineView with FAFOutlineView on existing projects is error prone.

Status

This project is early beta. The structure is stable but the API will be adjusted, and there are no doubt unexplored bugs. There are no formal tests, however as I use it for all my outline and table views, it does get heavy end-use testing. It is being used and working in both code-created, and nib-loaded forms. Deployment Target is 10.4.

DataSource and Delegation Methodology

FAFOutlineView decentralizes the NSOutlineView datasourcing. There is a controller object paired up with each model object. A default controller object (FAFOutlineViewItem) is provided for use with NSString, NSArray, and NSDictionary model objects, but can be subclassed for custom model objects. The delegate must provide a root item and that root item (controller object) and its children then on act as the data source for their represented object. Drag-and-drop is still handled by the outline view delegate.

Basic Setup

  • Create your usual NSOutlineView in your nib or code as usual, substituting FAFOutlineView for NSOutlineView;
  • call [code] -[FAFOutlineView setRootItem:(FAFOutlineViewItem*) rootItem];[/code] with the root item of your choice.
  • call [code] -[FAFOutlineView setDelegate:(id) object];[/code] with the delegate of your choice.

Other configuration options can be gleaned from the generated class documentation.

Licensing

This project is licensed under the BSD-3-clause. However, some segments of the code borrowed from others may be obtainable from the original authors under less restrictive licensing:

fafoutlineview's People

Contributors

mhfadams avatar

Watchers

James Cloos avatar Roche avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.