• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ slider函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中slider函数的典型用法代码示例。如果您正苦于以下问题:C++ slider函数的具体用法?C++ slider怎么用?C++ slider使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了slider函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: option_menu_2

void			option_menu_2(t_data *data, int selected_index,
				      t_bunny_position pos,
				      t_bunny_position size)
{
  pos.y = data->rect_opt[2].pos.y + data->rect_opt[1].size.y + 20;
  data->rect_opt[3] = label(data, false, size, pos);
  pos.y = data->rect_opt[3].pos.y + data->rect_opt[1].size.y + 15;
  if (selected_index == 2)
    data->rect_opt[4] = slider(data, true, data->config->volume, pos);
  else
    data->rect_opt[4] = slider(data, false, data->config->volume, pos);
  pos.y = data->rect_opt[4].pos.y + data->rect_opt[1].size.y + 20;
  data->rect_opt[5] = label(data, false, size, pos);
  pos.y = data->rect_opt[5].pos.y + data->rect_opt[1].size.y + 20;
  if (selected_index == 3)
    data->rect_opt[6] = slider(data, true, data->config->fov, pos);
  else
    data->rect_opt[6] = slider(data, false, data->config->fov, pos);
  pos.y = data->rect_opt[6].pos.y + data->rect_opt[1].size.y + 20 ;
  (selected_index == 4) ? (data->rect_opt[7] = label(data, true, size, pos)) :
    (data->rect_opt[7] = label(data, false, size, pos));
  pos.y = data->rect_opt[7].pos.y + data->rect_opt[1].size.y + 20;
  (selected_index == 5) ? (data->rect_opt[8] = label(data, true, size, pos)) :
    (data->rect_opt[8] = label(data, false, size, pos));
  pos.y = data->rect_opt[8].pos.y + data->rect_opt[1].size.y + 20;
  (selected_index == 6) ? (data->rect_opt[9] = label(data, true, size, pos)) :
  (data->rect_opt[9] = label(data, false, size, pos));
}
开发者ID:MarcBrout,项目名称:tekdoom,代码行数:28,代码来源:menu.c


示例2: QString

