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

C++ btn函数代码示例

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

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



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

示例1: Scene

void VCButton_Test::copy()
{
    QWidget w;

    Scene* sc = new Scene(m_doc);
    m_doc->addFunction(sc);

    VCButton btn(&w, m_doc);
    btn.setCaption("Foobar");
    btn.setIconPath("../../../resources/icons/png/qlcplus.png");
    btn.setFunction(sc->id());
    btn.setAction(VCButton::Flash);
    btn.setKeySequence(QKeySequence(keySequenceB));
    btn.enableStartupIntensity(true);
    btn.setStartupIntensity(qreal(0.2));

    VCFrame parent(&w, m_doc);
    VCButton* copy = qobject_cast<VCButton*> (btn.createCopy(&parent));
    QVERIFY(copy != NULL);
    QCOMPARE(copy->caption(), QString("Foobar"));
    QCOMPARE(copy->iconPath(), QString("../../../resources/icons/png/qlcplus.png"));
    QCOMPARE(copy->function(), sc->id());
    QCOMPARE(copy->action(), VCButton::Flash);
    QCOMPARE(copy->keySequence(), QKeySequence(keySequenceB));
    QCOMPARE(copy->isStartupIntensityEnabled(), true);
    QCOMPARE(copy->startupIntensity(), qreal(0.2));
    delete copy;
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:28,代码来源:vcbutton_test.cpp


示例2: Scene

void VCButton_Test::copy()
{
    QWidget w;

    Scene* sc = new Scene(m_doc);
    m_doc->addFunction(sc);

    VCButton btn(&w, m_doc);
    btn.setCaption("Foobar");
    btn.setIcon("../../../gfx/qlc.png");
    btn.setFunction(sc->id());
    btn.setAction(VCButton::Flash);
    btn.setKeySequence(QKeySequence(keySequenceB));
    btn.setAdjustIntensity(true);
    btn.setIntensityAdjustment(0.2);

    VCFrame parent(&w, m_doc);
    VCButton* copy = qobject_cast<VCButton*> (btn.createCopy(&parent));
    QVERIFY(copy != NULL);
    QCOMPARE(copy->caption(), QString("Foobar"));
    QCOMPARE(copy->icon(), QString("../../../gfx/qlc.png"));
    QCOMPARE(copy->function(), sc->id());
    QCOMPARE(copy->action(), VCButton::Flash);
    QCOMPARE(copy->keySequence(), QKeySequence(keySequenceB));
    QCOMPARE(copy->adjustIntensity(), true);
    QCOMPARE(copy->intensityAdjustment(), qreal(0.2));
    delete copy;
}
开发者ID:skogkatten,项目名称:qlcplus,代码行数:28,代码来源:vcbutton_test.cpp


示例3: btn

void VCButton_Test::paint()
{
    QWidget w;

    VCButton btn(&w, m_doc);

    w.show();
    btn.show();

    QTest::qWait(1);

    btn.setOn(true);
    btn.update();
    QTest::qWait(1);
    btn.setOn(false);
    btn.update();
    QTest::qWait(1);
    btn.setIconPath("../../../resources/icons/png/qlcplus.png");
    btn.update();
    QTest::qWait(1);
    btn.setCaption("Foobar");
    btn.update();
    QTest::qWait(1);
    btn.setAction(VCButton::Flash);
    btn.update();
    QTest::qWait(1);
    m_doc->setMode(Doc::Operate);
    btn.update();
    QTest::qWait(1);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:30,代码来源:vcbutton_test.cpp


示例4: menu_set_adc_direction

// channel if from 0
static void menu_set_adc_direction(u8 channel) {
    u16 adc, calm;

    // for channel 2 use throttle, for others steering
    if (channel == 1) {
	adc = adc_throttle_ovs;
	calm = cg.calib_throttle_mid;
    }
    else {
	adc = adc_steering_ovs;
	calm = cg.calib_steering_mid;
    }

    // check steering firstly
    if (adc_steering_ovs < ((cg.calib_steering_mid - 40) << ADC_OVS_SHIFT))
	menu_adc_direction = 0;
    else if (adc_steering_ovs > ((cg.calib_steering_mid + 40) << ADC_OVS_SHIFT))
	menu_adc_direction = 1;

    // then check throttle
    if (adc_throttle_ovs < ((cg.calib_throttle_mid - 40) << ADC_OVS_SHIFT))
	menu_adc_direction = 0;
    else if (adc_throttle_ovs > ((cg.calib_throttle_mid + 40) << ADC_OVS_SHIFT))
	menu_adc_direction = 1;

    // and then CH3 button
    else if (btn(BTN_CH3))  menu_adc_direction ^= 1;

    // if this channel is using forced values, set it to left/right
    if (menu_force_value_channel)
	menu_force_value = menu_adc_direction ? PPM(500) : PPM(-500);
}
开发者ID:Micha500,项目名称:gt3b,代码行数:33,代码来源:menu.c


示例5: menu_name_func

// change model name
static void menu_name_func(u8 action, void *p) {
    u8 letter;

    if (action == MCA_SET_CHG) {
	// change letter
	letter = cm.name[menu_set];
	if (btn(BTN_ROT_L)) {
	    // lower
	    if (letter == '0')      letter = 'Z';
	    else if (letter == 'A')	letter = '9';
	    else                    letter--;
	}
	else {
	    // upper
	    if (letter == '9')      letter = 'A';
	    else if (letter == 'Z')	letter = '0';
	    else                    letter++;
	}
	cm.name[menu_set] = letter;
    }
    else if (action == MCA_SET_NEXT) {
	// next char
	if (++menu_set > 2)  menu_set = 0;
    }

    // show name
    menu_blink = (u8)(1 << menu_set);	// blink only selected char
    lcd_segment(LS_SYM_MODELNO, LS_ON);
    lcd_chars(cm.name);
}
开发者ID:Micha500,项目名称:gt3b,代码行数:31,代码来源:menu.c


示例6: bgColor

void BookmarkView::updateTheme() {
    wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground);
    wxColour textColor(ThemeMgr::mgr.currentTheme->text);
    wxColour btn(ThemeMgr::mgr.currentTheme->button);
    wxColour btnHl(ThemeMgr::mgr.currentTheme->buttonHighlight);
    
    SetBackgroundColour(bgColor);

    m_treeView->SetBackgroundColour(bgColor);
    m_treeView->SetForegroundColour(textColor);
    
    m_propPanel->SetBackgroundColour(bgColor);
    m_propPanel->SetForegroundColour(textColor);

    m_buttonPanel->SetBackgroundColour(bgColor);
    m_buttonPanel->SetForegroundColour(textColor);
    
    m_labelLabel->SetForegroundColour(textColor);
    m_frequencyVal->SetForegroundColour(textColor);
    m_frequencyLabel->SetForegroundColour(textColor);
    m_bandwidthVal->SetForegroundColour(textColor);
    m_bandwidthLabel->SetForegroundColour(textColor);
    m_modulationVal->SetForegroundColour(textColor);
    m_modulationLabel->SetForegroundColour(textColor);
    
    refreshLayout();
}
开发者ID:Dantali0n,项目名称:CubicSDR,代码行数:27,代码来源:BookmarkView.cpp


示例7: CRect

bool ViewCaption::Create(CWnd* parent, int toolbarBmp, const int commands[], int count,
						 const boost::function<void (void)>& on_clicked)
{
	on_clicked_ = on_clicked;

	CDC dc;
	dc.CreateCompatibleDC(0);
	dc.SelectStockObject(DEFAULT_GUI_FONT);
	TEXTMETRIC tm;
	dc.GetTextMetrics(&tm);
	int h= tm.tmHeight + tm.tmInternalLeading + 2;	// yes, internal leading is already in tmHeight

	if (!CWnd::Create(AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, AfxGetApp()->LoadStandardCursor(IDC_ARROW), 0, 0),
		0, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, CRect(0,0,0,h), parent, -1))
		return false;

	if (!caption_.IsValid())
		VERIFY(LoadPingFromRsrc(MAKEINTRESOURCE(IDB_VIEW_CAPTION), caption_));
	if (!active_marker_.IsValid())
		VERIFY(LoadPingFromRsrc(MAKEINTRESOURCE(IDB_ACTIVE_VIEW), active_marker_));

	toolbar_.SetOnIdleUpdateState(false);

	FancyToolBar::Params p;
	p.shade = -0.28f;
	std::string btn(count, 'p');
	if (!toolbar_.Create(this, btn.c_str(), commands, toolbarBmp, &p))
		return false;

	toolbar_.SetPadding(CRect(5,4,5,4));
	toolbar_.SetOption(FancyToolBar::HOT_OVERLAY, false);
	toolbar_.SetOwner(parent);

	return true;
}
开发者ID:mikekov,项目名称:ExifPro,代码行数:35,代码来源:ViewCaption.cpp


