void PositionParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mPositionEdit = new PositionEdit(parent);
        connect(mPositionEdit, SIGNAL(positionChosen(QPointF)), this, SLOT(positionChosen(QPointF)));

		addEditor(mPositionEdit);

        mPositionUnitComboBox = new QComboBox(parent);

        mPositionUnitComboBox->addItems(QStringList() << tr("pixels") << tr("percents"));

        addEditor(mPositionUnitComboBox);
	}
Example #2
0
EditorTab::EditorTab(WebFile* file, QWidget* parent)
        : QSplitter(parent)
{
    m_options = OptionStore::getInstance();

    m_listmodel =new QStringListModel;
    m_documentList = new QList<QTextDocument*>;
    TextEditor* textedit = new TextEditor(this);//qobject_cast<TextEditor*>(m_editor->widget());

    if(file)
        connect(textedit,SIGNAL(textChanged()),file,SLOT(hasBeenModified()));

    p = new PhpHighLighter(textedit->document());
    connect(m_options,SIGNAL(fontChanged(QFont)),textedit,SLOT(setCurrentFont(QFont)));
    textedit->setCurrentFont(m_options->font());
    m_leftcolumn = new QSplitter(Qt::Vertical,this);
    ProjectFilesBrowser* tmpBrowser=new ProjectFilesBrowser();
    m_view = new  FancyWidget(tmpBrowser);
    m_leftcolumn->addWidget(m_view->widget());

    addWidget(m_leftcolumn);
    setStretchFactor(0,1);
    addEditor(textedit);
    setStretchFactor(1,3);




}
Example #3
0
void FrostEdit::openDocument(const QModelIndex& ind) {
	QString doc = mFileSystemModel->filePath(ind);
	if(!mFileSystemModel->isDir(ind)){
		addDocument(doc);
		addEditor(doc);
	}
}
void EditorObject::loadFromSettings()
{
  QSettings& settings = EditorModule::application->getLayoutSettings();
  int count = 1;
  for(int i = 0; i < count; ++i)
  {
    count = settings.beginReadArray(fullName);
    if(i >= count)
    {
      settings.endArray();
      break;
    }
    settings.setArrayIndex(i);
    QString filePath = settings.value("filePath").toString();
    if(filePath.isEmpty())
    {
      QString name = settings.value("name").toString();
      settings.endArray();
      ((EditorObject*)addFolder(name))->loadFromSettings();
    }
    else
    {
      QString subFileRegExpPattern = settings.value("subFileRegExpPattern").toString();
      settings.endArray();
      ((EditorObject*)addEditor(filePath, subFileRegExpPattern, false))->loadFromSettings();
    }
  }
}
Example #5
0
void FrostEdit::on_actionOpen_triggered() {
	QStringList list = QFileDialog::getOpenFileNames(this, "Open file", QDir::currentPath(), "FrostBasic Code Files (*.frb);;CoolBasic Code Files (*.cb);;All Files(*.*)");
	for(auto& i: list) {
		addDocument(i);
		addEditor(i);
	}
}
//----------------------------------------------------
void MainWindow::inputparameters()
{
    //open result window
    Editor *myeditor = new Editor;
    addEditor(myeditor);
    myeditor->setLineWrapMode(QTextEdit::NoWrap);
    myeditor->setWindowTitle("Results [*]");

    QFont myfont("Courier");
    myfont.setPixelSize(12);
    myeditor->setFont(myfont);

    QTextCursor cursor(myeditor->textCursor());
    cursor.insertText("Version 0.7a\n");
    displayInEditor(false, "Pollen Compatibility Calculator\n", "bold", cursor);

    //display in active window
    QTextCursor mycursor(activeEditor()->textCursor());
    displayInEditor(true, "Input parameters\n", "bold", mycursor);
    interface::checkedi(mycursor);

    output1Action->setEnabled(true);
    inputAction->setEnabled(false);

    //open inputform
    inputForm *dialog = new inputForm;
    dialog->show();
}
Example #7
0
void FrostEdit::pointToIssue(QListWidgetItem* item) {
	IssueItem* issue = static_cast<IssueItem*>(item);
	TabWidgetFrame* curTabFrameWidget = toTabWidgetFrame(mCurrentTabWidget->parentWidget());
	TextEdit* edit = nullptr;

	QString path;
	QString open;
	QFileInfo file(mCompiledFile);
	if(file.exists()  && file.isFile()) {
		path = file.absolutePath();
		QFileInfo finfo(path+"/"+issue->getFile());
		if(finfo.isFile())
			open = finfo.absolutePath();
		else
			open = issue->getFile();
	} else {
		open = mCompiledFile;
	}


	addEditor(curTabFrameWidget, open);


	edit = toTextEdit(mCurrentTabWidget->currentWidget());

	edit->setCursorPosition(issue->getRow()-1, issue->getColumn()-1);
	edit->ensureCursorVisible();
	edit->setFocus();

}
	void ColorPositionParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);
		
		mPositionEdit = new PositionEdit(parent);

		addEditor(mPositionEdit);
	
		mColorEdit = new ColorEdit(parent);
		mColorEdit->setChooseByPositionButtonVisible(false);

		addEditor(mColorEdit);
		
        connect(mPositionEdit, SIGNAL(positionChosen(QPointF)), mColorEdit, SLOT(setPosition(QPointF)), Qt::QueuedConnection);
        connect(mColorEdit, SIGNAL(positionChosen(QPointF)), mPositionEdit, SLOT(setPosition(QPointF)), Qt::QueuedConnection);
	}
	void BooleanParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mBooleanEdit = new BooleanEdit(parent);

		addEditor(mBooleanEdit);
	}
	void DateTimeParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mDateTimeEdit = new CodeDateTimeEdit(parent);

		addEditor(mDateTimeEdit);
	}
	void WindowParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mWindowEdit = new WindowEdit(parent);

		addEditor(mWindowEdit);
	}
	void VariableParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

        mLineEdit = new VariableLineEdit(parent);

        addEditor(mLineEdit);
    }
	void ColorParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mColorEdit = new ColorEdit(parent);

		addEditor(mColorEdit);
	}
	void PointListParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mPointListWidget = new PointListWidget(parent);

		addEditor(mPointListWidget);
	}
