Giter Site home page Giter Site logo

brunophilipe / itsidebar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iluuu1994/itsidebar

3.0 2.0 0.0 419 KB

ITSidebar is a control for Mac OS X similar to the one of Sparrow

Home Page: http://www.twitter.com/ilijatovilo

Objective-C 92.14% C++ 7.86%

itsidebar's Introduction

ITSidebar

ITSidebar is outdated and thus shouldn't be used in new projects anymore. It heavily depends on NSMatrix and NSCell which are both soon to be deprecated. Just use an NSTableView or JNWCollectionView.

I'm planning on making a v2.0 of ITSidebar but that might take a while.


ITSidebar is a very lightweight control for Mac OS X. You can create sidebars similar to the one of Sparrow.

Why would I want to use this?

ITSidebar is:

  • Highly customizable
  • Lightning-fast
  • Completly free to use

Usage

Copy files

Copy the following files:

  • ITSidebar.h
  • ITSidebar.m
  • ITSidebarItemCell.h
  • ITSidebarItemCell.m
  • ITLeakWarningHelper.h

Make sure to copy them to the project, and to add them to the target. Please use your own images for the button cells.

Use in a project

Make sure to check out the sample project. First, drag a NSScrollView onto your window. Then, select the document view, and set its custom class to ITSidebar.

Now you can connect an outlet to it, and use the following methods:

// Add/Remove Cells
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image target:(id)target action:(SEL)action;
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage target:(id)target action:(SEL)action;

- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image;
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage;

- (void)removeRow:(NSInteger)row;

// Select Cells
- (void)setSelectedIndex:(int)selectedIndex;
- (void)deselectAllItems;

// Customisation
- (void)setCellSize:(NSSize)cellSize;
- (void)setBackgroundColor:(NSColor *)backgroundColor;
- (void)setScrollerKnobStyle:(NSScrollerKnobStyle)knobStyle;

- (ITSidebarItemCell *)selectedItem;
- (int)selectedIndex;

+ (Class)sidebarItemCellClass;

For subclassing and customisation, check out the example.

License

Copyright (c) 2013 - 2014, Ilija Tovilo
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the organization nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Help

If you have any questions, feel free to let me know at [email protected]

itsidebar's People

Contributors

iluuu1994 avatar emiscience avatar brunophilipe avatar romanroibu avatar

Stargazers

idoxtreme avatar Larah avatar Carlos avatar

Watchers

 avatar  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.