Ejemplo n.º 1
0
bool dbAnyCursor::movePrev() 
{
    if (!removed) { 
        return gotoPrev(); 
    } else {
        removed = false;
        return lastRecordWasDeleted ? (currId != 0) : gotoPrev();
    }
}
Ejemplo n.º 2
0
ArgHintWidget::ArgHintWidget( QWidget *parent, const char*name )
    : QFrame( parent, Qt::Popup ), curFunc( 0 ), numFuncs( 0 )
{
	setObjectName( name );
	setFrameStyle( QFrame::Box | QFrame::Plain );
    setLineWidth( 1 );
	QPalette palette;
	palette.setColor( backgroundRole(), Qt::white );
	setPalette( palette );
    QHBoxLayout *hbox = new QHBoxLayout( this );
    hbox->setMargin( 1 );
    hbox->addWidget( ( prev = new ArrowButton( this, "editor_left_btn", ArrowButton::Left ) ) );
    hbox->addWidget( ( funcLabel = new QLabel( this ) ) );
	funcLabel->setObjectName( "editor_func_lbl" );
    hbox->addWidget( ( next = new ArrowButton( this, "editor_right_btn", ArrowButton::Right ) ) );
    funcLabel->setPalette( palette );
    funcLabel->setAlignment( Qt::AlignCenter );
    connect( prev, SIGNAL( clicked() ), this, SLOT( gotoPrev() ) );
    connect( next, SIGNAL( clicked() ), this, SLOT( gotoNext() ) );
    updateState();
    setFocusPolicy( Qt::NoFocus );
    prev->setFocusPolicy( Qt::NoFocus );
    next->setFocusPolicy( Qt::NoFocus );
    funcLabel->setFocusPolicy( Qt::NoFocus );
}
Ejemplo n.º 3
0
void MediaSlideshow::setMediaSlideshow(const std::vector<ds::Resource>& resources){
	clearSlideshow();

	mCurItemIndex = 0;

	for(auto it = resources.begin(); it < resources.end(); ++it){
		MediaViewer* mv = new MediaViewer(mEngine, (*it));
		mv->setSettings(mMediaViewerSettings); 
		mv->setDefaultBounds(getWidth(), getHeight());
		mv->setDefaultSize(ci::Vec2f(getWidth(), getHeight()));
		mHolder->addChildPtr(mv);
		mv->setSwipeCallback([this](ds::ui::Sprite* spr, const ci::Vec3f& amount){
			// don't advance if we're zoomed in
			if(spr->getWidth() <= getWidth()){
				if(amount.x > 20.0f){
					gotoPrev(false);
				} else if(amount.x < -20.0f){
					gotoNext(false);
				}
			}
		});
		mv->setAnimateDuration(mAnimateDuration);
		mv->setDoubleTapCallback([this, mv](ds::ui::Sprite* bs, const ci::Vec3f& pos){
			callAfterDelay([this]{recenterSlides(); }, 0.01f);
		});
		mViewers.push_back(mv);
	}

	loadCurrentAndAdjacent();
	layout();
	recenterSlides();
}
Ejemplo n.º 4
0
bool dbAnyCursor::skip(int n) { 
    while (n > 0) { 
        if (!gotoNext()) { 
            return false;
        }
        n -= 1;
    } 
    while (n < 0) { 
        if (!gotoPrev()) { 
            return false;
        }
        n += 1;
    } 
    if (prefetch) { 
        fetch();
    }
    return true;
}
Ejemplo n.º 5
0
byte* dbAnyCursor::fetchPrev()
{
    if (removed) {
        removed = false; 
        if (lastRecordWasDeleted) { 
            if (currId != 0) { 
                if (!prefetch) { 
                    fetch();
                }
                return record;
            }
            return NULL;
        }
    }
    if (gotoPrev()) {
        fetch();
        return record;
    }
    return NULL;
}