本文整理汇总了C++中OptionsConfigPtr::GetTabWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionsConfigPtr::GetTabWidth方法的具体用法?C++ OptionsConfigPtr::GetTabWidth怎么用?C++ OptionsConfigPtr::GetTabWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionsConfigPtr
的用法示例。
在下文中一共展示了OptionsConfigPtr::GetTabWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: GetOptions
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(opts->GetTabWidth());
if(const_cast<EditorConfig*>(this)->GetLongValue(wxT("EditorTabWidth"), tabWidth)) {
opts->SetTabWidth(tabWidth);
}
return opts;
}
示例3: CreateClass
void WizardsPlugin::CreateClass(const NewClassInfo &info)
{
// Start by finding the best choice for tabs/spaces.
// Use the preference for the target VirtualDir, not the active project, in case the user perversely adds to an inactive one.
OptionsConfigPtr options = EditorConfigST::Get()->GetOptions(); // Globals first
wxString TargetProj = info.virtualDirectory.BeforeFirst(wxT(':'));
if (!TargetProj.empty()) {
LocalWorkspaceST::Get()->GetOptions(options, TargetProj); // Then override with any local ones
}
wxString separator(wxT("\t"));
if (!options->GetIndentUsesTabs()) {
separator = wxString(wxT(' '), wxMax(1, options->GetTabWidth()));
}
wxString macro(info.blockGuard);
if( macro.IsEmpty() ) {
// use the name instead
macro = info.name;
macro.MakeUpper();
macro << (info.hppHeader ? wxT("_HPP") : wxT("_H"));
}
wxString headerExt = (info.hppHeader ? wxT(".hpp") : wxT(".h"));
wxString srcFile;
srcFile << info.path << wxFileName::GetPathSeparator() << info.fileName << wxT(".cpp");
wxString hdrFile;
hdrFile << info.path << wxFileName::GetPathSeparator() << info.fileName << headerExt;
//create cpp + h file
wxString cpp;
wxString header;
//----------------------------------------------------
// header file
//----------------------------------------------------
header << wxT("#ifndef ") << macro << wxT("\n");
header << wxT("#define ") << macro << wxT("\n");
header << wxT("\n");
wxString closeMethod;
if (info.isInline)
closeMethod << wxT('\n') << separator << wxT("{\n") << separator << wxT("}\n");
else
closeMethod = wxT(";\n");
// Add include for base classes
if (info.parents.empty() == false) {
for (size_t i=0; i< info.parents.size(); i++) {
ClassParentInfo pi = info.parents.at(i);
// Include the header name only (no paths)
wxFileName includeFileName(pi.fileName);
header << wxT("#include \"") << includeFileName.GetFullName() << wxT("\" // Base class: ") << pi.name << wxT("\n");
}
header << wxT("\n");
}
// Open namespace
if (!info.namespacesList.IsEmpty()) {
WriteNamespacesDeclaration (info.namespacesList, header);
}
header << wxT("class ") << info.name;
if (info.parents.empty() == false) {
header << wxT(" : ");
for (size_t i=0; i< info.parents.size(); i++) {
ClassParentInfo pi = info.parents.at(i);
header << pi.access << wxT(" ") << pi.name << wxT(", ");
}
header = header.BeforeLast(wxT(','));
}
header << wxT("\n{\n");
if (info.isSingleton) {
header << separator << wxT("static ") << info.name << wxT("* ms_instance;\n\n");
}
if (info.isAssingable == false) {
//declare copy constructor & assingment operator as private
header << wxT("private:\n");
header << separator << info.name << wxT("(const ") << info.name << wxT("& rhs)") << closeMethod;
header << separator << info.name << wxT("& operator=(const ") << info.name << wxT("& rhs)") << closeMethod;
header << wxT("\n");
}
if (info.isSingleton) {
header << wxT("public:\n");
header << separator << wxT("static ") << info.name << wxT("* Instance();\n");
header << separator << wxT("static void Release();\n\n");
header << wxT("private:\n");
header << separator << info.name << wxT("();\n");
if (info.isVirtualDtor) {
header << separator << wxT("virtual ~") << info.name << wxT("();\n\n");
//.........这里部分代码省略.........