示例8: main

int main(int argc, char **argv)
{
  Iup::Open(argc, argv);

  Iup::Frame frame(Iup::List().SetAttributes("DROPDOWN=YES, 1=Test, 2=XXX, VALUE=1"));
  frame.SetAttribute("TITLE", "List");

  Iup::Text text;

  text.SetAttributes("EXPAND = YES, VALUE = \"Enter your text here\"");
  
  /* Creates a label */
  Iup::Label lbl("This element is a label");

  /* Creatas a button */
  Iup::Button btn("This button does nothing");

  /* Creates handles for manipulating the zbox VALUE */
  Iup::SetHandle("frame", frame);
  Iup::SetHandle("text", text);
  Iup::SetHandle("lbl", lbl);
  Iup::SetHandle("btn", btn);
	
  /* Creates zbox with four elements */
  Iup::Zbox zbox(frame, text, lbl, btn);

  /* Sets zbox alignment */
  zbox.SetAttribute("ALIGNMENT", "ACENTER");
  zbox.SetAttribute("VALUE", "text");
  zbox.SetAttribute("NAME", "ZBOX");

  Iup::List list;
  Iup::Hbox hbox(list);

    /* Creates frame */
  Iup::Frame frm(hbox);

  /* Creates dialog */
  Iup::Dialog dlg
  (
    Iup::Vbox
    (
      frm,
      zbox
    )
  );

  list.SetAttributes("1 = frame, 2 = text, 3 = lbl, 4 = btn, VALUE=2");
  frm.SetAttribute("TITLE", "Select an element");
  dlg.SetAttributes("MARGIN=10x10, GAP=10, TITLE = \"IupZbox Example\"");
  list.SetCallback("ACTION", (Icallback)list_cb);

  dlg.ShowXY(IUP_CENTER, IUP_CENTER);

  Iup::MainLoop();

  Iup::Close();

  return 0;
}
开发者ID:svn2github,项目名称:iup-github,代码行数:60,代码来源:zbox.cpp


