[SOLVED]Re: was(Mail.app)iWeb.app like SplitView Handle
[SOLVED]Re: was(Mail.app)iWeb.app like SplitView Handle
- Subject: [SOLVED]Re: was(Mail.app)iWeb.app like SplitView Handle
- From: Julian Cain <email@hidden>
- Date: Sun, 5 Mar 2006 11:54:52 -0500
I just let the view handle the movement of the image sense it was a
subview.
~Julian Cain
email@hidden
On Mar 5, 2006, at 9:51 AM, Julian Cain wrote:
I had a look at that code and it was too bloated. It drew the
entire sidebar, buttons etc.. So..
Now in my NSImageView (the handle) I have added the following code.
It jitters and is just not smooth, as i did hack it together. If
anyone could point me in the right direction it would be great.
- (void)mouseDragged:(NSEvent*)theEvent {
NSPoint event_location = [theEvent locationInWindow];
NSPoint local_point = [self convertPoint:event_location
fromView:nil];
// Our splitview pointer.
id _mainSplitView = [[MainWndController sharedInstance]
mainSplitView];
// This handles moving the splitview from this view(NSImage).
id subviews = [_mainSplitView subviews];
id a = [subviews objectAtIndex:0];
[a setFrame:NSMakeRect([a frame].origin.x,[a
frame].origin.y,event_location.x,[a frame].size.height)];
[_mainSplitView adjustSubviews];
[_mainSplitView display];
}
~Julian Cain
email@hidden
On Mar 4, 2006, at 1:37 PM, Daniel Jalkut wrote:
Jullian: I just discovered what seems to be a robust
implementation of just such a thing in the Growl application (BSD
License).
Look at KNShelfSplitView in:
http://svn01.23i.net/growl/trunk/Extras/Feed/CustomViews/
Daniel
On Mar 4, 2006, at 1:21 PM, Julian Cain wrote:
Hi,
I am trying to implement a SplitView handle like in mail, itunes,
iweb etc. I have written the following to get my cursor and
detect mouseDown and dragged, now I am kinda stuck on where I
should go. Any ideas?
- Header File -
//
// HeaderResizeWidget.h
// blah
//
// Created by Julian Cain on 3/4/06.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface HeaderResizeWidget : NSImageView {
NSPoint _dragStart;
float _initialLeftWidth;
}
@end
- File -
//
// HeaderResizeWidget.m
// blah
//
// Created by Julian Cain on 3/4/06.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import "HeaderResizeWidget.h"
@implementation HeaderResizeWidget
- (void)awakeFromNib {
_initialLeftWidth = 165.0;
}
- (void)viewWillMoveToWindow:(id)fp8 {
}
- (void)resetCursorRects {
[self addCursorRect:[self bounds] cursor:[NSCursor
resizeLeftRightCursor]];
}
- (void)mouseDown:(NSEvent *)theEvent {
_dragStart = [theEvent locationInWindow];
JCLog(@"mouseDown:");
}
- (void)mouseDragged:(NSEvent*)theEvent {
JCLog(@"mouseDragged:%.2f",_dragStart);
}
~Julian Cain
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:
sweater.com
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
_______________________________________________
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