Exemplo n.º 1
0
uiBox *makePage13(void)
{
	uiBox *page13;
	uiRadioButtons *rb;
	uiButton *b;
	uiForm *f;
	uiEntry *e;
	uiProgressBar *p;

	page13 = newVerticalBox();

	rb = uiNewRadioButtons();
	uiRadioButtonsAppend(rb, "Item 1");
	uiRadioButtonsAppend(rb, "Item 2");
	uiRadioButtonsAppend(rb, "Item 3");
	uiBoxAppend(page13, uiControl(rb), 0);

	rb = uiNewRadioButtons();
	uiRadioButtonsAppend(rb, "Item A");
	uiRadioButtonsAppend(rb, "Item B");
	uiBoxAppend(page13, uiControl(rb), 0);

	b = uiNewButton("Horizontal");
	uiButtonOnClicked(b, buttonClicked, uiNewHorizontalBox);
	uiBoxAppend(page13, uiControl(b), 0);

	b = uiNewButton("Vertical");
	uiButtonOnClicked(b, buttonClicked, uiNewVerticalBox);
	uiBoxAppend(page13, uiControl(b), 0);

	f = newForm();

	e = uiNewPasswordEntry();
	uiEntryOnChanged(e, entryChanged, "password");
	uiFormAppend(f, "Password Entry", uiControl(e), 0);

	e = uiNewSearchEntry();
	uiEntryOnChanged(e, entryChanged, "search");
	uiFormAppend(f, "Search Box", uiControl(e), 0);

	uiFormAppend(f, "MLE", uiControl(uiNewMultilineEntry()), 1);

	p = uiNewProgressBar();
	uiProgressBarSetValue(p, 50);
	uiBoxAppend(page13, uiControl(p), 0);
	b = uiNewButton("Toggle Indeterminate");
	uiButtonOnClicked(b, setIndeterminate, p);
	uiBoxAppend(page13, uiControl(b), 0);

	b = uiNewButton("Show/Hide");
	uiButtonOnClicked(b, showHide, e);
	uiBoxAppend(page13, uiControl(b), 0);
	b = uiNewButton("Delete First");
	uiButtonOnClicked(b, deleteFirst, f);
	uiBoxAppend(page13, uiControl(b), 0);
	uiBoxAppend(page13, uiControl(f), 1);

	return page13;
}
Exemplo n.º 2
0
GPSData RobotPosition::VisOdom2GPS(VisOdomData in)
{
  double lastMeasurementTime = in.time()-in.deltaTime();
  double oldLat = latAtTime(lastMeasurementTime);
  double oldLong = longAtTime(lastMeasurementTime);
  double newLat;
  double newLong;
  latLongCartesianUpdate(oldLat, oldLong, in.deltaX(), in.deltaY(), newLat, newLong);
  GPSData newForm(newLat, newLong, in.Heading(), in.Speed(), in.time());
  return newForm;
}
Exemplo n.º 3
0
void MainWindow::init()
{
	const QStringList args = QApplication::arguments();
	if (args.count() > 1)
	{
		const QString fileName = args.at(1);

		setWindowFilePath(fileName);
		loadFile(fileName);
		recentFolder = QFileInfo(fileName).path();
		updateRecentFile(fileName);
	}
	else
		newForm();
}
Exemplo n.º 4
0
uiBox *makePage13(void)
{
	uiBox *page13;
	uiRadioButtons *rb;
	uiButton *b;
	uiForm *f;
	uiEntry *e;

	page13 = newVerticalBox();

	rb = uiNewRadioButtons();
	uiRadioButtonsAppend(rb, "Item 1");
	uiRadioButtonsAppend(rb, "Item 2");
	uiRadioButtonsAppend(rb, "Item 3");
	uiBoxAppend(page13, uiControl(rb), 0);

	rb = uiNewRadioButtons();
	uiRadioButtonsAppend(rb, "Item A");
	uiRadioButtonsAppend(rb, "Item B");
	uiBoxAppend(page13, uiControl(rb), 0);

	b = uiNewButton("Horizontal");
	uiButtonOnClicked(b, buttonClicked, uiNewHorizontalBox);
	uiBoxAppend(page13, uiControl(b), 0);

	b = uiNewButton("Vertical");
	uiButtonOnClicked(b, buttonClicked, uiNewVerticalBox);
	uiBoxAppend(page13, uiControl(b), 0);

	f = newForm();
	uiBoxAppend(page13, uiControl(f), 1);

	e = uiNewPasswordEntry();
	uiEntryOnChanged(e, entryChanged, "password");
	uiFormAppend(f, "Password Entry", uiControl(e), 0);

	e = uiNewSearchEntry();
	uiEntryOnChanged(e, entryChanged, "search");
	uiFormAppend(f, "Search Box", uiControl(e), 0);

	uiFormAppend(f, "MLE", uiControl(uiNewMultilineEntry()), 1);

	return page13;
}
Exemplo n.º 5
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow)
{
	ui->setupUi(this);

	for (int i = 0; i < MaxRecentFiles; ++i)
	{
		recentFileActions[i] = new QAction(this);
		recentFileActions[i]->setVisible(false);
		connect(recentFileActions[i], SIGNAL(triggered()), this, SLOT(openRecentFile()));
		ui->menuFile->insertAction(ui->actionExit, recentFileActions[i]);
	}
	recentFilesSeparator = ui->menuFile->insertSeparator(ui->actionExit);

	form = new Form(this);
	view = new GraphicsView(form, this);
	setCentralWidget(view);

	itemWidget = new ItemWidget(ui->propertyWidget);
	itemWidget->setHidden(true);
	connect(view, SIGNAL(mouseDoubleClick()), itemWidget, SLOT(selectPicture()));

	formWidget = new FormWidget(ui->propertyWidget);
	formWidget->connectForm(form);
	formWidget->update(form);
	ui->propertyWidget->setWidget(formWidget);

	fontCombo = new QFontComboBox(this);
	ui->formatToolBar->insertWidget(ui->actionBold, fontCombo);

	insertGroup = new QActionGroup(this);
	insertGroup->addAction(ui->actionSelect);
	insertGroup->addAction(ui->actionPaint);
	connect(insertGroup, SIGNAL(triggered(QAction*)), this, SLOT(insertObject(QAction*)));

	ui->actionLeft->setData(Qt::AlignLeft);
	ui->actionCenter->setData(Qt::AlignHCenter);
	ui->actionRight->setData(Qt::AlignRight);

	zoomGroup = new QActionGroup(this);
	zoomGroup->addAction(ui->actionActualSize);
	zoomGroup->addAction(ui->actionFitWidth);
	zoomGroup->addAction(ui->actionFitHeight);
	connect(zoomGroup, SIGNAL(triggered(QAction*)), this, SLOT(zoom(QAction*)));

	ui->actionActualSize->setData(GraphicsView::ActualSize);
	ui->actionFitWidth->setData(GraphicsView::FitWidth);
	ui->actionFitHeight->setData(GraphicsView::FitHeight);

	horzAlignGroup = new QActionGroup(this);
	horzAlignGroup->addAction(ui->actionLeft);
	horzAlignGroup->addAction(ui->actionCenter);
	horzAlignGroup->addAction(ui->actionRight);
	connect(horzAlignGroup, SIGNAL(triggered(QAction*)), this, SLOT(horzAlign(QAction*)));

	sizeGroup = new QActionGroup(this);
	sizeGroup->addAction(ui->actionShrinkWidth);
	sizeGroup->addAction(ui->actionGrowWidth);
	sizeGroup->addAction(ui->actionPageWidth);
	sizeGroup->addAction(ui->actionShrinkHeight);
	sizeGroup->addAction(ui->actionGrowHeight);
	sizeGroup->addAction(ui->actionPageHeight);
	sizeGroup->addAction(ui->actionShrinkBoth);
	sizeGroup->addAction(ui->actionGrowBoth);
	sizeGroup->addAction(ui->actionPageBoth);

	ui->actionShrinkWidth->setData(Form::ShrinkWidth);
	ui->actionGrowWidth->setData(Form::GrowWidth);
	ui->actionPageWidth->setData(Form::PageWidth);
	ui->actionShrinkHeight->setData(Form::ShrinkHeight);
	ui->actionGrowHeight->setData(Form::GrowHeight);
	ui->actionPageHeight->setData(Form::PageHeight);
	ui->actionShrinkBoth->setData(Form::ShrinkBoth);
	ui->actionGrowBoth->setData(Form::GrowBoth);
	ui->actionPageBoth->setData(Form::PageBoth);

	connect(sizeGroup, SIGNAL(triggered(QAction*)), this, SLOT(size(QAction*)));

	connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newForm()));
	connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openForm()));
	connect(ui->actionReload, SIGNAL(triggered()), this, SLOT(reload()));
	connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveForm()));
	connect(ui->actionSaveAs, SIGNAL(triggered()), this, SLOT(saveFormAs()));
	connect(ui->actionSaveAsPDF, SIGNAL(triggered()), this, SLOT(saveFormAsPdf()));
	connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
	connect(ui->actionOpenPrintData, SIGNAL(triggered()), this, SLOT(openPrintData()));
	connect(ui->actionPageSetup, SIGNAL(triggered()), form, SLOT(pageSetup()));
	connect(ui->actionPagePreview, SIGNAL(triggered()), this, SLOT(preview()));
	connect(ui->actionSend, SIGNAL(triggered()), this, SLOT(email()));
	connect(ui->actionPrint, SIGNAL(triggered()), this, SLOT(print()));
	connect(ui->actionFullScreen, SIGNAL(triggered()), this, SLOT(fullScreen()));
	connect(ui->actionMargins, SIGNAL(toggled(bool)), form, SLOT(showMargins(bool)));
	connect(ui->actionGrid, SIGNAL(toggled(bool)), form, SLOT(showGrid(bool)));
	connect(ui->actionPrintData, SIGNAL(toggled(bool)), form, SLOT(showData(bool)));
	connect(ui->actionSelectAll, SIGNAL(triggered()), form, SLOT(selectAll()));
	connect(ui->actionDelete, SIGNAL(triggered()), form, SLOT(deleteSelected()));
	connect(ui->actionProperties, SIGNAL(toggled(bool)), ui->propertyWidget, SLOT(setVisible(bool)));
	connect(ui->actionMoveForwards, SIGNAL(triggered()), form, SLOT(moveForwards()));
	connect(ui->actionMoveBackwards, SIGNAL(triggered()), form, SLOT(moveBackwards()));
	connect(ui->actionAlignLeft, SIGNAL(triggered()), form, SLOT(alignLeft()));
	connect(ui->actionAlignRight, SIGNAL(triggered()), form, SLOT(alignRight()));
	connect(ui->actionAlignTop, SIGNAL(triggered()), form, SLOT(alignTop()));
	connect(ui->actionAlignBottom, SIGNAL(triggered()), form, SLOT(alignBottom()));
	connect(ui->actionCut, SIGNAL(triggered()), form, SLOT(cut()));
	connect(ui->actionCopy, SIGNAL(triggered()), form, SLOT(copy()));
	connect(ui->actionPaste, SIGNAL(triggered()), this, SLOT(paste()));
	connect(ui->actionFirstPage, SIGNAL(triggered()), this, SLOT(firstPage()));
	connect(ui->actionPreviousPage, SIGNAL(triggered()), this, SLOT(previousPage()));
	connect(ui->actionNextPage, SIGNAL(triggered()), this, SLOT(nextPage()));
	connect(ui->actionLastPage, SIGNAL(triggered()), this, SLOT(lastPage()));

	connect(ui->menuView, SIGNAL(aboutToShow()), this, SLOT(updateViewMenu()));
	connect(form, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
	connect(form, SIGNAL(changed()), this, SLOT(formChanged()));
	connect(view, SIGNAL(doneRubberBanding(QRectF)), this, SLOT(doneRubberBanding(QRectF)));

	connectForm();
	loadSettings();
	QTimer::singleShot(0, this, SLOT(init()));
}