Exemplo n.º 1
0
void ProgressDialog::setCurrent( int subCurrent, bool bRedrawUpdate )
{
   if ( m_progressStack.empty() )
      return;
   ProgressLevelData& pld = m_progressStack.back();
   pld.m_current = subCurrent;
   recalc( bRedrawUpdate );
}
void spinner(void)
{
    read();
    recalc();
    upload();
    compute_histogram();
    update();
}
Exemplo n.º 3
0
void ProgressDialog::step( bool bRedrawUpdate )
{
   if ( m_progressStack.empty() )
      return;
   ProgressLevelData& pld = m_progressStack.back();
   pld.m_current.fetchAndAddRelaxed(1);
   recalc(bRedrawUpdate);
}
Exemplo n.º 4
0
void UIPopupBox::setTitleIcon(const QIcon &icon)
{
    /* Remember new title-icon: */
    m_titleIcon = icon;
    /* Update title-icon: */
    updateTitleIcon();
    /* Recalculate title-size: */
    recalc();
}
Exemplo n.º 5
0
bool QSplitter::event( QEvent *e )
{
    if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) {
	recalc( isVisible() );
	if ( e->type() == QEvent::Show )
	    data->firstShow = FALSE;
    }
    return QWidget::event( e );
}
Exemplo n.º 6
0
void UIPopupBox::setTitle(const QString &strTitle)
{
    /* Remember new title: */
    m_strTitle = strTitle;
    /* Update title: */
    updateTitle();
    /* Recalculate title-size: */
    recalc();
}
Exemplo n.º 7
0
void GuiTextbox::set_caret_position(int pos) {
    int sz = static_cast<int>(text.length());

    caret_position = pos;
    if (caret_position > sz) {
        caret_position = sz;
    }
    recalc();
}
Exemplo n.º 8
0
void PictureFlowPrivate::setZoomFactor(int z)
{
  if(z <= 0)
    return;

  zoom = z;
  recalc(buffer.width(), buffer.height());
  triggerRender();
}
Exemplo n.º 9
0
void UIPopupBox::setWarningIcon(const QIcon &icon)
{
    /* Remember new warning-icon: */
    m_warningIcon = icon;
    /* Update warning-icon: */
    updateWarningIcon();
    /* Recalculate title-size: */
    recalc();
}
Exemplo n.º 10
0
void FOX16_HtmlLabel::setText(const FXString& text) {
  m_haveDefaultDims=false;
  m_text=text;
  updateHtml();
  flags|=FLAG_DIRTY;
  layout();
  recalc();
  update();
}
Exemplo n.º 11
0
void DetunerPlugin::setParameter (int index, float newValue)
{

	if (Pars->getParameter(index) != newValue) {Pars->setParameter(index,newValue);}

	 //calcs here
	recalc();	
  
}
Exemplo n.º 12
0
Camera::Camera() //startwerte der perspective camera
{
    proj = glm::perspective(45.0f, 1.0f, 0.1f, 100.0f);

    eye = vec3(0,2,-5);
    lookAt = vec3(2.5,0,0);
    up = vec3(0,1,0);

    recalc();
}
Exemplo n.º 13
0
void collision_avoided(double direction, struct timeval time){
	running = 0;
	current.timer = time;
	free(route.path);
	compare_tile();
	current.current_destination.angle = direction;
	update_position(&current);
	compare_tile();
	recalc();
}
Exemplo n.º 14
0
//-----------------------------------------------------------------------------
// name: next()
// desc: move step towards dest
//-----------------------------------------------------------------------------
void ViewRegionInterp::next()
{
    // do nothing
    if( m_alpha >= 1.0 ) return;

    // compute the alpha
    m_alpha = (AudicleWindow::main()->get_current_time() - m_start) / m_dur;
    // alpha
    recalc();
}
Exemplo n.º 15
0
void GuiScroll::set_value(int value) {
    int old_value = current_value;
    current_value = value;
    recalc();
    if (current_value != old_value) {
        if (on_value_changed) {
            on_value_changed(this, on_value_changed_data, current_value);
        }
    }
}
Exemplo n.º 16
0
void filter_rc_device::filter_rc_set_RC(int type, double R1, double R2, double R3, double C)
{
	m_stream->update();
	m_type = type;
	m_R1 = R1;
	m_R2 = R2;
	m_R3 = R3;
	m_C = C;
	recalc();
}
Exemplo n.º 17
0
void obrasslamp(int i)
{
	spelknow[i]++;
	Printf("Spell:  %s -- %s<br/>", spelname[i], speldescript[i]);
	Print("The genie prefers not to be disturbed again.");
	forget();

	recalc();
	UpdateStatus();
}
Exemplo n.º 18
0
void ScrollContainerWidget::init() {
	setFlags(WIDGET_ENABLED);
	_type = kScrollContainerWidget;
	_verticalScroll = new ScrollBarWidget(this, _w-16, 0, 16, _h);
	_verticalScroll->setTarget(this);
	_scrolledX = 0;
	_scrolledY = 0;
	_limitH = 140;
	recalc();
}
Exemplo n.º 19
0
inline void chooser::right_rotale(pitem p) {
	assert(p->L);
	pitem q = p->L;
	if (p->parent) {
		if (is_left_child(p)) {
			p->parent->L = q;
		} else {
			p->parent->R = q;
		}
	}
	p->L = q->R;
	q->R = p;
	recalc(p->L);
	recalc(p);
	make_parent(p->parent, q);
	make_parent(q, p);
	recalc(q);
	recalc(q->parent);
}
Exemplo n.º 20
0
uint8_t graph_threshold_edges(
  graph_t  *gin,
  graph_t  *gout,
  uint32_t  nedges,
  uint32_t  flags,
  void     *opt,
  uint8_t (*init)(graph_t *g),
  uint8_t (*remove)(
    graph_t      *g,
    double       *space,
    array_t      *edges,
    graph_edge_t *edge),
  uint8_t (*recalc)(
    graph_t      *g,
    graph_edge_t *edge)
) {

  uint64_t     i;
  uint32_t     nnodes;
  double      *space;
  array_t      edges;
  graph_edge_t edge;

  edges.data = NULL;
  space      = NULL;
  nnodes     = graph_num_nodes(gin);

  if (array_create(&edges, sizeof(graph_edge_t), 10)) goto fail;

  if (graph_copy(gin,  gout)) goto fail;
  if (stats_cache_init(gout)) goto fail;

  space = calloc(nnodes,sizeof(double));
  if (space == NULL) goto fail;

  init(gout);

  for (i = 0; i < nedges; i++) {

    array_clear(&edges);
    if (remove(gout, space, &edges, &edge)) goto fail;

    if (i == nedges -1)      break;
    if (recalc(gout, &edge)) goto fail;
  }

  array_free(&edges);
  free(space);
  return 0;
  
fail:
  if (edges.data != NULL) array_free(&edges);
  if (space      != NULL) free(space);
  return 1;
}
Exemplo n.º 21
0
mouse_grid_t::mouse_grid_t(
	int cols, int rows,
	int offset_x, int offset_y,
	int cell_width, int cell_height)