/*! \reimp */
QString QAccessibleSlider::text(Text t, int child) const
{
    if (!slider()->isVisible())
        return QString();
    switch (t) {
    case Value:
        if (!child || child == 2)
            return QString::number(slider()->value());
        return QString();
    case Name:
        switch (child) {
        case PageLeft:
            return slider()->orientation() == Qt::Horizontal ?
                QSlider::tr("Page left") : QSlider::tr("Page up");
        case Position:
            return QSlider::tr("Position");
        case PageRight:
            return slider()->orientation() == Qt::Horizontal ?
                QSlider::tr("Page right") : QSlider::tr("Page down");
        }
        break;
    default:
        break;
    }
    return QAccessibleAbstractSlider::text(t, child);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:27,代码来源:rangecontrols.cpp


示例3: QFontMetrics

void
OCRuler::updateGeometry()
{
	QSize rsz = QFontMetrics(slider()->font()).size(SLIDER_TEXT_FLAGS, "09.,");
	int gap = 2;
	int min_sld = 2;
	int sld = 16;
	off_y = rsz.height() + gap;

	QRect br = boundingRect();
	if (br.height() < off_y + min_sld)
		br.setHeight(off_y + min_sld);
	if (br.width() < rsz.width())
		br.setWidth(rsz.width());

	if (slider()->orientation() == Vertical) {
		if (sld > br.width())
			sld = br.width();
		off_x = (br.width() - sld) / 2;
		slider()->setGeometry(br.x() + off_x, br.y() + off_y,
								sld, br.height() - off_y);
	} else {
		if (sld > br.height() - off_y)
			sld = br.height() - off_y;
		off_x = 0;
		slider()->setGeometry(br.x(), br.y() + off_y, br.width(), sld);
	}

	updateSize(br);
	update();
}
开发者ID:ivandeex,项目名称:optikus,代码行数:31,代码来源:ocranges.cpp


示例4: slider

void
OCRuler::update()
{
	if (slider() && slider()->value() != int(vcur))
		slider()->setValue(int(vcur));
	vslide = vcur;
	OCDataWidget::update();
}
开发者ID:ivandeex,项目名称:optikus,代码行数:8,代码来源:ocranges.cpp


示例5: createEmptyDynamicsWorld

void ConstraintPhysicsSetup::initPhysics()
{
	m_guiHelper->setUpAxis(1);

	createEmptyDynamicsWorld();

	m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld);
	int mode = btIDebugDraw::DBG_DrawWireframe + btIDebugDraw::DBG_DrawConstraints + btIDebugDraw::DBG_DrawConstraintLimits;
	m_dynamicsWorld->getDebugDrawer()->setDebugMode(mode);

	{
		SliderParams slider("target vel", &targetVel);
		slider.m_minVal = -4;
		slider.m_maxVal = 4;
		m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
	}

	{
		SliderParams slider("max impulse", &maxImpulse);
		slider.m_minVal = 0;
		slider.m_maxVal = 1000;
		m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
	}

	{
		SliderParams slider("actual vel", &actualHingeVelocity);
		slider.m_minVal = -4;
		slider.m_maxVal = 4;
		m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
	}

	val = 1.f;
	{
		SliderParams slider("angle", &val);
		slider.m_minVal = -720;
		slider.m_maxVal = 720;
		m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
	}

	{  // create a door using hinge constraint attached to the world
		btCollisionShape* pDoorShape = new btBoxShape(btVector3(2.0f, 5.0f, 0.2f));
		m_collisionShapes.push_back(pDoorShape);
		btTransform doorTrans;
		doorTrans.setIdentity();
		doorTrans.setOrigin(btVector3(-5.0f, -2.0f, 0.0f));
		btRigidBody* pDoorBody = createRigidBody(1.0, doorTrans, pDoorShape);
		pDoorBody->setActivationState(DISABLE_DEACTIVATION);
		const btVector3 btPivotA(10.f + 2.1f, -2.0f, 0.0f);  // right next to the door slightly outside

		spDoorHinge = new btHingeAccumulatedAngleConstraint(*pDoorBody, btPivotA, btAxisA);

		m_dynamicsWorld->addConstraint(spDoorHinge);

		spDoorHinge->setDbgDrawSize(btScalar(5.f));
	}

	m_guiHelper->autogenerateGraphicsObjects(m_dynamicsWorld);
}
开发者ID:Hongtae,项目名称:bullet3,代码行数:58,代码来源:ConstraintPhysicsSetup.cpp


示例6:

void
OCRuler::drawShape(QPainter& p)
{
	QString vs;
	vs.sprintf("%.1f", vslide);
	if (slider()) {
		p.setFont(slider()->font());
		p.setPen(slider()->paletteForegroundColor());
	}
	p.drawText(boundingRect(), SLIDER_TEXT_FLAGS, vs);
}
开发者ID:ivandeex,项目名称:optikus,代码行数:11,代码来源:ocranges.cpp


示例7: createUI

void createUI(NVGcontext *vg, float w, float h)
{
    int col;

    uiClear();

    {
        int root = uiItem(); 
        // position root element
        uiSetLayout(root,UI_LEFT|UI_TOP);
        uiSetMargins(root,50,50,0,0);
        uiSetSize(root,250,400);
    }

    col = column(0);
    uiSetLayout(col, UI_TOP|UI_HFILL);

    button(col, __LINE__, BND_ICONID(6,3), "Item 1", demohandler);
    button(col, __LINE__, BND_ICONID(6,3), "Item 2", demohandler);

    {
        int h = hgroup(col);
        radio(h, __LINE__, BND_ICONID(6,3), "Item 3.0", &enum1);
        radio(h, __LINE__, BND_ICONID(0,10), NULL, &enum1);
        radio(h, __LINE__, BND_ICONID(1,10), NULL, &enum1);
        radio(h, __LINE__, BND_ICONID(6,3), "Item 3.3", &enum1);
    }

    {
        int colr;
        int rows = row(col);
        int coll = vgroup(rows);
        label(coll, -1, "Items 4.0:");
        coll = vgroup(coll);
        button(coll, __LINE__, BND_ICONID(6,3), "Item 4.0.0", demohandler);
        button(coll, __LINE__, BND_ICONID(6,3), "Item 4.0.1", demohandler);
        colr = vgroup(rows);
        uiSetFrozen(colr, option1);
        label(colr, -1, "Items 4.1:");
        colr = vgroup(colr);
        slider(colr, __LINE__, "Item 4.1.0", &progress1);
        slider(colr,__LINE__, "Item 4.1.1", &progress2);
    }

    button(col, __LINE__, BND_ICONID(6,3), "Item 5", NULL);

    check(col, __LINE__, "Frozen", &option1);
    check(col, __LINE__, "Item 7", &option2);
    check(col, __LINE__, "Item 8", &option3);

    textbox(col, (UIhandle)textbuffer, textbuffer, 32);

    uiLayout();
}
开发者ID:clems71,项目名称:island,代码行数:54,代码来源:main.c


