THCanvasView 1.0.1 and PhotoStacks Sample App

The newest version of THCanvasView adds some obvious features, such as draggable selection rects and basic item arranging. There are now better options for coloring and the generated image previews get frames and drop shadows.

Selection Rect


Downloads: THCanvasView 1.0.1 (32k) | THCanvasView + PhotoStacks (140k)

THCanvasView 1.0.1 changes:

- Added framing and shadowing to image preview generation
- Added basic item arranging
- Added basic support for selections via Cocoa Bindings
- Added draggable selection rects, aka "rubber band" selection
- Added support for changing background color
- Added support for changing item label color
- Added optional shadowing for item label text
- Added "properties" dictionary to THCanvasItem to support image previews
- Minor drawing optimizations
- The ".app" extension is now hidden in app packages
- Fixed a bug where items could get "caught" during a drag

There's also a new sample app, PhotoStacks. The idea here is mostly to highlight that the view can be used for more than just Finder icons. It's a pretty simple app which accepts dropped photos which can be arranged manually or automatically. When you click an item you get a larger image preview to the right.

Arrange Items


PhotoStacks


Enjoy.
Design Element
THCanvasView 1.0.1 and PhotoStacks Sample App
Posted Oct 14, 2007 — 11 comments below




 

Volker — Oct 15, 07 4742

Just one word: Cool!

Rup — Oct 15, 07 4743

Scott,
As THCanvasView seems not to have been just a one-shot deal, I will add my own requirement : could you add right-click contextual menus ?

Great job, thanks for the contribution.
Rup

Scott Stevenson — Oct 16, 07 4744 Scotty the Leopard

I will add my own requirement : could you add right-click contextual menus

Yes, although it's not completely clear to me what the content should be. It seems that's usually application-specific?

Blain — Oct 16, 07 4756

Yes, although it's not completely clear to me what the content should be. It seems that's usually application-specific?

As it's a NSView subclass, wouldn't it already have a menu outlet? And you could always subclass THCanvasView and override -menuForEvent:. But all the cool kids use delegates.

- (NSMenu *)menuForEvent:(NSEvent *)theEvent; { if ((_delegate != nil) && ([_delegate respondsToSelector:@selector(canvasView:menuForEvent:)]) { return [_delegate canvasView: self menuForEvent: theEvent]; } return [super menuForEvent:theEvent]; }

Adding delegate accessors is left as an exercise to the reader.

britt — Oct 18, 07 4770

Um... are you going to add core animation to this? If not, I will; but I don't want to be duplicating effort...

Also, the other things I need to add are support for keeping things sorted after the user drags in an icon, snap-to-grid, and scaling of icons & grid.


P.s. obviously, I can't release any of my changes until after Leopard goes public; but I will post them afterwords.

Scott Stevenson — Oct 18, 07 4771 Scotty the Leopard

@britt: Um... are you going to add core animation to this? If not, I will; but I don't want to be duplicating effort...

I did start looking at doing that, yes. I may not be any further along than you, though.

britt — Oct 18, 07 4772

Well, considering that I haven't coded any modifications to THCanvasView yet, but did read most of the source, and I *have* been mucking about with core animation... we're probbably about even.... :-)

So... who want's to tackle what? As I said; I'm happy to do it all, or none of it; just tell me which bits you are gonna' do, and I'll do the rest...


:-)

Scott Stevenson — Oct 18, 07 4773 Scotty the Leopard

@britt: So... who want's to tackle what? As I said; I'm happy to do it all, or none of it; just tell me which bits you are gonna' do, and I'll do the rest...

My plan is to first do a rewrite using layers, and then look at what that opens up. If you want to ride the wave, I'd say wait just about 10-14 days. If you want to share anything prior to that, feel free to email it to me.

For what it's worth, I think it will be a interesting case study of contrast between Tiger and Leopard drawing.

britt — Oct 18, 07 4775

Cool. For right now I'll focus on the other stuff; my first delta should be winging it's way to your mailbox soon...

:-)

Tom — Nov 04, 07 4976

Any recent update(s) the to code?

Really love this sample btw - thanks!

Nick — Apr 04, 08 5700

Any development on this ?

With a few additions it could easily become the lightweight lightbox app that I have needed for years.




 

Comments Temporarily Disabled

I had to temporarily disable comments due to spam. I'll re-enable them soon.





Copyright © Scott Stevenson 2004-2015