void MainWindow::open()
{
    Editor *editor = Editor::open(this);
    if (editor){
       addEditor(editor);
       AlnFileName = editor->getFileName();
       editor->setLineWrapMode(QTextEdit::NoWrap);
    }//if
}
Example #16
0
void FrostEdit::dropEvent(QDropEvent* e)  {
	const QMimeData* data = e->mimeData();
	if(data != nullptr) {
		for(QUrl u: data->urls()) {
			QString i = u.path().mid(1);
			addDocument(i);
			addEditor(i);
		}
	}
}
	void LineParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mComboBox = new LineComboBox(script->labels(), script->actionCount(), parent);

		addEditor(mComboBox);

		emit editorBuilt();
	}
Example #18
0
void FrostEdit::addEditor(const QString& path) {
	Document* doc = mOpenDocuments[path];

	for(TabWidgetFrame* tabwidget: mTabWidgetFrames) {
		//TextEdit* edit = new TextEdit(tabwidget->tabWidget(), doc);
		//edit->setFont(mFont);
		//tabwidget->tabWidget()->addTab(edit, doc->getDynamicName());
		addEditor(tabwidget, path);
	}

}
	void VariableParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mLineEdit = new CodeLineEdit(parent, QRegExp("^[A-Za-z_][A-Za-z0-9_]*$"));

		//TODO
		//Do nothing special here for now, but later we could add a variable list
		
		addEditor(mLineEdit);
	}
void MainWindow::openFile(const QString &fileName)
{
    Editor *editor = Editor::openFile(fileName, this);
    if (editor){
      addEditor(editor);

      //resize window
      //mdiArea->activeSubWindow()->resize(650, 500);
    }//if

}
    void ImageParameterDefinition::buildEditors(Script *script, QWidget *parent)
    {
        FileParameterDefinition::buildEditors(script, parent);

        mScript = script;// Is this really safe?
        mParent = parent;

        ScreenshotPushButton *screenshotPushButton = new ScreenshotPushButton(parent);
        connect(screenshotPushButton, SIGNAL(clicked()), this, SLOT(onCaptureClicked()));

        addEditor(screenshotPushButton);
    }
Example #22
0
	void FileParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mFileEdit = new FileEdit(parent);

		mFileEdit->setMode(mMode);
		mFileEdit->setCaption(mCaption);
		mFileEdit->setFilter(mFilter);
		mFileEdit->setDirectory(mDirectory);

		addEditor(mFileEdit);
	}
void MainWindow::newFile()
{
    Editor *editor = new Editor;
    editor->newFile(); //set windows title
    addEditor(editor);
    //mdiArea->activeSubWindow()->resize(350, 300);

    //reset fonts for every new file
    fontChanged(editor->font());
    colorChanged(editor->textColor());

    QFont defFont("Courier");
    comboFont->setCurrentFont(defFont);
    comboSize->setCurrentIndex(3); //= 9 pt.
    editor->setFont(defFont);
}
Example #24
0
/**
 * Reopens all files which were open when the project was last closed.
 * In order to reduce the time required by this operation, the GUI of all
 * but the last editor part is not merged with that of the main window.
 */