:
	cols(cols), rows(rows),
	gx(offset_x), gy(offset_y),
	cw(cell_width), ch(cell_height)
{
	recalc();
}
Exemplo n.º 22
0
// Change the font
void TextLabel::setFont(FXFont* fnt)
{
    if (!fnt)
        fxerror("%s::setFont: NULL font specified.\n",getClassName());
    if (font!=fnt)
    {
        font=fnt;
        recalc();
        update();
    }
}
Exemplo n.º 23
0
void GuiListbox::setup(const std::string& title) {
    sb = gui.create_vscroll(this, get_width() - GuiScroll::Size, 0, get_height(),
        0, 0, 0, static_scroll_changed, this);

    title_bar = new GuiListboxEntry(gui, this, title);
    title_bar_visible = false;

    start_index = 0;
    selected_index = -1;
    mouse_is_down = false;
    recalc();
}
Exemplo n.º 24
0
void ScrollBarWidget::checkBounds(int old_pos) {
	if (_numEntries <= _entriesPerPage || _currentPos < 0)
		_currentPos = 0;
	else if (_currentPos > _numEntries - _entriesPerPage)
		_currentPos = _numEntries - _entriesPerPage;

	if (old_pos != _currentPos) {
		recalc();
		draw();
		sendCommand(kSetPositionCmd, _currentPos);
	}
}
Exemplo n.º 25
0
GuiScroll::GuiScroll(Gui& gui, GuiObject *parent, int x, int y, int width, int height,
    int min_value, int max_value, int initial_value, ValueChanged on_value_changed,
    void *on_value_changed_data)
    : GuiObject(gui, parent, x, y, width, height), on_value_changed(on_value_changed),
      on_value_changed_data(on_value_changed_data), min_value(min_value),
      max_value(max_value), current_value(initial_value)
{
    if (min_value > max_value) {
        std::swap(min_value, max_value);
    }
    recalc();
}
Exemplo n.º 26
0
void QSmoothedAnimation::init()
{
    if (velocity == 0) {
        stop();
        return;
    }

    if (delayedStopTimer.isActive())
        delayedStopTimer.stop();

    initialValue = target.read().toReal();
    lastTime = this->currentTime();

    if (to == initialValue) {
        stop();
        return;
    }

    bool hasReversed = trackVelocity != qreal(0.) &&
                      ((!invert) == ((initialValue - to) > 0));

    if (hasReversed) {
        switch (reversingMode) {
            default:
            case QDeclarativeSmoothedAnimation::Eased:
                initialVelocity = -trackVelocity;
                break;
            case QDeclarativeSmoothedAnimation::Sync:
                QDeclarativePropertyPrivate::write(target, to,
                                                   QDeclarativePropertyPrivate::BypassInterceptor
                                                   | QDeclarativePropertyPrivate::DontRemoveBinding);
                trackVelocity = 0;
                stop();
                return;
            case QDeclarativeSmoothedAnimation::Immediate:
                initialVelocity = 0;
                break;
        }
    }

    trackVelocity = initialVelocity;

    invert = (to < initialValue);

    if (!recalc()) {
        QDeclarativePropertyPrivate::write(target, to,
                                           QDeclarativePropertyPrivate::BypassInterceptor
                                           | QDeclarativePropertyPrivate::DontRemoveBinding);
        stop();
        return;
    }
}
Exemplo n.º 27
0
/*!
    \internal
*/
void QSplitterPrivate::insertWidget_helper(int index, QWidget *widget, bool show)
{
    Q_Q(QSplitter);
    QBoolBlocker b(blockChildAdd);
    bool needShow = show && q->isVisible() &&
                    !(widget->isHidden() && widget->testAttribute(Qt::WA_WState_ExplicitShowHide));
    if (widget->parentWidget() != q)
        widget->setParent(q);
    if (needShow)
        widget->show();
    insertWidget(index, widget);
    recalc(q->isVisible());
}
Exemplo n.º 28
0
void refresh(blockmap *block) {
	for (int y = torch.buf.scroll.y; y < torch.buf.scroll.y + 24; y++)
		for (int x = torch.buf.scroll.x; x < torch.buf.scroll.x + 32; x++) {
			int32 v = torch.buf.luxat(x, y)->lval;
			mapel *m = torch.buf.at(x, y);
			if (isforgettable(x,y))
				m->recall = 0;
			else
				m->recall = min(1<<12, max(v, m->recall));

			recalc(block, x, y);
		}
}
Exemplo n.º 29
0
void filter_rc_device::device_start()
{
	m_stream = stream_alloc(1, 1, machine().sample_rate());
	recalc();

	save_item(NAME(m_k));
	save_item(NAME(m_memory));
	save_item(NAME(m_type));
	save_item(NAME(m_R1));
	save_item(NAME(m_R2));
	save_item(NAME(m_R3));
	save_item(NAME(m_C));
}
Exemplo n.º 30
0
void UIPopupBox::setContentWidget(QWidget *pWidget)
{
    if (m_pContentWidget)
    {
        layout()->removeWidget(m_pContentWidget);
//        m_pContentWidget->removeEventFilter(this);
    }
    m_pContentWidget = pWidget;
//    m_pContentWidget->installEventFilter(this);
//    m_pContentWidget->setMouseTracking(true);
    layout()->addWidget(pWidget);
    recalc();
}