本文整理汇总了C++中lexerconf::Ptr_t::Apply方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr_t::Apply方法的具体用法?C++ Ptr_t::Apply怎么用?C++ Ptr_t::Apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lexerconf::Ptr_t
的用法示例。
在下文中一共展示了Ptr_t::Apply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: conf
GitCommitDlg::GitCommitDlg(wxWindow* parent)
: GitCommitDlgBase(parent)
, m_toggleChecks(false)
{
// read the configuration
clConfig conf("git.conf");
GitEntry data;
conf.ReadItem(&data);
m_splitterInner->SetSashPosition(data.GetGitCommitDlgHSashPos());
m_splitterMain->SetSashPosition(data.GetGitCommitDlgVSashPos());
LexerConf::Ptr_t diffLexer = ColoursAndFontsManager::Get().GetLexer("diff");
if(diffLexer) {
diffLexer->Apply(m_stcDiff);
}
m_choiceRecentCommits->Append(data.GetRecentCommit());
if(!data.GetRecentCommit().IsEmpty()) {
m_choiceRecentCommits->SetSelection(0);
}
SetName("GitCommitDlg");
WindowAttrManager::Load(this);
LexerConf::Ptr_t lex = ColoursAndFontsManager::Get().GetLexer("text");
lex->Apply(m_stcCommitMessage);
}
示例2: PrepareViews
void DiffSideBySidePanel::PrepareViews()
{
// Prepare the views by selecting the proper syntax highlight
wxFileName fnLeft(m_filePickerLeft->GetPath());
wxFileName fnRight(m_filePickerRight->GetPath());
bool useRightSideLexer = false;
if(fnLeft.GetExt() == "svn-base") {
// doing svn diff, use the lexer for the right side file
useRightSideLexer = true;
}
LexerConf::Ptr_t leftLexer =
EditorConfigST::Get()->GetLexerForFile(useRightSideLexer ? fnRight.GetFullName() : fnLeft.GetFullName());
wxASSERT(leftLexer);
LexerConf::Ptr_t rightLexer = EditorConfigST::Get()->GetLexerForFile(fnRight.GetFullName());
wxASSERT(rightLexer);
leftLexer->Apply(m_stcLeft, true);
rightLexer->Apply(m_stcRight, true);
// Create the markers we need
DefineMarkers(m_stcLeft);
DefineMarkers(m_stcRight);
// Turn off PP highlighting
m_stcLeft->SetProperty("lexer.cpp.track.preprocessor", "0");
m_stcLeft->SetProperty("lexer.cpp.update.preprocessor", "0");
m_stcRight->SetProperty("lexer.cpp.track.preprocessor", "0");
m_stcRight->SetProperty("lexer.cpp.update.preprocessor", "0");
}
示例3: SvnCommitDialogBaseClass
SvnCommitDialog::SvnCommitDialog(
wxWindow* parent, const wxArrayString& paths, const wxString& url, Subversion2* plugin, const wxString& repoPath)
: SvnCommitDialogBaseClass(parent)
, m_plugin(plugin)
, m_url(url)
, m_repoPath(repoPath)
, m_process(NULL)
{
Bind(wxEVT_ASYNC_PROCESS_OUTPUT, &SvnCommitDialog::OnProcessOutput, this);
Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &SvnCommitDialog::OnProcessTerminatd, this);
m_stcDiff->SetReadOnly(true);
wxString title = GetTitle();
title << wxT(" - ") << url;
SetTitle(title);
for(size_t i = 0; i < paths.GetCount(); i++) {
int index = m_checkListFiles->Append(paths.Item(i));
m_checkListFiles->Check((unsigned int)index);
}
if(!paths.IsEmpty()) {
m_checkListFiles->Select(0);
DoShowDiff(0);
}
SetName("SvnCommitDialog");
WindowAttrManager::Load(this);
int sashPos = m_plugin->GetSettings().GetCommitDlgSashPos();
if(sashPos != wxNOT_FOUND) {
m_splitterH->SetSashPosition(sashPos);
}
int sashHPos = m_plugin->GetSettings().GetCommitDlgHSashPos();
if(sashHPos != wxNOT_FOUND) {
m_splitterV->SetSashPosition(sashHPos);
}
LexerConf::Ptr_t diffLexer = EditorConfigST::Get()->GetLexer("Diff");
if(diffLexer) {
m_stcDiff->SetLexer(wxSTC_LEX_DIFF);
diffLexer->Apply(m_stcDiff);
}
LexerConf::Ptr_t textLexer = EditorConfigST::Get()->GetLexer("text");
if(textLexer) {
textLexer->Apply(m_stcMessage);
}
}
示例4: DoInitStyle
void CppCheckReportPage::DoInitStyle()
{
m_stc->SetReadOnly(true);
m_stc->MarkerDefine(CPPCHECK_ERROR_MARKER, wxSTC_MARK_ARROW, *wxRED, *wxRED);
m_stc->MarkerDefine(CPPCHECK_ERROR_MARKER_CURRENT, wxSTC_MARK_BACKGROUND, "PINK", "PINK");
m_stc->MarkerSetAlpha(CPPCHECK_ERROR_MARKER_CURRENT, 70);
LexerConf::Ptr_t config = EditorConfigST::Get()->GetLexer("text");
if(config) {
config->Apply(m_stc, true);
m_stc->HideSelection(true);
} else {
// Initialize the output text style
m_stc->SetLexer(wxSTC_LEX_NULL);
m_stc->StyleClearAll();
m_stc->HideSelection(true);
// Use font
for(int i = 0; i <= wxSTC_STYLE_DEFAULT; i++) {
wxFont defFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
defFont.SetFamily(wxFONTFAMILY_TELETYPE);
m_stc->StyleSetBackground(i, DrawingUtils::GetOutputPaneBgColour());
m_stc->StyleSetForeground(i, DrawingUtils::GetOutputPaneFgColour());
m_stc->StyleSetFont(i, defFont);
}
}
}
示例5: license
clAboutDialog::clAboutDialog(wxWindow* parent, const wxString& version)
: clAboutDialogBase(parent)
{
m_staticTextVersion->SetLabel(version);
// Load the license file
wxFileName license(clStandardPaths::Get().GetDataDir(), "LICENSE");
wxString fileContent;
FileUtils::ReadFileContent(license, fileContent);
LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text");
if(lexer) {
lexer->Apply(m_stcLicense);
lexer->Apply(m_stcCredits);
}
// Set the license file
m_stcLicense->SetText(fileContent);
m_stcLicense->SetReadOnly(true);
// Set the credits
wxString credits;
credits << "\n==============================\n\n";
credits << _("Eran Ifrah (Project admin)") << "\n";
credits << _("David G. Hart") << "\n\n";
credits << "==============================\n\n";
credits << _("Frank Lichtner") << "\n";
credits << _("Jacek Kucharski") << "\n";
credits << _("Marrianne Gagnon") << "\n";
credits << _("Scott Dolim") << "\n";
m_stcCredits->SetText(credits);
m_stcCredits->SetReadOnly(true);
CentreOnParent();
GetSizer()->Fit(this);
}
示例6: InitStyledTextCtrl
void DbViewerPanel::InitStyledTextCtrl(wxStyledTextCtrl* sci)
{
LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexer("SQL");
if(lexer) {
lexer->Apply(sci, true);
}
}
示例7: OnXDebugSessionStarting
void PHPDebugPane::OnXDebugSessionStarting(XDebugEvent& event)
{
event.Skip();
m_console->SetTerminal(PHPWorkspace::Get()->GetTerminalEmulator());
LexerConf::Ptr_t phpLexer = ColoursAndFontsManager::Get().GetLexer("php");
if(phpLexer) { phpLexer->Apply(m_console->GetTerminalOutputWindow()); }
}
示例8: AddIncludeFileDlgBase
AddIncludeFileDlg::AddIncludeFileDlg( wxWindow* parent, const wxString &fullpath, const wxString &text, int lineNo )
:
AddIncludeFileDlgBase( parent )
, m_fullpath(fullpath)
, m_text(text)
, m_line(lineNo)
{
UpdateLineToAdd();
// Initialise the preview window
LexerConf::Ptr_t cppLex = EditorConfigST::Get()->GetLexer("C++");
cppLex->Apply( m_textCtrlPreview, true );
//---------------------------------------------------------
m_textCtrlPreview->MarkerDefine(0x7, wxSTC_MARK_ARROW);
m_textCtrlPreview->MarkerSetBackground(0x7, wxT("YELLOW GREEN"));
// Set the initial text
m_textCtrlPreview->SetReadOnly(false);
m_textCtrlPreview->AddText(m_text);
m_textCtrlPreview->EmptyUndoBuffer();
SetAndMarkLine();
m_textCtrlLineToAdd->SetFocus();
WindowAttrManager::Load(this, "AddIncludeFileDlg", NULL);
Centre();
}
示例9: UpdateLexer
void ZoomText::UpdateLexer(IEditor* editor)
{
if(!editor) {
editor = clGetManager()->GetActiveEditor();
}
if(!editor) {
DoClear();
return;
}
znConfigItem data;
clConfig conf("zoom-navigator.conf");
conf.ReadItem(&data);
m_filename = editor->GetFileName().GetFullPath();
LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexerForFile(m_filename);
if(!lexer) {
lexer = EditorConfigST::Get()->GetLexer("Text");
}
lexer->Apply(this, true);
if(lexer->IsDark()) {
MarkerSetAlpha(1, 10);
} else {
MarkerSetAlpha(1, 20);
}
SetZoom(m_zoomFactor);
SetEditable(false);
SetUseHorizontalScrollBar(false);
SetUseVerticalScrollBar(data.IsUseScrollbar());
HideSelection(true);
MarkerSetBackground(1, m_colour);
}
示例10: NodeJSDebuggerPaneBase
NodeJSDebuggerPane::NodeJSDebuggerPane(wxWindow* parent)
: NodeJSDebuggerPaneBase(parent)
{
EventNotifier::Get()->Bind(
wxEVT_NODEJS_DEBUGGER_EXPRESSION_EVALUATED, &NodeJSDebuggerPane::OnExpressionEvaluated, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_UPDATE_CALLSTACK, &NodeJSDebuggerPane::OnUpdateCallstack, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_LOST_INTERACT, &NodeJSDebuggerPane::OnLostControl, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_CONSOLE_LOG, &NodeJSDebuggerPane::OnConsoleLog, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_STARTED, &NodeJSDebuggerPane::OnSessionStarted, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_EXCEPTION_THROWN, &NodeJSDebuggerPane::OnExceptionThrown, this);
EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_SELECT_FRAME, &NodeJSDebuggerPane::OnFrameSelected, this);
EventNotifier::Get()->Bind(
wxEVT_NODEJS_DEBUGGER_UPDATE_BREAKPOINTS_VIEW, &NodeJSDebuggerPane::OnUpdateDebuggerView, this);
LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text");
if(lexer) {
lexer->Apply(m_consoleLog);
}
m_dataviewLocals->SetIndent(16);
m_dataviewLocals->GetColumn(0)->SetWidth(150);
m_dataviewLocals->GetColumn(1)->SetWidth(100);
m_dataviewLocals->GetColumn(2)->SetWidth(500);
m_dvListCtrlCallstack->GetColumn(0)->SetWidth(30);
m_dvListCtrlCallstack->GetColumn(1)->SetWidth(200);
m_dvListCtrlCallstack->GetColumn(2)->SetWidth(300);
m_dvListCtrlCallstack->GetColumn(3)->SetWidth(100);
}
示例11: EditDlgBase
EditDlg::EditDlg(wxWindow* parent, const wxString &text)
: EditDlgBase(parent)
{
LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("text");
lex->Apply( m_stc10 );
m_stc10->SetText( text );
WindowAttrManager::Load(this, "EditDlg");
}
示例12: InitStyles
void GitCommitEditor::InitStyles()
{
LexerConf::Ptr_t diffLexer = EditorConfigST::Get()->GetLexer("Diff");
if(diffLexer) {
diffLexer->Apply(this);
this->SetLexer(wxSTC_LEX_DIFF);
}
}
示例13: OnSessionStarted
void NodeJSDebuggerPane::OnSessionStarted(clDebugEvent& event)
{
event.Skip();
m_consoleLog->ClearAll();
LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text");
if(lexer) {
lexer->Apply(m_consoleLog);
}
}
示例14: EnterStringsDlgBase
EnterStringsDlg::EnterStringsDlg(wxWindow* parent, const wxString& value)
: EnterStringsDlgBase(parent)
{
LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text", "Default");
if(lexer) { lexer->Apply(m_stc); }
m_stc->SetText(value);
SetName("EnterStringsDlg");
WindowAttrManager::Load(this);
}
示例15: TerminalEmulatorFrame
PHPTerminal::PHPTerminal(wxWindow* parent)
: TerminalEmulatorFrame(parent)
{
LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("php");
if(lexer) {
lexer->Apply(GetTerminalUI()->GetTerminalOutputWindow());
}
SetSize(300, 300);
WindowAttrManager::Load(this, "PHPTerminal");
}