本文整理汇总了C++中OptionsConfigPtr类的典型用法代码示例。如果您正苦于以下问题:C++ OptionsConfigPtr类的具体用法?C++ OptionsConfigPtr怎么用?C++ OptionsConfigPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OptionsConfigPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EditorSettingsTerminalBase
EditorSettingsTerminal::EditorSettingsTerminal( wxWindow* parent )
: EditorSettingsTerminalBase( parent )
, TreeBookNode<EditorSettingsTerminal>()
{
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
m_textCtrlProgramConsoleCmd->SetValue(options->GetProgramConsoleCommand());
}
示例2: GetToolbarIconSize
int PluginManager::GetToolbarIconSize()
{
// for now return 24 by default
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
if(options) {
return options->GetIconsSize();
}
return 24;
}
示例3: EditorSettingsTerminalBase
EditorSettingsTerminal::EditorSettingsTerminal( wxWindow* parent )
: EditorSettingsTerminalBase( parent )
, TreeBookNode<EditorSettingsTerminal>()
{
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
m_textCtrlProgramConsoleCmd->SetValue(options->GetProgramConsoleCommand());
m_checkBoxUseCodeLiteTerminal->SetValue( options->HasOption( OptionsConfig::Opt_Use_CodeLite_Terminal) );
}
示例4: DoToggleReplacebar
void QuickFindBar::DoToggleReplacebar()
{
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
bool show = !options->GetShowReplaceBar();
options->SetShowReplaceBar(show);
EditorConfigST::Get()->SetOptions(options);
ShowReplacebar(show);
}
示例5: wxT
OptionsConfigPtr EditorConfig::GetOptions() const
{
wxXmlNode* node = XmlUtils::FindFirstByTagName(m_doc->GetRoot(), wxT("Options"));
// node can be null ...
OptionsConfigPtr opts = new OptionsConfig(node);
// import legacy tab-width setting into opts
long tabWidth = const_cast<EditorConfig*>(this)->GetInteger(wxT("EditorTabWidth"), -1);
if(tabWidth != -1) { opts->SetTabWidth(tabWidth); }
return opts;
}
示例6: DoPopulateDefaultLabels
void BookmarkManager::OnEditorSettingsChanged(wxCommandEvent& e)
{
e.Skip();
DoPopulateDefaultLabels();
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
for(int i = smt_FIRST_BMK_TYPE; i <= smt_LAST_BMK_TYPE; ++i) {
wxString new_label = options->GetBookmarkLabel(i - smt_FIRST_BMK_TYPE);
new_label.Trim().Trim(false);
if(!new_label.IsEmpty()) {
m_markerLabels.erase(i);
m_markerLabels.insert(std::make_pair(i, new_label));
}
}
}
示例7: DoGetGlobalEOL
int CodeFormatter::DoGetGlobalEOL() const
{
OptionsConfigPtr options = m_mgr->GetEditorSettings();
if(options->GetEolMode() == wxT("Unix (LF)")) {
return 2;
} else if(options->GetEolMode() == wxT("Mac (CR)")) {
return 1;
} else if(options->GetEolMode() == wxT("Windows (CRLF)")) {
return 0;
} else {
// set the EOL by the hosting OS
#if defined(__WXMAC__)
return 2;
#elif defined(__WXGTK__)
return 2;
#else
return 0;
#endif
}
}
示例8: SetOptions
void EditorConfig::SetOptions(OptionsConfigPtr opts)
{
// locate the current node
wxXmlNode *node = XmlUtils::FindFirstByTagName(m_doc->GetRoot(), wxT("Options"));
if( node ){
m_doc->GetRoot()->RemoveChild(node);
delete node;
}
m_doc->GetRoot()->AddChild(opts->ToXml());
m_doc->Save(m_fileName.GetFullPath());
}
示例9: EditorSettingsFoldingBase
EditorSettingsFolding::EditorSettingsFolding( wxWindow* parent )
: EditorSettingsFoldingBase( parent )
, TreeBookNode<EditorSettingsFolding>()
{
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
m_displayMargin->SetValue(options->GetDisplayFoldMargin());
m_underlineFolded->SetValue(options->GetUnderlineFoldLine());
m_foldPreprocessors->SetValue(options->GetFoldPreprocessor());
m_foldCompact->SetValue(options->GetFoldCompact());
m_foldElse->SetValue(options->GetFoldAtElse());
const wxString FoldStyles[] = { wxTRANSLATE("Simple"),
wxTRANSLATE("Arrows"),
wxTRANSLATE("Flatten Tree Square Headers"),
wxTRANSLATE("Flatten Tree Circular Headers") };
m_stringManager.AddStrings(sizeof(FoldStyles)/sizeof(wxString), FoldStyles, options->GetFoldStyle(), m_foldStyle);
}
示例10: SetOptions
void EditorConfig::SetOptions(OptionsConfigPtr opts)
{
// remove legacy tab-width setting
wxXmlNode* child = XmlUtils::FindNodeByName(m_doc->GetRoot(), wxT("ArchiveObject"), wxT("EditorTabWidth"));
if(child) {
m_doc->GetRoot()->RemoveChild(child);
delete child;
}
// locate the current node
wxString nodeName = wxT("Options");
wxXmlNode* node = XmlUtils::FindFirstByTagName(m_doc->GetRoot(), nodeName);
if(node) {
m_doc->GetRoot()->RemoveChild(node);
delete node;
}
m_doc->GetRoot()->AddChild(opts->ToXml());
DoSave();
wxCommandEvent evt(wxEVT_EDITOR_CONFIG_CHANGED);
evt.SetString(nodeName);
EventNotifier::Get()->AddPendingEvent(evt);
}
示例11: Save
void EditorSettingsFolding::Save(OptionsConfigPtr options)
{
options->SetDisplayFoldMargin(m_displayMargin->GetValue());
options->SetUnderlineFoldLine(m_underlineFolded->GetValue());
options->SetFoldPreprocessor(m_foldPreprocessors->GetValue());
options->SetFoldCompact(m_foldCompact->GetValue());
options->SetFoldAtElse(m_foldElse->GetValue());
// Get the foldstyle selection, unlocalised
wxString foldStyle = m_stringManager.GetStringSelection();
// thses 2 styles no longer exists...
if(foldStyle == _("Arrows with Background Colour") || foldStyle == _("Simple with Background Colour"))
foldStyle.Clear();
if (foldStyle.IsEmpty()) {
foldStyle = wxT("Arrows");
}
options->SetFoldStyle(foldStyle);
}
示例12: GetOptions
void EditorConfig::SetPaneStickiness(const wxString& caption, bool stickiness)
{
OptionsConfigPtr options = GetOptions();
if(caption == _("Build")) {
options->SetHideOutputPaneNotIfBuild(stickiness);
} else if(caption == _("Search")) {
options->SetHideOutputPaneNotIfSearch(stickiness);
} else if(caption == _("Replace")) {
options->SetHideOutputPaneNotIfReplace(stickiness);
} else if(caption == _("References")) {
options->SetHideOutputPaneNotIfReferences(stickiness);
} else if(caption == _("Output")) {
options->SetHideOutputPaneNotIfOutput(stickiness);
} else if(caption == _("Debug")) {
options->SetHideOutputPaneNotIfDebug(stickiness);
} else if(caption == _("Trace")) {
options->SetHideOutputPaneNotIfTrace(stickiness);
} else if(caption == _("Tasks")) {
options->SetHideOutputPaneNotIfTasks(stickiness);
} else if(caption == _("BuildQ")) {
options->SetHideOutputPaneNotIfBuildQ(stickiness);
} else if(caption == _("CppCheck")) {
options->SetHideOutputPaneNotIfCppCheck(stickiness);
} else if(caption == _("Subversion")) {
options->SetHideOutputPaneNotIfSvn(stickiness);
} else if(caption == _("Cscope")) {
options->SetHideOutputPaneNotIfCscope(stickiness);
} else if(caption == _("Git")) {
options->SetHideOutputPaneNotIfGit(stickiness);
} else if(caption == _("MemCheck")) {
options->SetHideOutputPaneNotIfMemCheck(stickiness);
} else {
return;
}
SetOptions(options);
Save();
}
示例13: Save
void EditorOptionsGeneralGuidesPanel::Save(OptionsConfigPtr options)
{
options->SetDisplayLineNumbers(m_displayLineNumbers->IsChecked());
options->SetHighlightMatchedBraces(m_checkBoxMatchBraces->IsChecked());
options->SetShowIndentationGuidelines(m_showIndentationGuideLines->IsChecked());
options->SetHighlightCaretLine(m_highlightCaretLine->IsChecked());
options->SetCaretLineColour(m_caretLineColourPicker->GetColour());
options->SetEolMode(m_EOLstringManager.GetStringSelection());
options->SetHideChangeMarkerMargin(m_checkBoxHideChangeMarkerMargin->IsChecked());
options->SetDisableSemicolonShift(m_checkBoxDisableSemicolonShift->IsChecked());
options->SetDebuggerMarkerLine(m_colourPickerDbgLine->GetColour());
options->EnableOption(OptionsConfig::Opt_Mark_Debugger_Line, m_checkBoxMarkdebuggerLine->IsChecked());
// save the whitespace visibility
wxString Whitespace = m_WSstringManager.GetStringSelection();
int style(wxSTC_WS_INVISIBLE); // invisible
if(Whitespace == wxT("Visible always")) {
style = wxSTC_WS_VISIBLEALWAYS;
} else if(Whitespace == wxT("Visible after indentation")) {
style = wxSTC_WS_VISIBLEAFTERINDENT;
} else if(Whitespace == wxT("Indentation only")) {
style = wxSTC_WS_VISIBLEAFTERINDENT;
}
options->SetShowWhitspaces(style);
}
示例14: DisplayHigherValues
void EditorSettingsLocal::DisplayHigherValues( const OptionsConfigPtr options )
{
// There should be 'global' (or workspace if this will be a project setting) values for each setting
// Insert them all, but leave the enabling checkboxes ticked, so the items will be disabled
m_indentsUsesTabs->SetValue(options->GetIndentUsesTabs());
m_indentWidth->SetValue(options->GetIndentWidth());
m_tabWidth->SetValue(options->GetTabWidth());
m_displayLineNumbers->SetValue(options->GetDisplayLineNumbers());
m_showIndentationGuideLines->SetValue(options->GetShowIndentationGuidelines());
m_highlightCaretLine->SetValue(options->GetHighlightCaretLine());
m_checkBoxTrimLine->SetValue(options->GetTrimLine());
m_checkBoxAppendLF->SetValue(options->GetAppendLF());
m_checkBoxHideChangeMarkerMargin->SetValue( options->GetHideChangeMarkerMargin() );
m_checkBoxDisplayFoldMargin->SetValue( options->GetDisplayFoldMargin() );
m_displayBookmarkMargin->SetValue( options->GetDisplayBookmarkMargin() );
const wxString WhitespaceStyle[] = { wxTRANSLATE("Invisible"), wxTRANSLATE("Visible always"), wxTRANSLATE("Visible after indentation"), wxTRANSLATE("Indentation only") };
wxString currentWhitespace;
switch (options->GetShowWhitspaces()) {
case wxSTC_WS_VISIBLEALWAYS:
currentWhitespace = wxT("Visible always");
break;
case wxSTC_WS_VISIBLEAFTERINDENT:
currentWhitespace = wxT("Visible after indentation");
break;
default:
currentWhitespace = wxT("Invisible");
break;
}
m_WSstringManager.AddStrings(sizeof(WhitespaceStyle)/sizeof(wxString), WhitespaceStyle, currentWhitespace, m_whitespaceStyle);
const wxString EOLChoices[] = { wxTRANSLATE("Default"), wxT("Mac (CR)"), wxT("Windows (CRLF)"), wxT("Unix (LF)") };
m_EOLstringManager.AddStrings(sizeof(EOLChoices)/sizeof(wxString), EOLChoices, options->GetEolMode(), m_choiceEOL);
wxArrayString astrEncodings;
wxFontEncoding fontEnc;
int iCurrSelId = 0;
size_t iEncCnt = wxFontMapper::GetSupportedEncodingsCount();
for (size_t i = 0; i < iEncCnt; i++) {
fontEnc = wxFontMapper::GetEncoding(i);
if (wxFONTENCODING_SYSTEM == fontEnc) { // skip system, it is changed to UTF-8 in optionsconfig
continue;
}
astrEncodings.Add(wxFontMapper::GetEncodingName(fontEnc));
if (fontEnc == options->GetFileFontEncoding()) {
iCurrSelId = i;
}
}
m_fileEncoding->Append(astrEncodings);
m_fileEncoding->SetSelection(iCurrSelId);
}
示例15:
LocalOptionsConfig::LocalOptionsConfig(OptionsConfigPtr opts, wxXmlNode* node)
{
// Used for reading local values, which are merged into the passed OptionsConfigPtr only if valid
if(node) {
bool answer;
wxString str;
long l;
if(XmlUtils::ReadBoolIfExists(node, wxT("DisplayFoldMargin"), answer)) { opts->SetDisplayFoldMargin(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("DisplayBookmarkMargin"), answer)) {
opts->SetDisplayBookmarkMargin(answer);
}
if(XmlUtils::ReadBoolIfExists(node, wxT("HighlightCaretLine"), answer)) { opts->SetHighlightCaretLine(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("EditorTrimEmptyLines"), answer)) { opts->SetTrimLine(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("EditorAppendLf"), answer)) { opts->SetAppendLF(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("ShowLineNumber"), answer)) { opts->SetDisplayLineNumbers(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("IndentationGuides"), answer)) {
opts->SetShowIndentationGuidelines(answer);
}
if(XmlUtils::ReadBoolIfExists(node, wxT("IndentUsesTabs"), answer)) { opts->SetIndentUsesTabs(answer); }
if(XmlUtils::ReadBoolIfExists(node, wxT("HideChangeMarkerMargin"), answer)) {
opts->SetHideChangeMarkerMargin(answer);
}
if(XmlUtils::ReadLongIfExists(node, wxT("IndentWidth"), l)) { opts->SetIndentWidth(l); }
if(XmlUtils::ReadLongIfExists(node, wxT("TabWidth"), l)) { opts->SetTabWidth(l); }
if(XmlUtils::ReadLongIfExists(node, wxT("ShowWhitespaces"), l)) { opts->SetShowWhitspaces(l); }
if(XmlUtils::ReadStringIfExists(node, wxT("EOLMode"), str)) { opts->SetEolMode(str); }
if(XmlUtils::ReadStringIfExists(node, wxT("FileFontEncoding"), str)) { opts->SetFileFontEncoding(str); }
}
}