Esempio n. 1
0
void CodeEdit::SetDefaultLexer()
{
    SetLexer(wxSTC_LEX_NULL);

    SetKeyWords(1, "");

    // Set the caret width to match MSVC.
    SetCaretWidth(2);

    // Set the marker bitmaps.
    MarkerDefineBitmap(Marker_Breakpoint,  wxMEMORY_BITMAP(Breakpoint_png) );
    MarkerDefineBitmap(Marker_CurrentLine, wxMEMORY_BITMAP(Currentline_png) );
    MarkerDefineBitmap(Marker_BreakLine,   wxMEMORY_BITMAP(Breakline_png) );

    // Setup the dwell time before a tooltip is displayed.
    SetMouseDwellTime(300);

    SetMarginSensitive(1, true);
    SetMarginType(1, wxSTC_MARGIN_SYMBOL);

    // Set the autocomplete icons.

    wxColour maskColor(0xFF, 0x9B, 0x77);

    wxBitmap functionIcon(functionicon, wxBITMAP_TYPE_XPM);
    functionIcon.SetMask(new wxMask(functionicon, maskColor));
    
    RegisterImage(AutoCompleteManager::Type_Function, functionIcon);

    wxBitmap classIcon(classicon, wxBITMAP_TYPE_XPM);
    classIcon.SetMask(new wxMask(classicon, maskColor));
    
    RegisterImage(AutoCompleteManager::Type_Class, classIcon);

}
Esempio n. 2
0
void FunctionsTreeWidget::updateFunctionItem(QTreeWidgetItem* item, const Function* function)
{
    Q_ASSERT(item != NULL);
    Q_ASSERT(function != NULL);
    item->setText(COL_NAME, function->name());
    item->setIcon(COL_NAME, functionIcon(function));
    item->setData(COL_NAME, Qt::UserRole, function->id());
    item->setData(COL_NAME, Qt::UserRole + 1, function->type());
    item->setFlags(item->flags() & ~Qt::ItemIsDropEnabled);
}
Esempio n. 3
0
void FunctionManager::updateFunctionItem(QTreeWidgetItem* item,
					 Function* function)
{
	Q_ASSERT(item != NULL);
	Q_ASSERT(function != NULL);

	item->setText(KColumnName, function->name());
	item->setIcon(KColumnName, functionIcon(function));
	item->setText(KColumnBus, Bus::instance()->idName(function->busID()));
	item->setText(KColumnID, QString("%1").arg(function->id()));
}
Esempio n. 4
0
QTreeWidgetItem* FunctionsTreeWidget::parentItem(const Function* function)
{
    Q_ASSERT(function != NULL);

    // Special case for Sequences. They belong to a Scene node
    if (function->type() == Function::Chaser && qobject_cast<const Chaser*>(function)->isSequence() == true)
    {
        quint32 sid = qobject_cast<const Chaser*>(function)->getBoundSceneID();
        Function *sceneFunc = m_doc->function(sid);
        if (sceneFunc != NULL)
        {
            QTreeWidgetItem *sceneTopItem = folderItem(sceneFunc->path());
            if (sceneTopItem != NULL)
            {
                for (int i = 0; i < sceneTopItem->childCount(); i++)
                {
                    QTreeWidgetItem *child = sceneTopItem->child(i);
                    Q_ASSERT(child != NULL);

                    if (sid == itemFunctionId(child))
                        return child;
                }
            }
        }
    }

    QString basePath = Function::typeToString(function->type());
    if (m_foldersMap.contains(QString(basePath + "/")) == false)
    {
        // Parent item for the given type doesn't exist yet so create one
        QTreeWidgetItem* item = new QTreeWidgetItem(this);
        item->setText(COL_NAME, basePath);
        item->setIcon(COL_NAME, functionIcon(function));
        item->setData(COL_NAME, Qt::UserRole, Function::invalidId());
        item->setData(COL_NAME, Qt::UserRole + 1, function->type());
        item->setText(COL_PATH, QString(basePath + "/"));
        item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled);
        m_foldersMap[QString(basePath + "/")] = item;
    }

    QTreeWidgetItem *pItem = folderItem(function->path());

    if (pItem != NULL)
    {
        //qDebug() << "Found item for function:" << function->name() << ", path: " << function->path();
        return pItem;
    }


    return NULL;
}