Re: Popups in PB
Re: Popups in PB
- Subject: Re: Popups in PB
- From: Rakesh Pandey <email@hidden>
- Date: Fri, 24 Jan 2003 12:35:42 +0530
To achieve this Apple Guys have created a custom popup programatically.
It is not available in IB. I also do the same in my app where I have
created a SubClass of NSTextFieldCell. The Cell has a contextual Menu
(Which is prepared from an array of file names) and draws the image
using NSBeizerPath. You also can try the same.
The function I am trying to draw the image is:
+ (void) drawDropDownImage:(id)sender
{
NSBezierPath *path = [NSBezierPath bezierPath];
NSSize imageSize = [sender size];
NSColor *fillColor = [NSColor blackColor];
int vMargin, hMargin;
float l,t,r,b,h,w,mw, mh;
[fillColor set];
vMargin = (imageSize.height - 8)/2;
hMargin = (imageSize.width - 5)/2;
if (vMargin < 0)
vMargin = 0;
if (hMargin < 0)
hMargin = 0;
l = hMargin;
r = imageSize.width - hMargin;
t = imageSize.height - vMargin;
b = vMargin;
h = r - l;
w = t - b;
mw = w/2 + l;
mh = h/2 + b;
[path moveToPoint: NSMakePoint(l, b+5)];
[path lineToPoint: NSMakePoint(l+3, t)];
[path lineToPoint: NSMakePoint(r, b+5)];
[path closePath];
[path fill];
[path moveToPoint: NSMakePoint(l, b+3)];
[path lineToPoint: NSMakePoint(r, b+3)];
[path lineToPoint: NSMakePoint(l+3, b)];
[path closePath];
[path fill];
}
Hope it helps
regards
Rakesh
On Friday, January 24, 2003, at 09:39 AM, Roarke Lynch wrote:
>
In project builder's file editor (and elsewhere) they use a style of
>
popup that has the current file name with an up/down indicator next to
>
it. I cannot find how to use this style in IB. Is this a custom job
>
that Apple used or something that I just have to set programatically?
>
>
Roarke Lynch
>
-------------------------------
>
email@hidden
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
>
Rakesh Pandey
------------------------------------------------------------------------
--------
Windows) 98 (n) - 32-bit extensions and graphical shell
for a 16-bit patch to an 8-bit operating system
originally coded for a 4-bit microprocessor
written by a 2-bit company
that can't stand 1 bit of competition.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Popups in PB (From: Roarke Lynch <email@hidden>) |