示例8: build_democontent

void build_democontent(int parent) {
    // some persistent variables for demonstration
    static float progress1 = 0.25f;
    static float progress2 = 0.75f;
    static int option1 = 1;
    static int option2 = 0;
    static int option3 = 0;

    int col = column();
    uiInsert(parent, col);
    uiSetMargins(col, 10, 10, 10, 10);
    uiSetLayout(col, UI_TOP|UI_HFILL);
    
    column_append(col, button(BND_ICON_GHOST, "Item 1", demohandler));
    if (option3)
        column_append(col, button(BND_ICON_GHOST, "Item 2", demohandler));

    {
        int h = column_append(col, hbox());
        hgroup_append(h, radio(BND_ICON_GHOST, "Item 3.0", &enum1));
        if (option2)
            uiSetMargins(hgroup_append_fixed(h, radio(BND_ICON_REC, NULL, &enum1)), -1,0,0,0);
        uiSetMargins(hgroup_append_fixed(h, radio(BND_ICON_PLAY, NULL, &enum1)), -1,0,0,0);
        uiSetMargins(hgroup_append(h, radio(BND_ICON_GHOST, "Item 3.3", &enum1)), -1,0,0,0);
    }
    
    {
        int rows = column_append(col, row());
        int coll = row_append(rows, vgroup());
        vgroup_append(coll, label(-1, "Items 4.0:"));
        coll = vgroup_append(coll, vbox());
        vgroup_append(coll, button(BND_ICON_GHOST, "Item 4.0.0", demohandler));
        uiSetMargins(vgroup_append(coll, button(BND_ICON_GHOST, "Item 4.0.1", demohandler)),0,-2,0,0);
        int colr = row_append(rows, vgroup());
        uiSetMargins(colr, 8, 0, 0, 0);
        uiSetFrozen(colr, option1);
        vgroup_append(colr, label(-1, "Items 4.1:"));
        colr = vgroup_append(colr, vbox());
        vgroup_append(colr, slider("Item 4.1.0", &progress1));
        uiSetMargins(vgroup_append(colr, slider("Item 4.1.1", &progress2)),0,-2,0,0);
    }
    
    column_append(col, button(BND_ICON_GHOST, "Item 5", NULL));

    static char textbuffer[1024] = "The quick brown fox.";
    column_append(col, textbox(textbuffer, 1024));

    column_append(col, check("Frozen", &option1));
    column_append(col, check("Item 7", &option2));
    column_append(col, check("Item 8", &option3));
}
开发者ID:fungos,项目名称:fips-oui,代码行数:51,代码来源:example.cpp


示例9: dataDouble

void VariableResistor::dataChanged()
{

    double new_minResistance = dataDouble( "minimum resistance" );
    double new_maxResistance = dataDouble( "maximum resistance" );

    if( new_minResistance != m_minResistance )
    {
        if( new_minResistance >= m_maxResistance )
        {
            m_minResistance = m_maxResistance;
            property( "minimum resistance" )->setValue( m_minResistance );
        } else m_minResistance = new_minResistance;
    }

    if( new_maxResistance != m_maxResistance )
    {
        if( new_maxResistance <= m_minResistance )
        {
            m_maxResistance = m_minResistance;
            property( "maximum resistance" )->setValue( m_maxResistance );
        } else m_maxResistance = new_maxResistance;
    }

    m_tickValue = ( m_maxResistance - m_minResistance ) / m_pSlider->maxValue();

    // Calculate the resistance jump per tick of a 100 tick slider.
    sliderValueChanged( "slider", slider("slider")->value() );
}
开发者ID:ktechlab,项目名称:ktechlab-0.3,代码行数:29,代码来源:variableresistor.cpp


