From 91f939559c591eee0a611485413da4bcd7f99d38 Mon Sep 17 00:00:00 2001 From: nonamelive Date: Wed, 27 Apr 2011 05:33:07 -0700 Subject: [PATCH] Added showPanelInWindow method. --- MKInfoBundle/MKInfoPanel.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/MKInfoBundle/MKInfoPanel.m b/MKInfoBundle/MKInfoPanel.m index 8e0227f..69e946a 100644 --- a/MKInfoBundle/MKInfoPanel.m +++ b/MKInfoBundle/MKInfoPanel.m @@ -103,6 +103,28 @@ +(void) showPanelInView:(UIView*) view type:(MKInfoPanelType) type title:(NSStri [panel performSelector:@selector(hidePanel) withObject:view afterDelay:interval]; } ++(void) showPanelInWindow:(UIWindow*) window type:(MKInfoPanelType) type title:(NSString*) title subtitle:(NSString*) subtitle hideAfter:(NSTimeInterval) interval +{ + MKInfoPanel *panel = [MKInfoPanel infoPanel]; + [panel setType:type]; + panel.titleLabel.text = title; + if(subtitle) + { + panel.detailLabel.text = subtitle; + } + else + { + panel.detailLabel.hidden = YES; + panel.frame = CGRectMake(0, 20, 320, 50); + panel.thumbImage.frame = CGRectMake(15, 5, 35, 35); + panel.titleLabel.frame = CGRectMake(57, 12, 240, 21); + + } + + [window addSubview:panel]; + [panel performSelector:@selector(hidePanel) withObject:window afterDelay:interval]; +} + -(void) hidePanel { CATransition *transition = [CATransition animation];