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

C++ TextEditor类代码示例

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

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



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

示例1: do_QueryInterface

NS_IMETHODIMP
DeleteCommand::IsCommandEnabled(const char* aCommandName,
                                nsISupports* aCommandRefCon, bool* aIsEnabled) {
  if (NS_WARN_IF(!aIsEnabled)) {
    return NS_ERROR_INVALID_ARG;
  }

  *aIsEnabled = false;

  nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
  if (!editor) {
    return NS_OK;
  }

  TextEditor* textEditor = editor->AsTextEditor();
  MOZ_ASSERT(textEditor);

  // We can generally delete whenever the selection is editable.  However,
  // cmd_delete doesn't make sense if the selection is collapsed because it's
  // directionless, which is the same condition under which we can't cut.
  *aIsEnabled = textEditor->IsSelectionEditable();

  if (!nsCRT::strcmp("cmd_delete", aCommandName) && *aIsEnabled) {
    nsresult rv = textEditor->CanDelete(aIsEnabled);
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }
  }
  return NS_OK;
}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:30,代码来源:EditorCommands.cpp


示例2: textEditorEscapeKeyPressed

//------------------------------------------------------------------------------
void PreferencesDialog::textEditorEscapeKeyPressed(TextEditor &editor)
{
	if(editor.getName() == "oscPortEditor")
		editor.setText(currentPort, false);
	else if(editor.getName() == "oscMulticastEditor")
		editor.setText(currentMulticast, false);
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:8,代码来源:PreferencesDialog.cpp


示例3: toLower

string CreatureEditor::edit(vector<string> args)
{
	if(args.size() < 2)
	{
		return "What do you want to edit?";
	}
	string editNoun = args[1];
	toLower(&editNoun);

	if(editNoun == STR_NAME)
	{
		return set(args);

	}
	else if(editNoun == STR_DESCRIPTION || editNoun == STR_DESC)
	{
		TextEditor ed;
		creature->description = ed.edit("Editing Description For Creature:"+creature->getPrimaryName(),creature->description);
		clearWindows();
		resetWindows();
		return "";
	}
	else
	{
		return "I don't know how to edit that";
	}
}
开发者ID:matprophet,项目名称:dungeonbuilder,代码行数:27,代码来源:creature_editor.cpp


示例4: QSplitter

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);




}
开发者ID:obiwankennedy,项目名称:QPhpEdit,代码行数:29,代码来源:editwidget.cpp


示例5: Window

MenuWindow::MenuWindow(AmobaApplication &app, int x, int y) : Window (x, y), _app(app) {
    StaticText *text = new StaticText(170, 50, 100,30, "Amöba");
    widgets.push_back(text);

    ClickButton *kilepesGomb = new ClickButton([&]() { kilepesClicked(); }, 40, 320, 100, 35);
    widgets.push_back(kilepesGomb);

    StaticText *exit = new StaticText(70, 330, 40, 20, "EXIT");
    widgets.push_back(exit);

    ClickButton *jatekGomb = new ClickButton([&]() { jatekClicked(); }, 260, 320, 100, 35);
    widgets.push_back(jatekGomb);

    StaticText *kek = new StaticText(40, 180, 100, 35, "Kék játékos:");
    widgets.push_back(kek);

    TextEditor *ed = new TextEditor(40, 200, 100, 35, _app.players[0]);
    ed->addValueChangeListener([&](ValueChangedEvent event) { textEditorChanged(event); });
    widgets.push_back(ed);

    StaticText *play = new StaticText(290, 330, 40, 20, "PLAY");
    widgets.push_back(play);

    StaticText *piros = new StaticText(260, 180, 100, 35, "Piros játékos:");
    widgets.push_back(piros);

    TextEditor *ed2 = new TextEditor(260, 200, 100, 35, _app.players[1]);
    ed2->addValueChangeListener([&](ValueChangedEvent event) { textEditorChanged2(event); });
    widgets.push_back(ed2);

}
开发者ID:renneragi,项目名称:beadando3,代码行数:31,代码来源:menuwindow.cpp


示例6: mapToParent

void IDLabel::showExtended(const QPoint &p) {//, bool alreadyAdjusted, RegisterLabel *v) {
/*   QPoint p2 = p;
   if (!alreadyAdjusted)
      p2 = mapToParent(p);

   if (v == NULL)
      v = this;*/

/*   if (m_parent->m_extended->m_orig == this || m_parent->m_extended->m_orig == v) {
      m_parent->m_extended->move(p2);
      return;
   }*/

   QString alias = getRegisterText(m_register, true);
   QString regName = ((m_register >= 32) ? 
      QString("<b>%1</b>").arg(alias) : 
      QString("<b>r%1</b> (%2)").arg(QString::number(m_register), alias));
   
   QString mText = QString(
      "<span style=\"font-size: 12;\">%1</span>"
      "<pre>").arg(regName);

   if (m_value == 0)
      mText += QString("Value = 0");
   else {
      QString one = getNoInBase(m_value, 16), 
//              two = getNoInBase(m_value, 2), 
              three = getNoInBase(m_value, -10), 
              four = getNoInBase(m_value, 10);
      
      mText += QString(
         "Hex:      %1<br>"
//         "Binary:   %2<br>"
         "Decimal:  %2")
         .arg(one, /*two, */three);
      if (three != four)
         mText += QString("<br>UDecimal: %1").arg(four);
   }
   
   // Display the line which is responsible for setting 
   // the value currently in this register.
   TextEditor *active = NULL;
   if (m_lastModified != NULL && m_lastModified->isValid() && m_lastModified->getTextBlock() != NULL && (active = m_parent->m_parent->m_gui->getActiveProgram()) != NULL) {
      mText += QString("<br>"
                       "(Set by line <i>%1</i>)").arg(1 + active->lineNumber(*m_lastModified->getTextBlock()));
   }
   
   mText += QString("</pre>");
   /*
      QString("");
      ("Last modifed by<br>line: <b>%1</b>").arg(QString("N/A"));*/
    //"<ul style=\"list-style: none;\">"
         /*"<li "STYLE_LEFT">Hex</li><li "STYLE_RIGHT">%2</li>"
         "<li "STYLE_LEFT">Binary</li><li "STYLE_RIGHT">%3</li>"
         "<li "STYLE_LEFT">Decimal</li><li "STYLE_RIGHT">%4</li>"
         "<li "STYLE_LEFT">Unsigned</li><li "STYLE_RIGHT">%5</li>"*/
      //"</ul>"
   
   m_parent->showExtended(p, mText, this);
}
开发者ID:MipScope,项目名称:mipscope,代码行数:60,代码来源:RegisterView.cpp


示例7: NS_ENSURE_ARG_POINTER

NS_IMETHODIMP
SelectAllCommand::IsCommandEnabled(const char* aCommandName,
                                   nsISupports* aCommandRefCon,
                                   bool* aIsEnabled) {
  NS_ENSURE_ARG_POINTER(aIsEnabled);

  nsresult rv = NS_OK;
  // You can always select all, unless the selection is editable,
  // and the editable region is empty!
  *aIsEnabled = true;

  nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
  if (!editor) {
    return NS_OK;
  }

  // You can select all if there is an editor which is non-empty
  TextEditor* textEditor = editor->AsTextEditor();
  MOZ_ASSERT(textEditor);
  bool isEmpty = false;
  rv = textEditor->IsEmpty(&isEmpty);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }
  *aIsEnabled = !isEmpty;
  return NS_OK;
}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:27,代码来源:EditorCommands.cpp


示例8: TextEditor

void AddFilmWindow::ShowEditor( CutLabel* editDataIn, const QString& title )
{
    TextEditor* editor = new TextEditor( this );
    editor->SetDataSource( editDataIn );
    editor->SetDataReceiver( editDataIn );
    editor->SetTitle( title );
    editor->show();
}
开发者ID:david-geiger,项目名称:alexandra,代码行数:8,代码来源:addfilmwindow.cpp


示例9: fillTextEditorBackground

void ProjucerLookAndFeel::fillTextEditorBackground (Graphics& g, int width, int height, TextEditor& textEditor)
{
    g.setColour (textEditor.findColour (TextEditor::backgroundColourId));
    g.fillRect (0, 0, width, height);

    g.setColour (textEditor.findColour (TextEditor::outlineColourId));
    g.drawHorizontalLine (height - 1, 0.0f, static_cast<float> (width));
}
开发者ID:azeteg,项目名称:HISE,代码行数:8,代码来源:jucer_ProjucerLookAndFeel.cpp


示例10: editHtml

QString editHtml(const QString& s, const QString& title)
      {
      TextEditor editor;
      editor.setWindowTitle(title);
      editor.setHtml(s);
      editor.exec();
      return editor.toHtml();
      }
开发者ID:aeliot,项目名称:MuseScore,代码行数:8,代码来源:texteditor.cpp


示例11: drawTextEditorOutline

//==============================================================================
void OldSchoolLookAndFeel::drawTextEditorOutline (Graphics& g, int width, int height, TextEditor& textEditor)
{
    if (textEditor.isEnabled())
    {
        g.setColour (textEditor.findColour (TextEditor::outlineColourId));
        g.drawRect (0, 0, width, height);
    }
}
开发者ID:randi2kewl,项目名称:ShoutOut,代码行数:9,代码来源:juce_OldSchoolLookAndFeel.cpp


示例12: editPlainText

QString editPlainText(const QString& s, const QString& title)
      {
      TextEditor editor;
      editor.setWindowTitle(title);
      editor.setPlainText(s);
      editor.exec();
      return editor.toPlainText();
      }
开发者ID:aeliot,项目名称:MuseScore,代码行数:8,代码来源:texteditor.cpp


示例13: textEditorReturnKeyPressed

void HadronLabel::textEditorReturnKeyPressed(TextEditor& editor)
{
    if (use_modal_editor_) {
        setText(editor.getText(), true);
        editor.exitModalState(0);
    }
    else {
        Label::textEditorReturnKeyPressed(editor);
    }
}
开发者ID:mattsonic,项目名称:GateTrigger,代码行数:10,代码来源:HadronLabel.cpp


示例14: do_QueryInterface

NS_IMETHODIMP
InsertLineBreakCommand::DoCommand(const char* aCommandName,
                                  nsISupports* aCommandRefCon)
{
  nsCOMPtr<nsIPlaintextEditor> editor = do_QueryInterface(aCommandRefCon);
  if (NS_WARN_IF(!editor)) {
    return NS_ERROR_NOT_IMPLEMENTED;
  }

  TextEditor* textEditor = static_cast<TextEditor*>(editor.get());

  return textEditor->TypedText(EmptyString(), TextEditor::eTypedBR);
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:13,代码来源:EditorCommands.cpp


示例15: mouseUp

void DragLabel::mouseUp(const MouseEvent& e)
{
    // By showing the editor here (instead of letting the base class do it
    // for us) we can get a pointer to the editor and make sure that users
    // can't enter anything except 1..5 digits.
    this->showEditor();
    TextEditor* ed = this->getCurrentTextEditor();
    if (ed)
    {
        ed->setInputRestrictions(5, "0123456789");
    }
    Label::mouseUp(e);
}
开发者ID:alessandrostone,项目名称:scumbler,代码行数:13,代码来源:LoopComponent.cpp


示例16: textEditorFocusLost

//------------------------------------------------------------------------------
void PreferencesDialog::textEditorFocusLost(TextEditor &editor)
{
	if(editor.getName() == "oscPortEditor")
	{
		currentPort = editor.getText();
		mainPanel->setSocketPort(currentPort);
	}
	else if(editor.getName() == "oscMulticastEditor")
	{
		currentMulticast = editor.getText();
		mainPanel->setSocketMulticast(currentMulticast);
	}
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:14,代码来源:PreferencesDialog.cpp


示例17: execSyncV

void TextEditorBase::execSyncV(      FieldContainer    &oFrom,
                                        ConstFieldMaskArg  whichField,
                                        AspectOffsetStore &oOffsets,
                                        ConstFieldMaskArg  syncMode,
                                  const UInt32             uiSyncInfo)
{
    TextEditor *pThis = static_cast<TextEditor *>(this);

    pThis->execSync(static_cast<TextEditor *>(&oFrom),
                    whichField,
                    oOffsets,
                    syncMode,
                    uiSyncInfo);
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:14,代码来源:OSGTextEditorBase.cpp


示例18: main

int main( int argc, char** argv )
{
    QApplication qApplication( argc, argv );
                 qApplication.setQuitOnLastWindowClosed( true );

    TextEditor  textEditor;
                textEditor.show();

    // open the the specified command line files if any
    if( qApplication.arguments().size() > 1 )
        for( int index=1; index < qApplication.arguments().size(); index++ )
            textEditor.newTab( qApplication.arguments().value(index) );

    return qApplication.exec();
}
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:15,代码来源:main.cpp


示例19: textEditorTextChanged

//------------------------------------------------------------------------------
void MappingsDialog::textEditorTextChanged(TextEditor &editor)
{
	BypassableInstance *proc = dynamic_cast<BypassableInstance *>(pluginNode->getProcessor());

	if(proc)
		oscManager->registerMIDIProcessor(editor.getText(), proc);
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:8,代码来源:MappingsDialog.cpp


示例20: shadowColour

void NonShinyLookAndFeel::drawTextEditorOutline (Graphics& g, int width, int height, TextEditor& textEditor)
{
    if (textEditor.isEnabled())
    {
        if (textEditor.hasKeyboardFocus (true) && ! textEditor.isReadOnly())
        {
            const int border = 2;

            g.setColour (textEditor.findColour (TextEditor::focusedOutlineColourId));
            g.drawRect (0, 0, width, height, border);

            g.setOpacity (1.0f);
            const Colour shadowColour (textEditor.findColour (TextEditor::shadowColourId).withMultipliedAlpha (0.75f));
            drawBevel (g, 0, 0, width, height + 2, border + 2, shadowColour, shadowColour);
        }
        else
        {
            g.setColour (textEditor.findColour (TextEditor::outlineColourId));
            g.drawRect (0, 0, width, height);

            g.setOpacity (1.0f);
            const Colour shadowColour (textEditor.findColour (TextEditor::shadowColourId));
            drawBevel (g, 0, 0, width, height + 2, 3, shadowColour, shadowColour);
        }
    }
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:26,代码来源:LookAndFeel.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TextEncoding类代码示例发布时间:2022-05-31
下一篇:
C++ TextEdit类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap