AMSimpleBeamConfigurationWizard::AMSimpleBeamConfigurationWizard(QWidget *parent)
	: AMGraphicsViewWizard(parent)
{
	setNumberOfPoints(3);
	setNumberOfPages(numberOfPoints());
	setFreePage(Page_Free);

	coordinateListAppend(new QVector3D(0,0,0));
	coordinateListAppend(new QVector3D(0,2,0));
	coordinateListAppend(new QVector3D(0,-2,0));

	setPage(Page_Intro, new AMWizardPage);
	setPage(Page_Option, new AMWizardOptionPage);
	setPage(Page_Final, new AMWizardPage);
	for(int i = 0; i < numberOfPages(); i++)
	{
		setPage(pageWait(i), new AMSimpleBeamConfigurationWaitPage);
		setPage(pageSet(i), new AMSimpleBeamConfigurationSetPage);
		connect(page(pageSet(i)), SIGNAL(initBeamShape()), this, SLOT(initBeamShape()));
		connect(page(pageSet(i)), SIGNAL(signalMousePressed(QPointF)), this, SLOT(mousePressedHandler(QPointF)));
		connect(page(pageSet(i)), SIGNAL(moveBeamShape(QPointF)), this, SLOT(moveBeamShapeHandler(QPointF)));
	}

	setStartId(Page_Intro);
	setOption(HaveHelpButton, true);
	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

	setWindowTitle(message(Wizard_Title));

	disconnect(button(QWizard::BackButton), SIGNAL(clicked()), this, SLOT(back()));
	connect(button(QWizard::BackButton), SIGNAL(clicked()), this, SLOT(back()));

	setMinimumSize(600,600);

	/// Add options button to intro page
	addOptionPage(Page_Intro);

}
void NotificationIcon::about_dialog(){
    QDialog aboutDialog(0, Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
    QLabel l("<h1>MiptTelecomBalance</h1>\
            \nThis program allows you to monitor\n\
            the balance of your personal account\n\
            in \"MIPT-TELECOM\"\n\
            Authors:");
    l.setWordWrap(true);
    QLabel l1, l2, l3;
    l1.setText("<h3>Lantsov Alexander</h3>");
    l2.setText("<h3>Kudinova Marina</h3>");
    l3.setText("<h3>Alekseeva Maria</h3>");
    
    QString img[4] = { AttentionPath, PositivePath, NegativePath, ProblemPath };
    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
    
    QLabel lp1, lp2, lp3;
    QPixmap p1(img[qrand() % 4]);
    QPixmap p2(img[qrand() % 4]);
    QPixmap p3(img[qrand() % 4]);
    lp1.setPixmap(p1);
    lp2.setPixmap(p2);
    lp3.setPixmap(p3);
    
    lp1.setFixedSize(p1.width(),p1.height());
    lp2.setFixedSize(p2.width(),p2.height());    
    lp3.setFixedSize(p3.width(),p3.height());
    



    QPushButton button("OK");

    QGridLayout layout;
    layout.addWidget(&l  , 0, 0, 1, 2);
    layout.addWidget(&lp1, 1, 0);
    layout.addWidget(&l1 , 1, 1);
    layout.addWidget(&lp2, 2, 0);
    layout.addWidget(&l2 , 2, 1);
    layout.addWidget(&lp3, 3, 0);
    layout.addWidget(&l3 , 3, 1);
    layout.addWidget(&button, 4, 0, 1, 2);
    QObject::connect(&button, SIGNAL(clicked()), &aboutDialog, SLOT(accept()));
    aboutDialog.setLayout(&layout);
	aboutDialog.setWindowTitle("About");
    //aboutDialog.setFixedSize( aboutDialog.sizeHint() );
    layout.setSizeConstraint( QLayout::SetFixedSize );
    aboutDialog.show();
    aboutDialog.exec();
}
示例#3
0
void LLWidgetReg::initClass(bool register_widgets)
{
	// Only need to register if the Windows linker has optimized away the
	// references to the object files.
	if (register_widgets)
	{
		LLDefaultChildRegistry::Register<LLButton> button("button");
		LLDefaultChildRegistry::Register<LLMenuButton> menu_button("menu_button");
		LLDefaultChildRegistry::Register<LLCheckBoxCtrl> check_box("check_box");
		LLDefaultChildRegistry::Register<LLComboBox> combo_box("combo_box");
		LLDefaultChildRegistry::Register<LLFilterEditor> filter_editor("filter_editor");
		LLDefaultChildRegistry::Register<LLFlyoutButton> flyout_button("flyout_button");
		LLDefaultChildRegistry::Register<LLContainerView> container_view("container_view");
		LLDefaultChildRegistry::Register<LLIconCtrl> icon("icon");
		LLDefaultChildRegistry::Register<LLLoadingIndicator> loading_indicator("loading_indicator");
		LLDefaultChildRegistry::Register<LLLineEditor> line_editor("line_editor");
		LLDefaultChildRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
		LLDefaultChildRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
		LLDefaultChildRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
		LLDefaultChildRegistry::Register<LLMenuGL> menu("menu");
		LLDefaultChildRegistry::Register<LLMenuBarGL> menu_bar("menu_bar");
		LLDefaultChildRegistry::Register<LLContextMenu> context_menu("context_menu");
		LLDefaultChildRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
		LLDefaultChildRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
		LLDefaultChildRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
		LLDefaultChildRegistry::Register<LLLayoutStack> layout_stack("layout_stack");
		LLDefaultChildRegistry::Register<LLProgressBar> progress_bar("progress_bar");
		LLDefaultChildRegistry::Register<LLRadioGroup> radio_group("radio_group");
		LLDefaultChildRegistry::Register<LLSearchEditor> search_editor("search_editor");
		LLDefaultChildRegistry::Register<LLScrollContainer> scroll_container("scroll_container");
		LLDefaultChildRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
		LLDefaultChildRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list");
		LLDefaultChildRegistry::Register<LLSlider> slider_bar("slider_bar");
		LLDefaultChildRegistry::Register<LLSliderCtrl> slider("slider");
		LLDefaultChildRegistry::Register<LLSpinCtrl> spinner("spinner");
		LLDefaultChildRegistry::Register<LLStatBar> stat_bar("stat_bar");
		//LLDefaultChildRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder");
		LLDefaultChildRegistry::Register<LLTabContainer> tab_container("tab_container");
		LLDefaultChildRegistry::Register<LLTextBox> text("text");
		LLDefaultChildRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor");
		LLDefaultChildRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl");
		LLDefaultChildRegistry::Register<LLStatView> stat_view("stat_view");
		//LLDefaultChildRegistry::Register<LLUICtrlLocate> locate("locate");
		//LLDefaultChildRegistry::Register<LLUICtrlLocate> pad("pad");
		LLDefaultChildRegistry::Register<LLViewBorder> view_border("view_border");
	}

	// *HACK: Usually this is registered as a viewer text editor
	LLDefaultChildRegistry::Register<LLTextEditor> text_editor("text_editor");
}
示例#4
0
void ECKeyPad::dataChanged() {
    initPins(dataInt("numCols"));

    bool useToggle = dataBool("useToggles");
    bool bounce = dataBool("bounce");
    int bouncePeriod_ms = int(dataDouble("bounce_period") * 1e3);

    for (unsigned i = 0; i < 4; i++) {
        for (unsigned j = 0; j < m_numCols; j++) {
            button(buttonID(i, j))->setToggle(useToggle);
            m_switch[i][j]->setBounce(bounce, bouncePeriod_ms);
        }
    }
}
示例#5
0
void run_info_window(){
	draw_3dbox(500,125,620,215,1);
	setlinestyle(SOLID_LINE,1,3);
	setcolor(1);
	line(502,125,618,125);
	setcolor(7);
	line(501,125,501,125);
	button(510,120,610,205,15,1);
	settextstyle(0,0,1);
	color_text(518,130,"Pressed:",4);
	color_text(518,150,"Correct:",4);
	color_text(518,170,"Wrong  :",4);
	color_text(518,190,"B.space:",4);
}
示例#6
0
CompatDB::CompatDB(QWidget* parent)
    : QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
      ui{std::make_unique<Ui::CompatDB>()} {
    ui->setupUi(this);
    connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(ui->radioButton_Okay, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(ui->radioButton_Bad, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(ui->radioButton_IntroMenu, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(ui->radioButton_WontBoot, &QRadioButton::clicked, this, &CompatDB::EnableNext);
    connect(button(NextButton), &QPushButton::clicked, this, &CompatDB::Submit);
    connect(&testcase_watcher, &QFutureWatcher<bool>::finished, this,
            &CompatDB::OnTestcaseSubmitted);
}
示例#7
0
void init_exportwin(void)
{
  short dummy;
  
  rsrc_gaddr(R_TREE,EXPORT,&export_win.dialog);
  strncpy(export_win.w_name,alerts[WN_EXPORT],MAXWINSTRING);
  export_win.attr=NAME|MOVE|CLOSE;
  export_win.icondata=NULL;
  export_win.status=WINDOW_CLOSED;
  export_win.type=TYPE_DIALOG;
  form_center(export_win.dialog, &dummy, &dummy, &dummy, &dummy);

  button(&export_win,EXPORT_TYPE_0,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_1,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_2,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_3,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_4,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_5,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_6,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_7,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_8,CLEAR_STATE,SELECTED,FALSE);
  button(&export_win,EXPORT_TYPE_9,CLEAR_STATE,SELECTED,FALSE);
}
示例#8
0
QAccessible::Role QAccessibleToolButton::role() const
{
    QAbstractButton *ab = button();

#ifndef QT_NO_MENU
    QToolButton *tb = qobject_cast<QToolButton*>(ab);
    if (!tb->menu())
        return tb->isCheckable() ? QAccessible::CheckBox : QAccessible::PushButton;
    else if (tb->popupMode() == QToolButton::DelayedPopup)
        return QAccessible::ButtonDropDown;
#endif

    return QAccessible::ButtonMenu;
}
void MenuPanel::createButton(const ButtonInfo& info)
{
    std::unique_ptr<Button> button(new Button(info.id, info.style, m_position, info.position, info.triggers));

    button->registerOnPressed([this](const Button& sender)
    {
        if(m_clickCallback != nullptr)
            m_clickCallback(sender);
    });

    button->setToolTip(info.toolTip);
    button->setVisibleWhenId(info.visibleWhenId);
    m_elements.push_back(std::move(button));
}
示例#10
0
QT_BEGIN_NAMESPACE

ConversionWizard::ConversionWizard()
{
    setWindowIcon(QIcon(QLatin1String(":/qt-project.org/qhelpconverter/assistant.png")));
    setWindowTitle(tr("Help Conversion Wizard"));
    setPixmap(QWizard::WatermarkPixmap,
        QPixmap(QLatin1String(":/qt-project.org/qhelpconverter/assistant-128.png"))) ;
    setOptions(QWizard::IndependentPages|QWizard::NoBackButtonOnLastPage
        |QWizard::HaveHelpButton);

    m_inputPage = new InputPage(&m_adpReader);
    setPage(Input_Page, m_inputPage);

    m_generalPage = new GeneralPage();
    setPage(General_Page, m_generalPage);

    m_filterPage = new FilterPage();
    setPage(Filter_Page, m_filterPage);
    m_filterPage->setMaximumHeight(240);

    m_identifierPage = new IdentifierPage();
    setPage(Identifier_Page, m_identifierPage);

    m_pathPage = new PathPage();
    setPage(Path_Page, m_pathPage);
    m_pathPage->setMaximumHeight(240);

    m_filesPage = new FilesPage();
    setPage(Files_Page, m_filesPage);
    m_filesPage->setMaximumHeight(240);

    m_outputPage = new OutputPage();
    setPage(Output_Page, m_outputPage);
    m_outputPage->setMaximumHeight(240);

    m_finishPage = new FinishPage();
    setPage(Finish_Page, m_finishPage);
    m_finishPage->setMaximumHeight(240);

    connect(this, SIGNAL(currentIdChanged(int)),
        this, SLOT(pageChanged(int)));

    m_helpWindow = 0;
    qApp->installEventFilter(this);

    QAbstractButton *btn = button(QWizard::HelpButton);
    btn->setCheckable(true);
    connect(btn, SIGNAL(toggled(bool)), this, SLOT(showHelp(bool)));
}
示例#11
0
void DeleteDialog::keyPressEvent(QKeyEvent* e)
{
    if ( e->modifiers() == 0 )
    {
        if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return)
        {
            if (button(User1)->hasFocus())
            {
                e->accept();
                button(User1)->animateClick();
                return;
            }
            else if (button(Cancel)->hasFocus())
            {
                e->accept();
                button(Cancel)->animateClick();
                return;
            }
        }
    }

    KDialog::keyPressEvent(e);
}
示例#12
0
uint8_t DIA_getPartial(PARTIAL_CONFIG *param,AVDMGenericVideoStream *son,AVDMGenericVideoStream *previous)
{
#define PX(x) &(param->x)
  void *params[2]={son,previous};
         uint32_t fmax=previous->getInfo()->nb_frames;
         if(fmax) fmax--;
         
         diaElemUInteger  start(PX(_start),QT_TR_NOOP("Partial Start Frame:"),0,fmax);
         diaElemUInteger  end(PX(_end),QT_TR_NOOP("Partial End Frame:"),0,fmax);
         diaElemButton    button(QT_TR_NOOP("Configure child"), partialCb,params);
         
         diaElem *tabs[]={&start,&end,&button};
        return diaFactoryRun(QT_TR_NOOP("Partial Video Filter"),3,tabs);
}
ActivitiesButton::ActivitiesButton() {
  button()->setText("Activities");
  button()->setObjectName("ActivitiesButton");
  button()->setCheckable(true);
  button()->setChecked(true);
  // set icon
  button()->setIcon(QIcon(":/icons/Activity Monitor.ico"));
  button()->setIconSize(QSize(30, 30));
}
示例#14
0
LRESULT CALLBACK MouseProc(_In_ int nCode, _In_ WPARAM wParam, _In_ LPARAM lParam)
{
	MSLLHOOKSTRUCT		*hookInfo;

	if (nCode >= HC_ACTION)
	{
		std::string		name;
		hookInfo = (MSLLHOOKSTRUCT*)lParam;
		Position pos(hookInfo->pt.x, hookInfo->pt.y);
		eEventType etype;
		switch (wParam)
		{
			case WM_LBUTTONDOWN:
				name = "Left Button Down";
				etype = Pressed;
				break;
			case WM_LBUTTONUP:
				name = "Left Button Up";
				etype = Released;
				break;
			case WM_MOUSEMOVE:
				name = "Mouse Move";
				etype = Move;
				break;
			case WM_MOUSEWHEEL:
				name = "Mouse Wheel (vertical scrolling)";
				etype = Scroll;
				break;
			case WM_MOUSEHWHEEL:
				name = "Mouse Wheel (horizontal scrolling)";
				etype = Scroll;
				break;
			case WM_RBUTTONDOWN:
				name = "Right Button Down";
				etype = Pressed;
				break;
			case WM_RBUTTONUP:
				name = "Right Button Up";
				etype = Released;
				break;
		}
		Button button(name, hookInfo->mouseData);

		clt.m_itime.now();
		MouseEvent *msEv = new MouseEvent(button, pos, etype, clt.m_itime.get_second(), clt.m_itime.get_nano(), getWindowName());
		clt.addEvent(msEv);
	}
	return (CallNextHookEx(NULL, nCode, wParam, lParam));
}
示例#15
0
KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo)
    : KPageDialog(parent)
    , d(new KoDocumentInfoDlgPrivate)
{
    d->info = docInfo;

    setWindowTitle(i18n("Document Information"));
    //    setInitialSize(QSize(500, 500));
    setFaceType(KPageDialog::List);
    setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    button(QDialogButtonBox::Ok)->setDefault(true);

    d->aboutUi = new Ui::KoDocumentInfoAboutWidget();
    QWidget *infodlg = new QWidget();
    d->aboutUi->setupUi(infodlg);
    d->aboutUi->cbLanguage->addItems(KoGlobal::listOfLanguages());
    d->aboutUi->cbLanguage->setCurrentIndex(-1);

    KPageWidgetItem *page = new KPageWidgetItem(infodlg, i18n("General"));
    page->setHeader(i18n("General"));

    // Ugly hack, the mimetype should be a parameter, instead
    KoDocumentBase* doc = dynamic_cast< KoDocumentBase* >(d->info->parent());
    if (doc) {
        page->setIcon(KisIconUtils::loadIcon(KisMimeDatabase::iconNameForMimeType(doc->mimeType())));
    } else {
        // hide all entries not used in pages for KoDocumentInfoPropsPage
        d->aboutUi->filePathInfoLabel->setVisible(false);
        d->aboutUi->filePathLabel->setVisible(false);
        d->aboutUi->filePathSeparatorLine->setVisible(false);
        d->aboutUi->lblTypeDesc->setVisible(false);
        d->aboutUi->lblType->setVisible(false);
    }
    addPage(page);
    d->pages.append(page);

    initAboutTab();

    d->authorUi = new Ui::KoDocumentInfoAuthorWidget();
    QWidget *authordlg = new QWidget();
    d->authorUi->setupUi(authordlg);
    page = new KPageWidgetItem(authordlg, i18n("Author"));
    page->setHeader(i18n("Last saved by"));
    page->setIcon(koIcon("user-identity"));
    addPage(page);
    d->pages.append(page);

    initAuthorTab();
}
示例#16
0
	login::login()
	{
		app.getimgcache()->setmode(ict_login);

		node title = nl::nx::nodes["UI"]["Login.img"]["Title"];
		node common = nl::nx::nodes["UI"]["Login.img"]["Common"];

		sprites.push_back(sprite(animation(title["11"]), vector2d(410, 300)));
		sprites.push_back(sprite(animation(title["35"]), vector2d(410, 260)));
		sprites.push_back(sprite(animation(title["Logo"]), vector2d(410, 130)));
		sprites.push_back(sprite(animation(title["signboard"]), vector2d(410, 300)));
		sprites.push_back(sprite(animation(common["frame"]), vector2d(400, 290)));

		buttons[BT_LOGIN] = button(title["BtLogin"], 475, 248);
		buttons[BT_NEW] = button(title["BtNew"], 309, 320);
		buttons[BT_HOMEPAGE] = button(title["BtHomePage"], 382, 320);
		buttons[BT_PWDLOST] = button(title["BtPasswdLost"], 470, 300);
		buttons[BT_QUIT] = button(title["BtQuit"], 455, 320);
		buttons[BT_LOGINLOST] = button(title["BtLoginIDLost"], 395, 300);
		buttons[BT_SAVEID] = button(title["BtLoginIDSave"], 325, 300);

		string defaultacc = config.getdefaultacc();
		saveid = config.getsaveid();

		saveidcheck[false] = texture(title["check"]["0"]);
		saveidcheck[true] = texture(title["check"]["1"]);

		textfields[TXT_ACC] = textfield(TXT_ACC, DWF_14L, TXC_WHITE, defaultacc, vector2d(315, 249), 12);
		textfields[TXT_ACC].setbg(texture(title["ID"]), -5, 0);

		textfields[TXT_PASS] = textfield(TXT_PASS, DWF_14L, TXC_WHITE, "", vector2d(315, 275), 12);
		textfields[TXT_PASS].setbg(texture(title["PW"]), -5, 0);

		if (saveid)
		{
			textfields[TXT_PASS].setfocus(true);
			app.getui()->settextfield(&textfields[TXT_PASS]);
		}
		else
		{
			textfields[TXT_ACC].setfocus(true);
			app.getui()->settextfield(&textfields[TXT_ACC]);
		}

		app.getimgcache()->unlock();
		position = vector2d(0, 0);
		dimensions = vector2d(800, 600);
		active = true;
		dragged = false;
		buttoncd = 0;
	}
示例#17
0
int main(int argc, char *argv[]){
    //Inicializamos el framework
    Gtk::Main kit(argc, argv);

    Gtk::CheckButton button("Checkbox button");

    Gtk::Window window;
    window.set_default_size(400,400);
    window.add(button);
    window.show_all();

    //Iniciamos el loop de eventos
    Gtk::Main::run(window);
    return 0;
}
示例#18
0
void PicItem::updateVisibility()
{
	if (m_bExpanded)
		setSize( 0, 0, InnerWidth+(2*SidePadding), m_innerHeight+TopPadding+BottomPadding, true );
		
	else
		setSize( 0, 0, InnerWidth+(2*SidePadding), TopPadding, true );
	
	const PinItemList::iterator end = m_pinItemList.end();
	for ( PinItemList::iterator it = m_pinItemList.begin(); it != end; ++it )
		(*it)->setVisible(m_bExpanded);
	
	if ( Button * btn = button("settings") )
		btn->setVisible(m_bExpanded);
}
示例#19
0
void QgsGrassNewMapset::checkLocation()
{
  setError( mLocationErrorLabel );
  button( QWizard::NextButton )->setEnabled( true );

  if ( mCreateLocationRadioButton->isChecked() )
  {
    QString location = mLocationLineEdit->text();

    if ( location.isEmpty() )
    {
      button( QWizard::NextButton )->setEnabled( false );
      setError( mLocationErrorLabel, tr( "Enter location name!" ) );
    }
    else
    {
      if ( QFile::exists( gisdbase() + "/" + location ) )
      {
        button( QWizard::NextButton )->setEnabled( false );
        setError( mLocationErrorLabel, tr( "The location exists!" ) );
      }
    }
  }
}
示例#20
0
void ThemeCreationWizard::onCurrentIdChanged(int index)
{
    switch (index)
    {
        case 2:
            button(QWizard::NextButton)->setEnabled(ui->txtName->text() != "");
            break;
        case 4:
            button(QWizard::NextButton)->setEnabled(imagesLoaded & 1);
            break;
        case 5:
            button(QWizard::NextButton)->setEnabled(imagesLoaded & 2);
            break;
        case 6:
            button(QWizard::NextButton)->setEnabled(imagesLoaded & 4);
            break;
        case 7:
            button(QWizard::NextButton)->setEnabled(imagesLoaded & 8);
            break;
        case 8:
            ui->lblSavePath->setText( QtHelpers::DesktopLocation().replace("\\", "/") + "/" + ui->txtName->text());
            break;
    }
}
示例#21
0
void Menu::addButton(const std::string& id, const std::string& text, ButtonListener* listener)
{
    sf::Image& img     = *imageManager().get("button.png");
    sf::Image& imgOver = *imageManager().get("button_sel.png");

    const sf::Vector2i screenSize = Game::instance().getScreenSize();

    Button button(id, sf::Vector2f(screenSize.x / 2.f - 500.f / 2.f, myNextButtonPos), text, img, imgOver);
    if(listener)
        button.addListener(listener);

    myButtons.push_back(button);

    myNextButtonPos += img.GetHeight() + MARGIN;
}
uint8_t LCDKeypad::buttonBlocking(uint16_t block_delay, uint16_t repeat_delay)
{
  // if we are still blocked, return this status
  if (millis() < _block_time)
    return KEYPAD_BLOCKED;

  uint8_t current = button();

  // if some key is pressed, disable presses for block_delay or repeat_delay if button is kept down
  if (current != KEYPAD_NONE)
    _block_time = millis() + (current == _last_button ? repeat_delay : block_delay);

  _last_button = current;
  return current;
}
示例#23
0
int main(void)
	{
	Periphery();			//настройка периферии 

	//главный цикл программы 
	while(1)
		{
 		button();
		cycle();
		drive();
		cleaner();
		bumper(); 
		led();
		}
	}
示例#24
0
FirstRunDlg::FirstRunDlg(QWidget* const parent)
    : QWizard(parent),
      d(new Private)
{
    setWizardStyle(QWizard::ClassicStyle);
    setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton
                                                   << QWizard::BackButton
                                                   << QWizard::CancelButton
                                                   << QWizard::NextButton
                                                   << QWizard::FinishButton);

    bool migrateAvailable;

#ifdef Q_OS_LINUX
    ::Kdelibs4Migration migration;

    // If there's a digikamrc file in $KDEHOME/share/config,
    // then we create the migration page in the wizard
    migrateAvailable = !migration.locateLocal("config", QLatin1String("digikamrc")).isEmpty();
#else
    migrateAvailable = false;
#endif

    d->welcomePage    = new WelcomePage(this);    // First assistant page

    if (migrateAvailable)
       d->migrateFromDigikam4Page = new MigrateFromDigikam4Page(this);

    d->collectionPage = new CollectionPage(this);
    d->databasePage   = new DatabasePage(this);
    d->rawPage        = new RawPage(this);
    d->metadataPage   = new MetadataPage(this);
    d->previewPage    = new PreviewPage(this);
    d->openFilePage   = new OpenFilePage(this);
    d->tooltipsPage   = new TooltipsPage(this);

    // NOTE: Added here new assistant pages...

    d->startScanPage  = new StartScanPage(this);  // Last assistant page

    resize(600, 600);

    connect(button(QWizard::FinishButton), SIGNAL(clicked()),
            this, SLOT(slotFinishPressed()));

    connect(this, SIGNAL(helpRequested()),
            this, SLOT(slotHelp()));
}
示例#25
0
void KSaneDeviceDialog::updateDevicesList()
{
    while (!m_btnGroup->buttons().isEmpty()) {
        delete m_btnGroup->buttons().takeFirst();
    }

    const QList<KSaneWidget::DeviceInfo> list = m_findDevThread->devicesList();
    if (list.isEmpty()) {
        m_btnBox->setTitle(i18n("Sorry. No devices found."));
        m_btnBox->layout()->itemAt(0)->widget()->show();  // explanation
        m_btnBox->layout()->itemAt(1)->widget()->hide();  // scroll area
        enableButton(KDialog::User1, true);
        return;
    }

    delete m_btnLayout;
    m_btnLayout = new QVBoxLayout;
    m_btnContainer->setLayout(m_btnLayout);
    m_btnBox->setTitle(i18n("Found devices:"));
    m_btnBox->layout()->itemAt(0)->widget()->hide();  // explanation
    m_btnBox->layout()->itemAt(1)->widget()->show();  // scroll area

    for (int i=0; i< list.size(); i++) {
        QRadioButton *b = new QRadioButton(this);
        b->setObjectName(list[i].name);
        b->setToolTip(list[i].name);
        b->setText(QString("%1 : %2\n%3")
                    .arg(list[i].vendor)
                    .arg(list[i].model)
                    .arg(list[i].name));

        m_btnLayout->addWidget(b);
        m_btnGroup->addButton(b);
        connect(b, SIGNAL(clicked(bool)), this, SLOT(setAvailable(bool)));
        if((i==0) || (list[i].name == m_selectedDevice)) {
            b->setChecked(true);
            setAvailable(true);
        }
    }

    m_btnLayout->addStretch();

    if(list.size() == 1) {
        button(KDialog::Ok)->animateClick();
    }

    enableButton(KDialog::User1, true);
}
示例#26
0
void Game::showMenu()
{
	sf::Font font;
	if (!font.loadFromFile("fonts/Square.ttf"))
	{
		std::cout << "Could not load font.\n";
	}
	else
	{
		sf::RectangleShape blackScreen(sf::Vector2f(1024, 768));
		blackScreen.setFillColor(sf::Color(0, 0, 0));
	
		sf::Text buttonText;
		buttonText.setFont(font);
		buttonText.setString("Start Loading...");
		buttonText.setCharacterSize(100);
		buttonText.setPosition(512 - buttonText.getGlobalBounds().width / 2, 384 - buttonText.getGlobalBounds().height / 2);

		sf::RectangleShape button(sf::Vector2f(buttonText.getGlobalBounds().width + 20, buttonText.getGlobalBounds().height + 30));
		button.setPosition(512 - buttonText.getGlobalBounds().width / 2, 384 - buttonText.getGlobalBounds().height + 50);
		button.setFillColor(sf::Color(128, 128, 128));
		mainWindow_.draw(blackScreen);
		mainWindow_.draw(button);
		mainWindow_.draw(buttonText);
		sf::Rect<float> bSpriteRect = button.getGlobalBounds();
		sf::Event event;
		while (mainWindow_.pollEvent(event))
		{
			if (event.type == sf::Event::MouseButtonPressed)
			{
				float x = event.mouseButton.x;
				float y = event.mouseButton.y;
				if (bSpriteRect.height + bSpriteRect.top> y
					&& bSpriteRect.top < y
					&& bSpriteRect.left < x
					&& bSpriteRect.width + bSpriteRect.left > x)
				{
					gameState_ = Game::Playing;
				}
			}
			if (event.type == sf::Event::Closed)
			{
				gameState_ = Game::Exiting;
				break;
			}
		}
	}
}
int main ()
{
// sample(type_erasure_plus_ref_wrapper)
button b;
widget ref_widget(std::ref(b));   // Underlying object
widget cref_widget(std::cref(b)); // not copied.
// end-sample

// sample(type_erasure_plus_cow_wrapper_usage)
copy_on_write<widget> w_1(widget{button()});
copy_on_write<widget> w_2 = w_1;    // No copy.
widget & mutable_w_2 = w_2.write(); // Copy happens here.
// end-sample

    return 0;
}
示例#28
0
QAccessible::Role QAccessibleButton::role() const
{
    QAbstractButton *ab = button();

#ifndef QT_NO_MENU
    if (QPushButton *pb = qobject_cast<QPushButton*>(ab)) {
        if (pb->menu())
            return QAccessible::ButtonMenu;
    }
#endif

    if (ab->isCheckable())
        return ab->autoExclusive() ? QAccessible::RadioButton : QAccessible::CheckBox;

    return QAccessible::Button;
}
示例#29
0
//BEGIN class PicItem
PicItem::PicItem( ICNDocument *icnDocument, bool newItem, const char *id, MicroSettings *_microSettings )
	: CNItem( icnDocument, newItem, id ? id : "picitem" )
{
	m_name = "PIC";
	m_type = typeString();
	p_icnDocument = icnDocument;
	icnDocument->registerItem(this);
	
	microSettings = _microSettings;
	const int numPins = microSettings->microInfo()->package()->pinCount( PicPin::type_bidir | PicPin::type_input | PicPin::type_open );
	const int numSide = (numPins/2) + (numPins%2);
	
	m_bExpanded = true;
	m_innerHeight = (numSide+2)*PinWidth + (numSide-1)*PinSeparation;
	updateVisibility();
	
	addButton( "settings", QRect( SidePadding-8, m_innerHeight+TopPadding+(BottomPadding-24)/2-1, InnerWidth+16, 24 ), i18n("Advanced...") );
	addButton( "expandBtn", QRect( (TopPadding-22)/2, (TopPadding-22)/2, 22, 22 ), KIconLoader::global()->loadIcon( "down", KIconLoader::Small ), true );
	button("expandBtn")->setState(true);
	
	move( 12, 12 );
	
	QStringList pinIDs = microSettings->microInfo()->package()->pinIDs( PicPin::type_bidir | PicPin::type_input | PicPin::type_open );
	QStringList::iterator it = pinIDs.begin();
	
	for ( int i=0; i < numSide; ++i, ++it )
	{
		QPoint position( int(this->x()) + SidePadding - PinLength+1, int(y()) + TopPadding + (i+1)*PinWidth + i*PinSeparation );
		const QString id = *it;
		PinSettings *settings = microSettings->pinWithID(id);
		m_pinItemList.append( new PinItem( dynamic_cast<FlowCodeDocument*>(icnDocument), position, true, settings ) );
	}
	
	for ( int i=0; i < numPins/2; ++i, ++it )
	{
		QPoint position( int(this->x()) + SidePadding + InnerWidth-1, int(y()) + TopPadding + m_innerHeight - ( (i+2)*PinWidth + i*PinSeparation ) );
		const QString id = *it;
		PinSettings *settings = microSettings->pinWithID(id);
		m_pinItemList.append( new PinItem( dynamic_cast<FlowCodeDocument*>(icnDocument), position, false, settings ) );
	}

	setSelected(false);
	setPen( QPen( Qt::black ) );
	updateZ(-1);
	update();
	show();
}
示例#30
0
文件: game.cpp 项目: Supermanu/xoreos
bool Game::showMainMenu() {
	Graphics::Aurora::GUIQuad top("introscr_top" , 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f);
	Graphics::Aurora::GUIQuad bot("startupscrbot", 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f);

	top.setPosition(kTopScreenX   , kTopScreenY   , 0.0f);
	bot.setPosition(kBottomScreenX, kBottomScreenY, 0.0f);

	top.show();
	bot.show();


	Graphics::Aurora::TextureHandle buttonTexture = loadNCGR("main_pnl_off", "gui_main_pnl", 8, 2,
			"00", "01", "02", "03", "04", (const char *) 0, (const char *) 0, (const char *) 0,
			"10", "11", "12", "13", "14", "15", "16", "17");

	Graphics::Aurora::GUIQuad button(buttonTexture, 0.0f, 0.0f, 240.0f, 48.0f, 0.0f, 1.0f, 1.0f, 0.0f);

	button.setPosition(-120.0f, -120.0f, -1.0f);
	button.show();


	Graphics::Aurora::Text buttonText(_guiFont, 240.0f, 48.0f, TalkMan.getString(15860), 1.0f, 1.0f, 1.0f, 1.0f,
	                                  Graphics::Aurora::kHAlignCenter, Graphics::Aurora::kVAlignMiddle);
	buttonText.setPosition(-120.0f, -120.0f, -2.0f);
	buttonText.show();


	Graphics::Aurora::Text helpText(_guiFont, kScreenWidth, kScreenHeight, TalkMan.getString(18707), 1.0f, 1.0f, 1.0f, 1.0f,
	                                Graphics::Aurora::kHAlignCenter, Graphics::Aurora::kVAlignBottom);
	helpText.setPosition(kBottomScreenX, kBottomScreenY, -2.0f);
	helpText.show();


	GfxMan.unlockFrame();

	if (!waitClick())
		return false;

	GfxMan.lockFrame();
	helpText.hide();
	buttonText.hide();
	button.hide();
	top.hide();
	bot.hide();

	return true;
}