

#import "VankeTopMenuBoardCell_iPhone.h"

#pragma mark -

@interface VankeTopMenuBoardCell_iPhone()
{
	//<#@private var#>
}
@end

@implementation VankeTopMenuBoardCell_iPhone

SUPPORT_AUTOMATIC_LAYOUT( YES )
SUPPORT_RESOURCE_LOADING( YES )

DEF_OUTLET( BeeUIButton, menuCommunity );
DEF_OUTLET( BeeUIButton, menuCenter );
DEF_OUTLET( BeeUIButton, menuSqure );
DEF_OUTLET( BeeUIImageView, indictor );

-(void) selectTabByIndex: (int) index {
    if (index == 0) {
        [self selectCommunity];
    } else if (index == 1) {
        [self selectCenter];
    } else if (index == 2) {
        [self selectSqure];
    }
}

-(void) selectCommunity {
    [self removeActiveClass];
    $(self.menuCommunity).ADD_CLASS(@"active");
    $(self.indictor).ADD_CLASS(@"community");
    self.RELAYOUT();
}

-(void) selectCenter {
    [self removeActiveClass];
    $(self.menuCenter).ADD_CLASS(@"active");
    $(self.indictor).ADD_CLASS(@"center");
    self.RELAYOUT();
}

-(void) selectSqure {
    [self removeActiveClass];
    $(self.menuSqure).ADD_CLASS(@"active");
    $(self.indictor).ADD_CLASS(@"squre");
    self.RELAYOUT();
}

-(void) removeActiveClass {
    $(self.menuCommunity).REMOVE_CLASS(@"active");
    $(self.menuCenter).REMOVE_CLASS(@"active");
    $(self.menuSqure).REMOVE_CLASS(@"active");
    
    $(self.indictor).REMOVE_CLASS(@"community");
    $(self.indictor).REMOVE_CLASS(@"center");
    $(self.indictor).REMOVE_CLASS(@"squre");
}

@end