示例10: trace

/*airplane constructor reads conf file and intializes menu controls in mediator(mainwindow)*/
airplane::airplane(nmainwindow *m):w(NULL),mediator(m) {
trace("airplane::airplane")
 timer=new QTimer(this);
 connect(timer,SIGNAL(timeout()),this,SLOT(refreshmap()));
 readfile(":/conf.txt");
 cmenu=mediator->menuBar()->addMenu(tr("map"));
 roadmapaction=new QAction(tr("ROADMAP"),cmenu);
 satelliteaction=new QAction(tr("SATELLITE"),cmenu);
 hybridaction=new QAction(tr("HYBRID"),cmenu);
 terrainaction=new QAction(tr("TERRAIN"),cmenu);
 ctrlmenu=mediator->menuBar()->addMenu(tr("ctrl"));
 pauseaction=new QAction(tr("pause"),ctrlmenu);
 slideraction=new QAction(tr("slider"),ctrlmenu);
 snapshotaction=new QAction(tr("snapshot"),ctrlmenu);
aboutaction=new QAction(tr("about"),mediator->menuBar());
 connect(roadmapaction,SIGNAL(triggered()),this,SLOT(roadmaptriggered()));
 connect(satelliteaction,SIGNAL(triggered()),this,SLOT(satellitetriggered()));
 connect(terrainaction,SIGNAL(triggered()),this,SLOT(terraintriggered()));
 connect(hybridaction,SIGNAL(triggered()),this,SLOT(hybridtriggered()));
 connect(pauseaction,SIGNAL(triggered()),this,SLOT(pausetriggered()));
 connect(slideraction,SIGNAL(triggered()),this,SLOT(slider()));
 connect(snapshotaction,SIGNAL(triggered()),this,SLOT(snapshottriggered()));
connect(aboutaction,SIGNAL(triggered()),this,SLOT(abouttriggered()));
 cmenu->addAction(roadmapaction);
 cmenu->addAction(satelliteaction);
 cmenu->addAction(hybridaction);
 cmenu->addAction(terrainaction);
 ctrlmenu->addAction(pauseaction);
 ctrlmenu->addAction(slideraction);
 ctrlmenu->addSeparator();
 ctrlmenu->addAction(snapshotaction);
mediator->menuBar()->addAction(aboutaction);
 pzRot=plineindex=lineindex=0;
trace("~airplane::airplane")
}
开发者ID:minhinc,项目名称:MFS,代码行数:36,代码来源:airplane.cpp


示例11: dataDouble

void VariableCapacitor::dataChanged() {


	double new_minCapacitance = dataDouble("minimum capacitance");
	double new_maxCapacitance = dataDouble("maximum capacitance");

	if (new_minCapacitance != m_minCapacitance) {
		if (new_minCapacitance >= m_maxCapacitance) {
			m_minCapacitance = m_maxCapacitance;
			property("minimum capacitance")->setValue(m_minCapacitance);
		} else m_minCapacitance = new_minCapacitance;
	}

	if (new_maxCapacitance != m_maxCapacitance) {
		if (new_maxCapacitance <= m_minCapacitance) {
			m_maxCapacitance = m_minCapacitance;
			property("maximum capacitance")->setValue(m_maxCapacitance);
		} else m_maxCapacitance = new_maxCapacitance;
	}

	/*  Attempt at  fixme.
		m_currCapacitance = property( "currcapacitance" )->value().asDouble();

		if(m_currCapacitance > m_maxCapacitance) m_currCapacitance = m_maxCapacitance;
		else if(m_currCapacitance < m_minCapacitance) m_currCapacitance = m_minCapacitance;
	*/

	m_tickValue = (m_maxCapacitance - m_minCapacitance) / m_pSlider->maxValue();

	property("currcapacitance")->setValue(m_currCapacitance);

	// Calculate the capacitance jump per tick of a 100 tick slider.
	sliderValueChanged("slider", slider("slider")->value());
}
开发者ID:zoltanp,项目名称:ktechlab-0.3,代码行数:34,代码来源:variablecapacitor.cpp


示例12: updateConnectorPoints