示例9: main

int main(int argc, char* argv[]) {
    QApplication app(argc, argv);
    QPushButton btn("Quit");
    QObject::connect(&btn, &QPushButton::clicked, &app, &QApplication::quit);
    btn.show();

    return app.exec();
}
开发者ID:heejune,项目名称:meetup-qt,代码行数:8,代码来源:main.cpp


示例10: Buttons

// ----------------------------------------------------------------------
void EventInputQueue::push_RelativePointerEventCallback(OSObject* target,
                                                        int buttons_raw,
                                                        int dx,
                                                        int dy,
                                                        AbsoluteTime ts,
                                                        OSObject* sender,
                                                        void* refcon) {
  GlobalLock::ScopedLock lk;
  if (!lk) return;

  Params_RelativePointerEventCallback::log(true, Buttons(buttons_raw), dx, dy);

  // ------------------------------------------------------------
  Buttons buttons(buttons_raw);
  Buttons justPressed;
  Buttons justReleased;

  IOHIPointing* device = OSDynamicCast(IOHIPointing, sender);
  if (!device) return;

  ListHookedPointing::Item* item = static_cast<ListHookedPointing::Item*>(ListHookedPointing::instance().get(device));
  if (!item) return;

  // ------------------------------------------------------------
  CommonData::setcurrent_ts(ts);

  // ------------------------------------------------------------
  justPressed = buttons.justPressed(item->get_previousbuttons());
  justReleased = buttons.justReleased(item->get_previousbuttons());
  item->set_previousbuttons(buttons);

  // ------------------------------------------------------------
  // divide an event into button and cursormove events.
  for (int i = 0; i < ButtonStatus::MAXNUM; ++i) {
    PointingButton btn(1 << i);
    if (justPressed.isOn(btn)) {
      Params_RelativePointerEventCallback params(buttons, 0, 0, btn, true);
      bool retainFlagStatusTemporaryCount = Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_lazy_modifiers_with_mouse_event);
      enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
    }
    if (justReleased.isOn(btn)) {
      Params_RelativePointerEventCallback params(buttons, 0, 0, btn, false);
      bool retainFlagStatusTemporaryCount = Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_lazy_modifiers_with_mouse_event);
      enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
    }
  }
  // If (dx == 0 && dy == 0), the event is either needless event or just pressing/releasing buttons event.
  // About just pressing/releasing buttons event, we handled these in the above processes.
  // So, we can drop (dx == 0 && dy == 0) events in here.
  if (dx != 0 || dy != 0) {
    Params_RelativePointerEventCallback params(buttons, dx, dy, PointingButton::NONE, false);
    bool retainFlagStatusTemporaryCount = true;
    enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
  }

  setTimer();
}
开发者ID:piaowenjie,项目名称:Karabiner,代码行数:58,代码来源:EventInputQueue.cpp