void KScope::restoreSession()
{
	ProjectBase* pProj;
	Project::Session sess;
	FileLocation* pLoc;
	EditorPage* pPage;
	
	// A session is available for persistent projects only
	pProj = m_pProjMgr->curProject();
	if (!pProj || pProj->isTemporary())
		return;
	
	// Make sure all FileLocation objects are deleted
	sess.fllOpenFiles.setAutoDelete(true);
	sess.fllBookmarks.setAutoDelete(true);
	
	// Load the session
	((Project*)pProj)->loadSession(sess);
	
	// Do not update the GUI when loading the editor parts of the initially
	// hidden windows
	m_bUpdateGUI = false;
	
	for (pLoc = sess.fllOpenFiles.first(); pLoc != NULL;
		pLoc = sess.fllOpenFiles.next()) {
		if (QFile::exists(pLoc->m_sPath)) {
			pPage = addEditor(pLoc->m_sPath);
			pPage->setCursorPos(pLoc->m_nLine, pLoc->m_nCol);
		}
	}
	
	// Merge the GUI of the visible editor part
	m_bUpdateGUI = true;

	// Set the active editor (or choose a default one)
	if (m_pEditTabs->findEditorPage(sess.sLastFile, true) == NULL)
		m_pEditTabs->findEditorPage(sess.fllOpenFiles.last()->m_sPath, true);
	
	// Reload bookmarks
	m_pEditTabs->setBookmarks(sess.fllBookmarks);	
	
	// Load previously stored queries and call trees
	m_pQueryWidget->loadPages(pProj->getPath(), sess.slQueryFiles);
	m_pCallTreeMgr->loadOpenDialogs(pProj->getPath(), sess.slCallTreeFiles);
}
Example #25
0
KinasWidget::KinasWidget(QWidget *parent) : TupModuleWidgetBase(parent)
{
    TINIT;

    setWindowTitle(tr("Tupi Script"));
    setWindowIcon(QPixmap(THEME_DIR + "icons/color_palette.png"));

    m_splitter = new QSplitter(this);
    addChild(m_splitter);

    m_functionViewer = new TupSFunctionView(m_splitter);
    m_splitter->addWidget(m_functionViewer);

    m_editors = new QTabWidget(this);
    m_splitter->addWidget(m_editors);

    m_splitter->setSizes(QList<int>()<<160 << 400);

    addEditor("Example.tups");
}
Example #26
0
void FormMultiWidget::setTranslation(const QString &text, bool userAction)
{
    QStringList texts = text.split(QChar(Translator::BinaryVariantSeparator), QString::KeepEmptyParts);

    while (m_editors.count() > texts.count()) {
        delete m_minusButtons.takeLast();
        delete m_plusButtons.takeLast();
        delete m_editors.takeLast();
    }
    while (m_editors.count() < texts.count())
        addEditor(m_editors.count());
    updateLayout();

    for (int i = 0; i < texts.count(); ++i)
        // XXX this will emit n textChanged signals
        m_editors.at(i)->setPlainText(texts.at(i), userAction);

    if (m_hideWhenEmpty)
        setHidden(text.isEmpty());
}
Example #27
0
void FrostEdit::on_actionNew_triggered() {
	QString newfile = QStringLiteral("<New %1>").arg(mNewCount);
	Document* doc = new Document(this);


	CodeModel* model = new Frost::FrostCodeModel(mFrostModelContext);
	doc->setCodeModel(model);

	mOpenDocuments[newfile] = doc;
	mOpenDocuments[newfile]->setFile(newfile);
	mNewCount++;


	setUpDocumentHiltter(doc);
	addDocumentItem(doc);
	connect(doc, &Document::textChanged, this, &FrostEdit::updateTabHeader);
	connect(doc, &Document::exterminate, this, &FrostEdit::removeDocument);

	for(TabWidgetFrame* tab: mTabWidgetFrames) {
		tab->addComboBoxItem(newfile);
	}
	addEditor(newfile);
}
Example #28
0
void ParamView::changeListenerCallback (ChangeBroadcaster* source)
{
  bool deletedNodes = false;
  
  for (int i = 0; i < sectionNodes.size(); i++) 
  {
    const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId(sectionNodes[i]));
    
    if (f == nullptr) 
    {
      deletedNodes = true;
    }
  }
  
  if (deletedNodes) 
  {
    sectionNodes.clear();
    panel.clear();
  }
  
  for (int i = audioEngine.getDoc().getNumFilters(); --i >= 0;)
  {
    const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNode (i));
    
    if   (f->getProcessor()->getName() != "Audio Input"
          && f->getProcessor()->getName() != "Audio Output" 
          && f->getProcessor()->getName() != "Midi Input" 
          && f->getProcessor()->getName() != "Midi Output") 
    {
      if (!sectionNodes.contains(f->nodeId)) 
      {
        sectionNodes.add(f->nodeId);
        addEditor(f->getProcessor());
      }
    }
  }
}
Example #29
0
void FormMultiWidget::insertEditor(int idx)
{
    addEditor(idx);
    updateLayout();
    emit textChanged(m_editors.at(idx));
}
SimRobotEditor::Editor* EditorObject::addFile(const QString& filePath, const QString& subFileRegExpPattern)
{
  return addEditor(filePath, subFileRegExpPattern, true);
}