void CNItem::restoreFromItemData( const ItemData &itemData )
{
	Item::restoreFromItemData(itemData);
	
	updateConnectorPoints(false);
	
	{
		const BoolMap::const_iterator end = itemData.buttonMap.end();
		for ( BoolMap::const_iterator it = itemData.buttonMap.begin(); it != end; ++it )
		{
			Button *b = button(it.key());
			if (b)
				b->setState(it.data());
		}
	}
	{
		const IntMap::const_iterator end = itemData.sliderMap.end();
		for ( IntMap::const_iterator it = itemData.sliderMap.begin(); it != end; ++it )
		{
			Slider *s = slider(it.key());
			if (s)
				s->setValue(it.data());
		}
	}
}
开发者ID:ktechlab,项目名称:ktechlab-0.3,代码行数:25,代码来源:cnitem.cpp


示例13: main

int main(int argc, char ** argv) {
  window = new Fl_Single_Window(COLS*W,ROWS*H+90);
bt("@->");
bt("@>");
bt("@>>");
bt("@>|");
bt("@>[]");
bt("@|>");
bt("@<-");
bt("@<");
bt("@<<");
bt("@|<");
bt("@[]<");
bt("@<|");
bt("@<->");
bt("@-->");
bt("@+");
bt("@->|");
bt("@||");
bt("@arrow");
bt("@returnarrow");
bt("@square");
bt("@circle");
bt("@line");
bt("@menu");
bt("@UpArrow");
bt("@DnArrow");

  Fl_Value_Slider slider(80,
                         window->h()-60,
                         window->w()-90,
                         16,
                         "Orientation");
  slider.align(FL_ALIGN_LEFT);
  slider.type(Fl_Slider::HORIZONTAL);
  slider.range(0.0, 9.0);
  slider.value(0.0);
  slider.step(1);
  slider.callback(slider_cb, &slider);

  Fl_Value_Slider slider2(80,
                          window->h()-30,
                          window->w()-90,
                          16,
                          "Scale");
  slider2.align(FL_ALIGN_LEFT);
  slider2.type(Fl_Slider::HORIZONTAL);
  slider2.range(-9.0, 9.0);
  slider2.value(0.0);
  slider2.step(1);
  slider2.callback(slider_cb, &slider);

  rot = &slider;
  scale = &slider2;

  window->resizable(window);
  window->show(argc,argv);
  return Fl::run();
}
开发者ID:edeproject,项目名称:efltk,代码行数:59,代码来源:symbols.cpp


示例14: createButton

void	PhysicsClientExample::createButtons()
{
	bool isTrigger = false;
	
    if (m_guiHelper && m_guiHelper->getParameterInterface())
    {
		m_guiHelper->getParameterInterface()->removeAllParameters();

        createButton("Load URDF",CMD_LOAD_URDF,  isTrigger);
        createButton("Step Sim",CMD_STEP_FORWARD_SIMULATION,  isTrigger);
        createButton("Send Bullet Stream",CMD_SEND_BULLET_DATA_STREAM,  isTrigger);
        createButton("Get State",CMD_REQUEST_ACTUAL_STATE,  isTrigger);
        createButton("Send Desired State",CMD_SEND_DESIRED_STATE,  isTrigger);
        createButton("Create Box Collider",CMD_CREATE_BOX_COLLISION_SHAPE,isTrigger);
		createButton("Create Cylinder Body",CMD_CREATE_RIGID_BODY,isTrigger);
        createButton("Reset Simulation",CMD_RESET_SIMULATION,isTrigger);
		createButton("Initialize Pose",CMD_INIT_POSE,  isTrigger);
        createButton("Set gravity", CMD_SEND_PHYSICS_SIMULATION_PARAMETERS, isTrigger);


		if (m_physicsClientHandle && m_selectedBody>=0)
		{
			int numJoints = b3GetNumJoints(m_physicsClientHandle,m_selectedBody);
			for (int i=0;i<numJoints;i++)
			{
				b3JointInfo info;
				b3GetJointInfo(m_physicsClientHandle,m_selectedBody,i,&info);
				b3Printf("Joint %s at q-index %d and u-index %d\n",info.m_jointName,info.m_qIndex,info.m_uIndex);
                
				if (info.m_flags & JOINT_HAS_MOTORIZED_POWER)
				{
					if (m_numMotors<MAX_NUM_MOTORS)
					{
						char motorName[1024];
						sprintf(motorName,"%s q", info.m_jointName);
						// MyMotorInfo2* motorInfo = &m_motorTargetVelocities[m_numMotors];
                        MyMotorInfo2* motorInfo = &m_motorTargetPositions[m_numMotors];
						motorInfo->m_velTarget = 0.f;
                        motorInfo->m_posTarget = 0.f;
						motorInfo->m_uIndex = info.m_uIndex;
                        motorInfo->m_qIndex = info.m_qIndex;
                        
						// SliderParams slider(motorName,&motorInfo->m_velTarget);
						// slider.m_minVal=-4;
						// slider.m_maxVal=4;
                        SliderParams slider(motorName,&motorInfo->m_posTarget);
                        slider.m_minVal=-4;
                        slider.m_maxVal=4;
						if (m_guiHelper && m_guiHelper->getParameterInterface())
						{
							m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
						}
						m_numMotors++;
					}
				}
			}
		}
    }
}
开发者ID:artoowang,项目名称:bullet3,代码行数:59,代码来源:PhysicsClientExample.cpp


