diff --git a/BeeFramework/MVC/View/Bee_UIButton.h b/BeeFramework/MVC/View/Bee_UIButton.h index 97caf8c..9a8b33e 100644 --- a/BeeFramework/MVC/View/Bee_UIButton.h +++ b/BeeFramework/MVC/View/Bee_UIButton.h @@ -77,7 +77,6 @@ AS_SIGNAL( TOUCH_UP_CANCEL ) // 撤销 @property (nonatomic, retain) UIColor * titleColor; @property (nonatomic, retain) UIFont * titleFont; @property (nonatomic, assign) UIEdgeInsets titleInsets; -@property (nonatomic, assign) UITextAlignment titleTextAlignment; @property (nonatomic, readonly) BeeUIButtonState * stateNormal; @property (nonatomic, readonly) BeeUIButtonState * stateHighlighted; diff --git a/BeeFramework/MVC/View/Bee_UIButton.m b/BeeFramework/MVC/View/Bee_UIButton.m index c4bedbf..d0a395e 100644 --- a/BeeFramework/MVC/View/Bee_UIButton.m +++ b/BeeFramework/MVC/View/Bee_UIButton.m @@ -109,7 +109,6 @@ @implementation BeeUIButton @synthesize titleColor; @synthesize titleFont; @synthesize titleInsets; -@synthesize titleTextAlignment; @synthesize stateNormal; @synthesize stateHighlighted; @@ -202,11 +201,6 @@ - (void)setTitleInsets:(UIEdgeInsets)insets _label.frame = frame; } --(void) setTitleTextAlignment:(UITextAlignment)alignment{ - titleTextAlignment = alignment; - [_label setTextAlignment:alignment]; -} - - (void)dealloc { SAFE_RELEASE_SUBVIEW( _label ); diff --git a/BeeFramework/MVC/View/Bee_UIGridCell.m b/BeeFramework/MVC/View/Bee_UIGridCell.m index 33b4fc2..0122e08 100644 --- a/BeeFramework/MVC/View/Bee_UIGridCell.m +++ b/BeeFramework/MVC/View/Bee_UIGridCell.m @@ -181,14 +181,6 @@ - (void)layoutSubcells if ( _cellLayout && [_cellLayout respondsToSelector:@selector(layoutInBound:forCell:)] ) { [_cellLayout layoutInBound:self.bounds.size forCell:self]; - -// Class layoutClass = [_cellLayout class]; -// if ( [layoutClass respondsToSelector:@selector(sizeInBound:forData:)] ) -// { -// CGSize size = [layoutClass sizeInBound:self.bounds.size forData:self.cellData]; -// [super setFrame:CGRectMake( self.frame.origin.x, self.frame.origin.y, size.width, size.height )]; -// } - // [_cellLayout cellLayout:self bound:self.bounds.size]; } diff --git a/BeeFramework/MVC/View/Bee_UIPageControl.h b/BeeFramework/MVC/View/Bee_UIPageControl.h index eaf93c7..bb13fc5 100644 --- a/BeeFramework/MVC/View/Bee_UIPageControl.h +++ b/BeeFramework/MVC/View/Bee_UIPageControl.h @@ -39,19 +39,16 @@ { UIImage * _dotImageNormal; UIImage * _dotImageHilite; - NSArray * _dotImageNormals; - NSArray * _dotImageHilites; - NSArray * _dotImageSizes; CGSize _dotSize; } -@property (nonatomic,retain) NSArray *dotImageNormals; -@property (nonatomic,retain) NSArray *dotImageHilites; + @property (nonatomic, retain) UIImage * dotImageNormal; @property (nonatomic, retain) UIImage * dotImageHilite; @property (nonatomic, assign) CGSize dotSize; -@property (nonatomic, retain) NSArray *dotImageSizes; + (BeeUIPageControl *)spawn; + (BeeUIPageControl *)spawn:(NSString *)tagString; +- (void)updateDotImages; + @end diff --git a/BeeFramework/MVC/View/Bee_UIPageControl.m b/BeeFramework/MVC/View/Bee_UIPageControl.m index 9f788e5..a6408e3 100644 --- a/BeeFramework/MVC/View/Bee_UIPageControl.m +++ b/BeeFramework/MVC/View/Bee_UIPageControl.m @@ -44,11 +44,9 @@ - (void)updateDotImages; @end @implementation BeeUIPageControl -@synthesize dotImageNormals = _dotImageNormals; + @synthesize dotImageNormal = _dotImageNormal; -@synthesize dotImageHilites = _dotImageHilites; @synthesize dotImageHilite = _dotImageHilite; -@synthesize dotImageSizes = _dotImageSizes; @synthesize dotSize = _dotSize; + (BeeUIPageControl *)spawn @@ -99,87 +97,44 @@ - (CGSize)sizeForNumberOfPages:(NSInteger)pageCount - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { [super endTrackingWithTouch:touch withEvent:event]; + [self updateDotImages]; } - (void)updateDotImages { - NSUInteger index = 0; for ( UIView * subView in self.subviews ) { + NSUInteger index = 0; + if ( [subView isKindOfClass:[UIImageView class]] ) { + index += 1; + UIImageView * imageView = (UIImageView *)subView; if ( self.currentPage == index ) { - if (self.dotImageHilites && [self.dotImageHilites count]> self.currentPage && [self.dotImageHilites objectAtIndex:self.currentPage] != [NSNull null]) { - imageView.image = [self.dotImageHilites objectAtIndex:self.currentPage]; - if (self.dotImageSizes && [self.dotImageSizes count]>self.currentPage) { - NSNumber *number = [self.dotImageSizes objectAtIndex:self.currentPage]; - CGSize size = [number CGSizeValue]; - imageView.frame = CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y, size.width, size.height); - } - }else if ( self.dotImageHilite ) + if ( self.dotImageHilite ) { imageView.image = self.dotImageHilite; } } else { - - if (self.dotImageNormals && [self.dotImageNormals count]> index && [self.dotImageNormals objectAtIndex:self.currentPage] != [NSNull null]) { - - imageView.image = [self.dotImageNormals objectAtIndex:index]; - if (self.dotImageSizes && [self.dotImageSizes count]>index) { - NSNumber *number = [self.dotImageSizes objectAtIndex:index]; - CGSize size = [number CGSizeValue]; - imageView.frame = CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y, size.width, size.height); - } - - - }else if ( self.dotImageNormal ) + if ( self.dotImageNormal ) { imageView.image = self.dotImageNormal; } } - - index += 1; } } } --(void) setDotImageNormals:(NSArray *)dotImageNormals{ - [_dotImageNormals release]; - _dotImageNormals = [dotImageNormals retain]; - [self updateDotImages]; -} - --(void) setDotImageHilites:(NSArray *)dotImageHilites{ - [_dotImageHilites release]; - _dotImageHilites = [dotImageHilites retain]; - [self updateDotImages]; -} - --(void) setDotImageSizes:(NSArray *)dotImageSizes{ - [_dotImageSizes release]; - _dotImageSizes = [dotImageSizes retain]; - [self updateDotImages]; -} - - --(void) setCurrentPage:(NSInteger)page{ - [super setCurrentPage:page]; - [self updateDotImages]; -} - - (void)dealloc { [_dotImageNormal release]; [_dotImageHilite release]; - [_dotImageNormals release]; - [_dotImageHilites release]; - [_dotImageSizes release]; - + [super dealloc]; }