示例11: children

	void CCControlBase::layoutChildren(ELayoutMode layoutMode, bool resize)	{
		// now check for all sub layers and call needsLayout to
		CCArray* children(getChildren());
		CCObject* child;

		const float verticalOffset(static_cast<float>(m_marginV));


		if(resize == true)	{

			const CCSize& currentContentSize(getContentSize());
			float contentHeight(verticalOffset);
			// determine the new content height
			CCARRAY_FOREACH(children, child)
			{
				CCControlBase* ctrlBase(dynamic_cast<CCControlBase*>(child));
				if(ctrlBase != nullptr)	{
					CCSize preferredSize(CCSizeMake(currentContentSize.width - (m_marginH * 2),0));
					CCSize ctrlPreferredSize(ctrlBase->getPreferredSize());
					ctrlPreferredSize.width = preferredSize.width;
					ctrlBase->setPreferredSize(ctrlPreferredSize);
					ctrlBase->needsLayout();

					contentHeight += ctrlBase->getContentSize().height;
					contentHeight += verticalOffset;
				}
				else	{
					CCScale9Sprite* sprite(dynamic_cast<CCScale9Sprite*>(child));
					if(sprite == _backGroundSprite)	{

					}
					else	{
						CCControlButton* btn(dynamic_cast<CCControlButton*>(child));
						if(btn != nullptr)	{
							contentHeight += (btn->getContentSize().height + verticalOffset * 2);
							contentHeight += verticalOffset * 2;
						}
						else	{
							CCNode* node(dynamic_cast<CCNode*>(child));
							if(node != nullptr)	{
								contentHeight += node->getContentSize().height;
								contentHeight += verticalOffset;
							}
						}
					}
				}
			}

			CCSize newContentSize(getContentSize());
			newContentSize.height = contentHeight;
			setPreferredSize(newContentSize);
			needsLayout();
			layoutChildren(ELayoutMode_topLeftDown);
		}
开发者ID:Mobiletainment,项目名称:Multiplayer-Network-Conecpts,代码行数:54,代码来源:CCControlBase.cpp


示例12: main

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QPushButton btn("Hello World");
    btn.show();

    app.exec();

    return 0;
}
开发者ID:ynonp,项目名称:Qt-Examples-July7,代码行数:11,代码来源:main.cpp