示例15: generateFrame

int generateFrame(char *frameName,
		  unsigned int frameNumber,
		  double gX,
		  double gY,
		  double gZ,
		  unsigned int speed,
		  double throttlePercentage,
		  double brakePercentage)
{
	cairo_surface_t *surface;
	cairo_t *cr;
	char frameText[80];


	surface = cairo_image_surface_create (
			CAIRO_FORMAT_ARGB32, SIZEX, SIZEY);
	cr = cairo_create (surface);
	cairo_save (cr);
	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
	// set alpha to produce transparency
	cairo_set_source_rgba (cr, 1, 1, 1, 0);
//	cairo_set_source_rgba (cr, 0, 0, 0.2, 1);
	cairo_paint (cr);
	cairo_restore (cr);
	cairo_move_to (cr, 17.5, 20);
	cairo_set_source_rgb (cr, 1, 1, 1);
	cairo_set_font_size(cr,20);
	sprintf(frameText,"%05u",frameNumber);
	cairo_show_text (cr, frameText);

//	G bubble
	renderGdot(cr,50,70,gX,gY,gZ);

//	throttle
	slider(cr,50,130,2,80,20,0.0,1.0,0.0,throttlePercentage);

//	brake
	slider(cr,50,160,2,80,20,1.0,0.0,0.0,brakePercentage);

	// save and clean up
	cairo_destroy (cr);
	cairo_surface_write_to_png (surface, frameName);
	cairo_surface_destroy (surface);

	return 0;
}
开发者ID:BGCX261,项目名称:ziplockk-embedded-svn-to-git,代码行数:46,代码来源:generator.c


示例16: b3Printf

void	RobotControlExample::stepSimulation(float deltaTime)
{
    m_physicsServer.processClientCommands();

	if (m_physicsClient.isConnected())
    {
		
		SharedMemoryStatus status;
		bool hasStatus = m_physicsClient.processServerStatus(status);
		if (hasStatus && status.m_type == CMD_URDF_LOADING_COMPLETED)
		{
			for (int i=0;i<m_physicsClient.getNumJoints();i++)
			{
				b3JointInfo info;
				m_physicsClient.getJointInfo(i,info);
				b3Printf("Joint %s at q-index %d and u-index %d\n",info.m_jointName,info.m_qIndex,info.m_uIndex);
				
                if (info.m_flags & JOINT_HAS_MOTORIZED_POWER)
                {
                    if (m_numMotors<MAX_NUM_MOTORS)
                    {
                        char motorName[1024];
                        sprintf(motorName,"%s q'", info.m_jointName);
                        MyMotorInfo* motorInfo = &m_motorTargetVelocities[m_numMotors];
                        motorInfo->m_velTarget = 0.f;
                        motorInfo->m_uIndex = info.m_uIndex;
                    
                        SliderParams slider(motorName,&motorInfo->m_velTarget);
                        slider.m_minVal=-4;
                        slider.m_maxVal=4;
                        m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
                        m_numMotors++;
                    }
                }
				
			}
		}

		
		if (m_physicsClient.canSubmitCommand())
		{
			if (m_userCommandRequests.size())
			{
				b3Printf("Outstanding user command requests: %d\n", m_userCommandRequests.size());
				SharedMemoryCommand& cmd = m_userCommandRequests[0];

				//a manual 'pop_front', we don't use 'remove' because it will re-order the commands
				for (int i=1;i<m_userCommandRequests.size();i++)
				{
					m_userCommandRequests[i-1] = m_userCommandRequests[i];
				}

				m_userCommandRequests.pop_back();
				m_physicsClient.submitClientCommand(cmd);
			}
		}
	}
}
开发者ID:T4Larson,项目名称:bullet3,代码行数:58,代码来源:RobotControlExample.cpp


