void ScrollBar::Refresh() { if( this->getScaleX() == 0.0f || this->getScaleY() == 0.0f ) FadeIn(NULL); unscheduleAllSelectors(); //scheduleOnce( schedule_selector(UIFlowScrollBar::FadeOut), _fadeDelayTime ); float offset = 0; switch( _type ) { case VERTICAL_IN: case VERTICAL_OUT: offset = _target->getContentOffset().y; _nowContentSize = _target->getContentSize().height; break; case HORIZONTAL_IN: case HORIZONTAL_OUT: offset = _target->getContentOffset().x; _nowContentSize = _target->getContentSize().width; break; } this->setVisible( _nowContentSize >= _svFixSize ); RefreshScale(); RefreshPosition(); }
void THorizontalScrollBar::Resize(int W, int H) { this->TWindow::Resize(W, H); ButtonUp->Y = 3; ButtonUp->Width = 14; ButtonUp->X = 2; ButtonUp->Height = this->Height - 6; ButtonDown->Y = 3; ButtonDown->Width = 14; ButtonDown->X = this->Width - ButtonDown->Width - 2; ButtonDown->Height = this->Height - 6; ProgressIndicatorRail->Y = 2; ProgressIndicatorRail->X = 4 + ButtonUp->Width + ButtonUp->X; ProgressIndicatorRail->Height = this->Height - 5; ProgressIndicatorRail->Width = this->Width - 3 - ProgressIndicatorRail->X - (this->Width - ButtonDown->X); ProgressIndicator->Y = 1; ProgressIndicator->Height = this->Height - 7; RefreshPosition(); }
bool DirectKey::OnButtonDragOutComplete(NDUIButton* button, CCPoint endTouch, bool outOfRange) { if (button == m_btnShrink) { RefreshPosition(endTouch); return true; } return false; }
bool DirectKey::OnButtonDragOut(NDUIButton* button, CCPoint beginTouch, CCPoint moveTouch, bool longTouch) { if (button == m_btnShrink) { RefreshPosition(moveTouch); return true; } return false; }