示例13: elm

Handler<Element> TabCombo::removeChild(std::size_t const& idx)
{
	Handler<Element> elm(this->frame_->removeChild(idx));
	auto const it = this->buttonMap_.find(elm);
	Handler<TabButton> btn(it->second);
	this->buttonMap_.erase(it);
	this->buttons_->removeChild(btn);
	if(Handler<Element> front = this->frontChild()){ //もうボタンが残っていない場合、nullが帰ってくるので
		updateButtonState(front, Handler<TabButton>());
	}
	return elm;
}
开发者ID:kaiinui,项目名称:Chisa,代码行数:12,代码来源:TabCombo.cpp


示例14: main

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

    /*	1.建立QT应用	*/
    QApplication app(argc,argv);

    /* 使中文正常显示	*/
    QTextCodec *codec=QTextCodec::codecForName("gb2312");
    QTextCodec::setCodecForTr(codec);

    /*	2.建立窗体		*/
    QWidget win;

    /*	3.调用窗体方法控制窗体		*/
    //窗体大小400*300
    win.resize(400,300);
    //居中显示
    win.move((1024-400)/2,(768-300)/2);

    //添加button 在窗体中
    QPushButton btn("OK",&win);
    btn.resize(100,30);
    btn.move(100,100);

    // 	添加QLineEdit对象		在窗体中
    //	使中文正常显示
    QLineEdit le(QObject::tr("你好"),&win);
    le.resize(50,50);
    le.move(20,20);

    MySlots myslo;
    /* 点击按钮弹出一个messagebox
    QObject::connect(
    	&btn,//信号发送者
    	SIGNAL(clicked()),//发送的信号
    	&myslo,//信号发送的槽函数的对象
    	SLOT(handle())//槽函数
    );
    */

    /* 点击按钮退出窗体	*/
    QObject::connect(
        &btn,//信号发送者
        SIGNAL(clicked()),//发送的信号
        &app,//信号发送的槽函数的对象
        SLOT(quit())//槽函数
    );

    win.setVisible(true);
    /*	4.等待所有窗体子线程终止	*/
    return app.exec();

}
开发者ID:hjd919,项目名称:recipes,代码行数:53,代码来源:main.cpp


示例15: btn

Handler<Element> TabCombo::removeChild(Handler<Element> const& h)
{
	auto it = this->buttonMap_.find(h);
	Handler<TabButton> btn(it->second);
	this->buttonMap_.erase(it);
	this->buttons_->removeChild(btn);
	this->frame_->removeChild(h);
	if(Handler<Element> front = this->frontChild()){ //もうボタンが残っていない場合、nullが帰ってくるので
		updateButtonState(front, Handler<TabButton>());
	}
	return h;
}
开发者ID:kaiinui,项目名称:Chisa,代码行数:12,代码来源:TabCombo.cpp


示例16: switch