示例17: dataDouble

void ECPotentiometer::dataChanged()
{
	m_resistance = dataDouble("resistance");
	
	QString display = QString::number( m_resistance / getMultiplier(m_resistance), 'g', 3 ) + getNumberMag(m_resistance) + QChar(0x3a9);
	setDisplayText( "res", display );
	
	sliderValueChanged( "slider", slider("slider")->value() );
}
开发者ID:Munrek,项目名称:ktechlab,代码行数:9,代码来源:ecpotentiometer.cpp


示例18: main

int main(int argc, char **argv) {

  int i=0;
  if (Fl::args(argc,argv,i,arg) < argc)
    Fl::fatal("Options are:\n -2 = 2 windows\n -f = startup fullscreen\n%s",Fl::help);

  Fl_Single_Window window(300,300+30*NUMB); window.end();

  shape_window sw(10,10,window.w()-20,window.h()-30*NUMB-20);
#if HAVE_GL
  sw.mode(FL_RGB);
#endif

  Fl_Window *w;
  if (twowindow) {	// make it's own window
    sw.resizable(&sw);
    w = &sw;
    window.set_modal();	// makes controls stay on top when fullscreen pushed
    argc--;
    sw.show();
  } else {		// otherwise make a subwindow
    window.add(sw);
    window.resizable(&sw);
    w = &window;
  }

  window.begin();

  int y = window.h()-30*NUMB-5;
  Fl_Hor_Slider slider(50,y,window.w()-60,30,"Sides:");
  slider.clear_flag(FL_ALIGN_MASK);
  slider.set_flag(FL_ALIGN_LEFT);
  slider.callback(sides_cb,&sw);
  slider.value(sw.sides);
  slider.step(1);
  slider.range(3,40);
  y+=30;

  Fl_Toggle_Light_Button b1(50,y,window.w()-60,30,"Double Buffered");
  b1.callback(double_cb,&sw);
  y+=30;

  Fl_Toggle_Light_Button b3(50,y,window.w()-60,30,"FullScreen");
  b3.callback(fullscreen_cb,w);
  y+=30;

  Fl_Button eb(50,y,window.w()-60,30,"Exit");
  eb.callback(exit_cb);
  y+=30;

  if (initfull) {b3.set(); b3.do_callback();}

  window.end();
  window.show(argc,argv);

  return Fl::run();
}
开发者ID:edeproject,项目名称:svn,代码行数:57,代码来源:fullscreen.cpp


示例19: updateSliderSize

void MSVGauge::updateSliderSize(double value_)
{
  if (gaugeHeight()<=slider()->shadowThickness()||value_<=valueMin()||value_>=valueMax()) 
   {
     drawSliderArea();
     drawGauge();
   }
  else updateGauge((int)(value_));
  MSString buffer;
  valueWin()->updateValue(formatValue(buffer,value_));
}
开发者ID:PlanetAPL,项目名称:a-plus,代码行数:11,代码来源:MSVGauge.C


示例20: OCDataWidget

OCRuler::OCRuler(OQCanvas *c)
	:	OCDataWidget(c),
		vmin(0), vmax(0), vcur(0), vslide(0),
		off_x(0), off_y(0)
{
	setBindLimit(1);
	attachChild(new QSlider(Horizontal, getParent()));
	slider()->setTracking(false);
	connect(slider(), SIGNAL(valueChanged(int)), SLOT(valueChanged(int)));
	connect(slider(), SIGNAL(sliderMoved(int)), SLOT(sliderMoved(int)));
}
开发者ID:ivandeex,项目名称:optikus,代码行数:11,代码来源:ocranges.cpp



注:本文中的slider函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sliderMoved函数代码示例发布时间:2022-05-30
下一篇:
C++ slice_del函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap