本文整理汇总了C++中LEditor类的典型用法代码示例。如果您正苦于以下问题:C++ LEditor类的具体用法?C++ LEditor怎么用?C++ LEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoSelectPage
bool MainBook::DoSelectPage(wxWindow* win)
{
LEditor* editor = dynamic_cast<LEditor*>(win);
if(editor) {
editor->SetActive();
m_quickFindBar->SetEditor(editor);
} else {
m_quickFindBar->ShowForPlugins();
}
// Remove context menu if needed
DoHandleFrameMenu(editor);
if(!editor) {
clMainFrame::Get()->SetFrameTitle(NULL);
clMainFrame::Get()->GetStatusBar()->SetLinePosColumn(wxEmptyString);
UpdateNavBar(NULL);
SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win);
} else {
// if(editor->GetContext()->GetName() == wxT("C++")) {
// if(clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) {
// clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")),
// wxT("C++"));
// }
// }
wxCommandEvent event(wxEVT_ACTIVE_EDITOR_CHANGED);
EventNotifier::Get()->AddPendingEvent(event);
}
return true;
}
示例2: IsShown
bool FindInFilesDialog::Show()
{
bool res = IsShown() || wxFrame::Show();
if(res) {
// update the combobox
m_findString->Clear();
m_findString->Append(m_data.GetFindStringArr());
DoSetFileMask();
m_findString->SetValue(m_data.GetFindString());
LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
if(editor) {
// if we have an open editor, and a selected text, make this text the search string
wxString selText = editor->GetSelectedText();
if(!selText.IsEmpty()) {
m_findString->SetValue(selText);
}
}
m_findString->SetSelection(-1, -1); // select all
m_findString->SetFocus();
}
return res;
}
示例3: ProcessUpdateUIEvent
void EditHandler::ProcessUpdateUIEvent(wxWindow *owner, wxUpdateUIEvent &event)
{
LEditor *editor = dynamic_cast<LEditor*>(owner);
if (event.GetId() == wxID_COPY || event.GetId() == XRCID("trim_trailing") || event.GetId() == XRCID("to_lower") || event.GetId() == XRCID("to_upper")) {
event.Enable(editor);
} else if (event.GetId() == wxID_CUT) {
event.Enable(editor);
} else if (event.GetId() == wxID_PASTE) {
#ifdef __WXGTK__
event.Enable(editor);
#else
event.Enable(editor && editor->CanPaste());
#endif
} else if (event.GetId() == wxID_UNDO) {
event.Enable(editor && editor->CanUndo());
} else if (event.GetId() == wxID_REDO) {
event.Enable(editor && editor->CanRedo());
} else if (event.GetId() == wxID_SELECTALL) {
event.Enable(editor && editor->GetLength() > 0);
} else if (event.GetId() == wxID_DUPLICATE || event.GetId() == wxID_DELETE) {
event.Enable(true);
} else {
event.Enable(false);
}
event.Skip(false);
}
示例4: if
void QuickFindBar::OnHighlightMatchesUI(wxUpdateUIEvent& event)
{
if(ManagerST::Get()->IsShutdownInProgress()) {
event.Enable(false);
} else if(!m_sci) {
event.Enable(false);
} else if(m_findWhat->GetValue().IsEmpty()) {
event.Enable(false);
} else {
LEditor* editor = dynamic_cast<LEditor*>(m_sci);
if(!editor) {
event.Enable(false);
} else {
// Check to see if there are any markers
int nLine = editor->LineFromPosition(0);
int nFoundLine = editor->MarkerNext(nLine, mmt_find_bookmark);
event.Enable(true);
event.Check(nFoundLine != wxNOT_FOUND);
}
}
}
示例5: fileNameStr
LEditor* MainBook::NewEditor()
{
static int fileCounter = 0;
wxString fileNameStr(_("Untitled"));
fileNameStr << ++fileCounter;
wxFileName fileName(fileNameStr);
// A Nice trick: hide the notebook, open the editor
// and then show it
bool hidden(false);
if(m_book->GetPageCount() == 0) hidden = GetSizer()->Hide(m_book);
LEditor* editor = new LEditor(m_book);
editor->SetFileName(fileName);
AddPage(editor, fileName.GetFullName(), fileName.GetFullPath(), wxNullBitmap, true);
#ifdef __WXMAC__
m_book->GetSizer()->Layout();
#endif
// SHow the notebook
if(hidden) GetSizer()->Show(m_book);
editor->SetActive();
return editor;
}
示例6: GetTagAtCaret
TagEntryPtr PluginManager::GetTagAtCaret(bool scoped, bool impl)
{
LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
if(!editor)
return NULL;
return editor->GetContext()->GetTagAtCaret(scoped, impl);
}
示例7: DoSelectPage
bool MainBook::DoSelectPage(wxWindow* win)
{
LEditor *editor = dynamic_cast<LEditor*>(win);
if ( editor ) {
editor->SetActive();
m_quickFindBar->SetEditor( editor );
} else {
m_quickFindBar->ShowForPlugins();
}
// Remove context menu if needed
DoHandleFrameMenu(editor);
if (!editor) {
clMainFrame::Get()->SetFrameTitle(NULL);
clMainFrame::Get()->SetStatusMessage(wxEmptyString, 1); // clear line & column indicator
UpdateNavBar(NULL);
SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win);
} else {
if (editor->GetContext()->GetName() == wxT("C++")) {
if (clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) {
clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")), wxT("C++"));
}
}
SendCmdEvent(wxEVT_ACTIVE_EDITOR_CHANGED, (IEditor*)editor);
}
return true;
}
示例8: ProcessEditEvent
void PluginManager::ProcessEditEvent(wxCommandEvent& e, IEditor* editor)
{
LEditor* lEditor = dynamic_cast<LEditor*>(editor);
if(lEditor) {
lEditor->OnMenuCommand(e);
}
}
示例9: FindAndSelect
void PluginManager::FindAndSelect(const wxString& pattern, const wxString& name, int pos)
{
LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
if(editor) {
editor->FindAndSelectV(pattern, name, pos, NavMgr::Get());
editor->SetActive();
}
}
示例10: OnOpenInEditor
void NewBuildTab::OnOpenInEditor(wxCommandEvent& e)
{
wxString content = this->GetBuildContent();
LEditor *editor = clMainFrame::Get()->GetMainBook()->NewEditor();
if ( editor ) {
editor->SetText(content);
}
}
示例11: OnPaste
void BuildTabTopPanel::OnPaste(wxCommandEvent& event)
{
wxString content = m_buildTab->GetBuildContent();
LEditor *editor = clMainFrame::Get()->GetMainBook()->NewEditor();
if ( editor ) {
editor->SetText(content);
}
}
示例12: DoGetCurFileName
wxFileName NavBar::DoGetCurFileName() const
{
LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
if(!editor) return wxFileName();
const wxFileName& fn = editor->GetFileName();
return fn;
}
示例13: ProcessCommandEvent
void WordWrapHandler::ProcessCommandEvent(wxWindow *owner, wxCommandEvent &event)
{
LEditor *editor = dynamic_cast<LEditor*>(owner);
if ( !editor ) {
return;
}
editor->SetWrapMode(event.IsChecked() ? wxSTC_WRAP_WORD : wxSTC_WRAP_NONE);
}
示例14: OnShowFile
void WorkspaceTab::OnShowFile(wxCommandEvent& e)
{
LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
if(editor && !editor->GetProject().IsEmpty()) {
m_fileView->ExpandToPath(editor->GetProject(), editor->GetFileName());
ManagerST::Get()->ShowWorkspacePane(m_caption);
}
e.Skip();
}
示例15: CHECK_CLANG_ENABLED
void ClangDriver::DoGotoDefinition(ClangThreadReply* reply)
{
CHECK_CLANG_ENABLED();
LEditor* editor = clMainFrame::Get()->GetMainBook()->OpenFile(reply->filename, wxEmptyString, reply->line);
if(editor) {
int pos = editor->PositionFromLine(reply->line - 1);
editor->FindAndSelectV(reply->filterWord, reply->filterWord, pos, NULL);
}
}