void MediaView::touchEvent(QTouchEvent *e) {
	switch (e->type()) {
	case QEvent::TouchBegin:
		if (_touchPress || e->touchPoints().isEmpty()) return;
		_touchTimer.start(QApplication::startDragTime());
		_touchPress = true;
		_touchMove = _touchRightButton = false;
		_touchStart = e->touchPoints().cbegin()->screenPos().toPoint();
		break;

	case QEvent::TouchUpdate:
		if (!_touchPress || e->touchPoints().isEmpty()) return;
		if (!_touchMove && (e->touchPoints().cbegin()->screenPos().toPoint() - _touchStart).manhattanLength() >= QApplication::startDragDistance()) {
			_touchMove = true;
		}
		break;

	case QEvent::TouchEnd:
		if (!_touchPress) return;
		if (!_touchMove && App::wnd()) {
			Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(App::wnd()->mapFromGlobal(_touchStart));

			QMouseEvent pressEvent(QEvent::MouseButtonPress, mapped, winMapped, _touchStart, btn, Qt::MouseButtons(btn), Qt::KeyboardModifiers());
			pressEvent.accept();
			mousePressEvent(&pressEvent);

			QMouseEvent releaseEvent(QEvent::MouseButtonRelease, mapped, winMapped, _touchStart, btn, Qt::MouseButtons(btn), Qt::KeyboardModifiers());
			mouseReleaseEvent(&releaseEvent);

			if (_touchRightButton) {
				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
				contextMenuEvent(&contextEvent);
			}
		} else if (_touchMove) {
			if ((!_leftNavVisible || !_leftNav.contains(mapFromGlobal(_touchStart))) && (!_rightNavVisible || !_rightNav.contains(mapFromGlobal(_touchStart)))) {
				QPoint d = (e->touchPoints().cbegin()->screenPos().toPoint() - _touchStart);
				if (d.x() * d.x() > d.y() * d.y() && (d.x() > st::medviewSwipeDistance || d.x() < -st::medviewSwipeDistance)) {
					moveToPhoto(d.x() > 0 ? -1 : 1);
				}
			}
		}
		_touchTimer.stop();
		_touchPress = _touchMove = _touchRightButton = false;
		break;

	case QEvent::TouchCancel:
		_touchPress = false;
		_touchTimer.stop();
		break;
	}
}
开发者ID:CapnRat,项目名称:tdesktop,代码行数:52,代码来源:mediaview.cpp


示例17: sourceBtnsLyt

QGroupBox* GuiPreferences::createCommonGrp(void)
{
  QHBoxLayout* sourceBtnsLyt(new QHBoxLayout());
  sourceBtnsLyt = new QHBoxLayout();
  sourceBtnsLyt->setContentsMargins(0,0,0,0);
  sourceBtnsLyt->setMargin(0);
  for (int i=0; i<MAX_SRCS; ++i)
  {
    QRadioButton* btn(new QRadioButton(QString::number(i)));
    btn->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    m_sourceBtns.push_back(btn);
    connect(btn, SIGNAL(clicked()), this, SLOT(handleSourceSelected()));
    sourceBtnsLyt->addWidget(btn);
  }
  int line =0;
  QGridLayout* lyt(new QGridLayout());

  lyt->addWidget(new QLabel(tr("Sources")), line, 0),
      lyt->addLayout(sourceBtnsLyt, line, 1, 1, 1, Qt::AlignLeft);

  lyt->addWidget(new QLabel(tr("Monitor Web URL*")), ++line, 0),
      lyt->addWidget(m_monitorUrlField, line, 1),
      m_monitorTypeField->addItem(tr("Select a monitor type")),
      m_monitorTypeField->addItems(ngrt4n::sourceTypes()),
      lyt->addWidget(m_monitorTypeField, line, 2);

  lyt->addWidget(m_verifySslPeerChkBx, ++line, 0, 1, 3, Qt::AlignCenter);

  lyt->addWidget(new QLabel(tr("Auth String")), ++line, 0),
      lyt->addWidget(m_serverPassField, line, 1),
      lyt->addWidget(m_showAuthInfoChkbx, line, 2);

  lyt->addWidget(new QLabel(tr("Update Interval")), ++line, 0),
      m_updateIntervalField->setMinimum(5),
      m_updateIntervalField->setMaximum(1200),
      lyt->addWidget(m_updateIntervalField, line, 1),
      lyt->addWidget(new QLabel(tr("seconds")), line, 2);

  lyt->addWidget(new QLabel(tr("Language")), ++line, 0),
      lyt->addWidget(m_languageBoxField);

  lyt->setColumnStretch(0, 0);
  lyt->setColumnStretch(1, 1);

  QGroupBox* bx(new QGroupBox(tr("Common Settings")));
  bx->setFlat(false);
  bx->setLayout(lyt);
  bx->setAlignment(Qt::AlignLeft);
  return bx;
}
开发者ID:RealOpInsightLabs,项目名称:realopinsight-workstation,代码行数:51,代码来源:GuiPreferences.cpp


示例18: main

//
// Main Routine
//
int main(void) {
#ifdef DEBUG
	CSerial ser;		// declare a UART object
	ser.enable();
	CDebug dbg(ser);	// Debug stream use the UART object
	dbg.start();
#endif

	//
	// Optional: Enable tickless technology
	//
#ifndef DEBUG
	CPowerSave::tickless(true);
#endif

	//
	// Your setup code here
	//
	CButton btn(BUTTON_PIN_0);

	CBuzzer buz(15);	// buzzer on P0.15
	buz.enable();

	CPin led(LED_PIN_0);
	led.output();

	CTimeout tmLED;

	//
    // Enter main loop.
	//
    while(1) {
    	//
    	// Your loop code here
    	//
    	switch(btn.isPressed()) {
    	case BTN_PRESSED:
    		buz.post(3);	// turn on buzzer x 3
    		break;
    	case BTN_RELEASED:
    		break;
    	case BTN_NOTHING:
    		break;
    	}

    	if ( tmLED.isExpired(500) ) {
    		tmLED.reset();
    		led.toggle();
    	}
    }
}
开发者ID:cooliotseng,项目名称:nano51822,代码行数:54,代码来源:main.cpp


示例19: gs_backlight_time

static void gs_backlight_time(u8 change) {
    s8 i;
    u16 *addr = &cg.backlight_time;

    if (change == 0xff) {
	lcd_set(L7SEG, LB_EMPTY);
	return;
    }
    if (change) {
	if (btn(BTN_ROT_L)) {
	    // find lower value
	    for (i = BL_STEPS_SIZE - 1; i >= 0; i--) {
		if (bl_steps[i] >= *addr)  continue;
		*addr = bl_steps[i];
		break;
	    }
	    if (i < 0)
		*addr = bl_steps[BL_STEPS_SIZE - 1];
	}
	else {
	    // find upper value
	    for (i = 0; i < BL_STEPS_SIZE; i++) {
		if (bl_steps[i] <= *addr)  continue;
		*addr = bl_steps[i];
		break;
	    }
	    if (i == BL_STEPS_SIZE)
		*addr = bl_steps[0];
	}
    }
    lcd_7seg(L7_L);
    if (*addr < 60) {
	// seconds
	bl_num2((u8)*addr);
	lcd_char(LCHR3, 'S');
    }
    else if (*addr < 3600) {
	// minutes
	bl_num2((u8)(*addr / 60));
	lcd_char(LCHR3, 'M');
    }
    else if (*addr != BACKLIGHT_MAX) {
	// hours
	bl_num2((u8)(*addr / 3600));
	lcd_char(LCHR3, 'H');
    }
    else {
	// max
	lcd_chars("MAX");
    }
}
开发者ID:losikid,项目名称:gt3b,代码行数:51,代码来源:menu_global.c


示例20: btn

void VCButton_Test::icon()
{
    QWidget w;

    VCButton btn(&w, m_doc);
    m_doc->resetModified();
    btn.setIcon("../../../gfx/qlc.png");
    QCOMPARE(btn.icon(), QString("../../../gfx/qlc.png"));
    QCOMPARE(m_doc->isModified(), true);

    m_doc->resetModified();
    btn.slotResetIcon();
    QCOMPARE(btn.icon(), QString());
    QCOMPARE(m_doc->isModified(), true);
}
开发者ID:skogkatten,项目名称:qlcplus,代码行数:15,代码来源:vcbutton_test.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ btrfs_alloc_path函数代码示例发布时间:2022-05-30
下一篇:
C++ btd_service_get_device函数代码示例发布时间: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