void SymmetricRuizEquil ( DistSparseMatrix<Field>& A, DistMultiVec<Base<Field>>& d, Int maxIter, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; const Int n = A.Height(); const Grid& grid = A.Grid(); d.SetGrid( grid ); Ones( d, n, 1 ); DistMultiVec<Real> scales(grid); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns (and rows) // ------------------------------ ColumnMaxNorms( A, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); EntrywiseMap( scales, MakeFunction(SquareRootScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, d ); SymmetricDiagonalSolve( scales, A ); } SetIndent( indent ); }
void SymmetricRuizEquil ( Matrix<F>& A, Matrix<Base<F>>& d, Int maxIter, bool progress ) { DEBUG_CSE typedef Base<F> Real; const Int n = A.Height(); Ones( d, n, 1 ); Matrix<Real> scales; const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns (and rows) // ------------------------------ ColumnMaxNorms( A, scales ); EntrywiseMap( scales, function<Real(Real)>(DampScaling<Real>) ); EntrywiseMap( scales, function<Real(Real)>(SquareRootScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, d ); // TODO(poulson): Replace with SymmetricDiagonalSolve DiagonalSolve( RIGHT, NORMAL, scales, A ); DiagonalSolve( LEFT, NORMAL, scales, A ); } SetIndent( indent ); }
void SymmetricRuizEquil ( DistSparseMatrix<F>& A, DistMultiVec<Base<F>>& d, Int maxIter, bool progress ) { DEBUG_CSE typedef Base<F> Real; const Int n = A.Height(); mpi::Comm comm = A.Comm(); d.SetComm( comm ); Ones( d, n, 1 ); DistMultiVec<Real> scales(comm); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns (and rows) // ------------------------------ ColumnMaxNorms( A, scales ); EntrywiseMap( scales, function<Real(Real)>(DampScaling<Real>) ); EntrywiseMap( scales, function<Real(Real)>(SquareRootScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, d ); SymmetricDiagonalSolve( scales, A ); } SetIndent( indent ); }
/*---------------------------------------------------------------------------*/ void wxSQLEditorBase::Init() { m_FontName = _T("Courier New"); m_FontSize = 10; SetWrapMode(wxSTC_WRAP_NONE); // wxSTC_WRAP_WORD wxSTC_WRAP_NONE SetLexer(wxSTC_LEX_SQL); SetTabWidth(2); SetUseTabs(false); SetTabIndents (true); SetBackSpaceUnIndents (true); SetIndent(2); SetViewEOL(false); SetIndentationGuides(true); SetEOLMode(wxSTC_EOL_LF); SetEdgeColumn(200); SetEdgeMode(wxSTC_EDGE_LINE); // wxSTC_EDGE_NONE wxSTC_EDGE_LINE SetViewWhiteSpace(wxSTC_WS_INVISIBLE); // wxSTC_WS_VISIBLEALWAYS SetMarginType(1, wxSTC_MARGIN_SYMBOL); SetMarginWidth(1, 0); SetKeyWords(0, SQLWordlist1); SetKeyWords(1, SQLWordlist2); SetKeyWords(4, SQLWordlist3); SetKeyWords(5, SQLWordlist4); ReInitAllStyle(); }
void AXMLComment::AppendRawData(VString &pDestination,bool pIndented) const { if (pIndented) SetIndent(pDestination); pDestination.AppendCString("<!--"); pDestination.AppendString(fComment); pDestination.AppendCString("-->"); }
void AXMLCData::AppendRawData(VString &pDestination,bool pIndented) const { if (pIndented) SetIndent(pDestination); pDestination.AppendCString("<![CDATA["); pDestination.AppendString(fCData); pDestination.AppendCString("]]>"); }
CEmblFormatter::CEmblFormatter(void) { SetIndent(string(5, ' ')); //SetFeatIndent(string(21, ' ')); string tmp; m_XX.push_back(Pad("XX", tmp, ePara)); }
void FB_STC::LoadSettings ( ) { FB_Config * Prefs = m_Ide->GetConfig(); Style_STC_FB * Style = &Prefs->Style_FB; // Clear all styles there might be defined StyleClearAll( ); SetLexer( 0 ); // Tab and indenting SetTabWidth ( Prefs->TabSize ); SetUseTabs ( false ); SetTabIndents ( true ); SetBackSpaceUnIndents ( true ); SetIndent ( Prefs->TabSize ); SetIndentationGuides ( Prefs->IndentGuide ); // Right margin SetEdgeMode ( Prefs->RightMargin ? wxSTC_EDGE_LINE: wxSTC_EDGE_NONE ); SetEdgeColumn ( Prefs->EdgeColumn ); // Line and line ending SetEOLMode ( 0 ); SetViewEOL ( Prefs->DisplayEOL ); SetViewWhiteSpace ( Prefs->WhiteSpace ? wxSTC_WS_VISIBLEALWAYS: wxSTC_WS_INVISIBLE ); // Misc CmdKeyClear (wxSTC_KEY_TAB, 0); #define _STYLE(nr) Style->Style[nr] wxFont font ( _STYLE(0).Size, wxMODERN, wxNORMAL, wxNORMAL, false, _STYLE(0).Font ); StyleSetForeground (wxSTC_STYLE_DEFAULT, Prefs->GetClr(_STYLE(0).Face)); StyleSetBackground (wxSTC_STYLE_DEFAULT, Prefs->GetClr(_STYLE(0).Back)); StyleSetFont( wxSTC_STYLE_DEFAULT, font ); StyleSetForeground (0, Prefs->GetClr(_STYLE(0).Face)); StyleSetBackground (0, Prefs->GetClr(_STYLE(0).Back)); StyleSetFont( 0, font ); StyleSetForeground (wxSTC_STYLE_LINENUMBER, Prefs->GetClr(Style->LineNumberFace)); StyleSetBackground (wxSTC_STYLE_LINENUMBER, Prefs->GetClr(Style->LineNumberBack)); StyleSetFont( wxSTC_STYLE_LINENUMBER, font ); SetCaretForeground (Prefs->GetClr(Style->CaretFace)); SetSelForeground(true, Prefs->GetClr(Style->SelectFace)); SetSelBackground(true, Prefs->GetClr(Style->SelectBack)); #undef STYLE int LineNrMargin = TextWidth(wxSTC_STYLE_LINENUMBER, _T("0001")); SetMarginWidth (0, Prefs->LineNumber ? LineNrMargin : 0); SetMarginWidth (1,0); if ( Prefs->CurrentLine ) { SetCaretLineVisible( true ); SetCaretLineBack( Prefs->GetClr( Style->CaretLine ) ); } }
void AXMLElement::AppendRawData(VString &pDestination,bool pIndented) const { AXMLGenericElement *elem; AXMLAttribute *attr; if (pIndented) SetIndent(pDestination); pDestination.AppendCString("<"); pDestination.AppendString(fElementName); // attributs attr = fFirstAttribute; while(attr) { pDestination.AppendCString(" "); attr->AppendRawData(pDestination); attr = attr->fNext; } if (!fFirstChild) { pDestination.AppendCString(" />"); } else { pDestination.AppendCString(">"); // enfants elem = Get_FirstChild(); while (elem) { elem->AppendRawData(pDestination,pIndented); elem = elem->GetNext(); } if (pIndented) SetIndent(pDestination); pDestination.AppendCString("</"); pDestination.AppendString(fElementName); pDestination.AppendCString(">"); } }
void StackedRuizEquil ( DistSparseMatrix<Field>& A, DistSparseMatrix<Field>& B, DistMultiVec<Base<Field>>& dRowA, DistMultiVec<Base<Field>>& dRowB, DistMultiVec<Base<Field>>& dCol, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; const Int mA = A.Height(); const Int mB = B.Height(); const Int n = A.Width(); mpi::Comm comm = A.Comm(); dRowA.SetComm( comm ); dRowB.SetComm( comm ); dCol.SetComm( comm ); Ones( dRowA, mA, 1 ); Ones( dRowB, mB, 1 ); Ones( dCol, n, 1 ); // TODO(poulson): Expose to control structure // For, simply hard-code a small number of iterations const Int maxIter = 4; DistMultiVec<Real> scales(comm), maxAbsValsB(comm); auto& scalesLoc = scales.Matrix(); auto& maxAbsValsBLoc = maxAbsValsB.Matrix(); const Int localHeight = scalesLoc.Height(); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns // ------------------- ColumnMaxNorms( A, scales ); ColumnMaxNorms( B, maxAbsValsB ); for( Int jLoc=0; jLoc<localHeight; ++jLoc ) scalesLoc(jLoc) = Max(scalesLoc(jLoc),maxAbsValsBLoc(jLoc)); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dCol ); DiagonalSolve( RIGHT, NORMAL, scales, A ); DiagonalSolve( RIGHT, NORMAL, scales, B ); // Rescale the rows // ---------------- RowMaxNorms( A, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dRowA ); DiagonalSolve( LEFT, NORMAL, scales, A ); RowMaxNorms( B, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dRowB ); DiagonalSolve( LEFT, NORMAL, scales, B ); } SetIndent( indent ); }
void AXMLDOCTYPE::AppendRawData(VString &pDestination,bool pIndented) const { if (pIndented) SetIndent(pDestination); pDestination.AppendCString("<!DOCTYPE "); pDestination.AppendString(fDOCTYPE); pDestination.AppendCString(">"); }
PG_ListBoxBaseItem::PG_ListBoxBaseItem(PG_Widget* parent, Uint16 height, void* userdata) : PG_Label(parent, PG_Rect(0,0,0,height)) { my_userdata = userdata; my_selected = false; my_hover = false; //my_itemheight = height; if (parent != NULL) { SetIndent(GetParent()->GetIndent()); SetAlignment(GetParent()->GetAlignment()); } }
void RuizEquil ( AbstractDistMatrix<Field>& APre, AbstractDistMatrix<Base<Field>>& dRowPre, AbstractDistMatrix<Base<Field>>& dColPre, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; ElementalProxyCtrl control; control.colConstrain = true; control.rowConstrain = true; control.colAlign = 0; control.rowAlign = 0; DistMatrixReadWriteProxy<Field,Field,MC,MR> AProx( APre, control ); DistMatrixWriteProxy<Real,Real,MC,STAR> dRowProx( dRowPre, control ); DistMatrixWriteProxy<Real,Real,MR,STAR> dColProx( dColPre, control ); auto& A = AProx.Get(); auto& dRow = dRowProx.Get(); auto& dCol = dColProx.Get(); const Int m = A.Height(); const Int n = A.Width(); Ones( dRow, m, 1 ); Ones( dCol, n, 1 ); // TODO(poulson): Expose these as control parameters // For now, simply hard-code the number of iterations const Int maxIter = 4; DistMatrix<Real,MC,STAR> rowScale(A.Grid()); DistMatrix<Real,MR,STAR> colScale(A.Grid()); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns // ------------------- ColumnMaxNorms( A, colScale ); EntrywiseMap( colScale, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, colScale, dCol ); DiagonalSolve( RIGHT, NORMAL, colScale, A ); // Rescale the rows // ---------------- RowMaxNorms( A, rowScale ); EntrywiseMap( rowScale, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, rowScale, dRow ); DiagonalSolve( LEFT, NORMAL, rowScale, A ); } SetIndent( indent ); }
void StackedRuizEquil ( SparseMatrix<Field>& A, SparseMatrix<Field>& B, Matrix<Base<Field>>& dRowA, Matrix<Base<Field>>& dRowB, Matrix<Base<Field>>& dCol, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; const Int mA = A.Height(); const Int mB = B.Height(); const Int n = A.Width(); Ones( dRowA, mA, 1 ); Ones( dRowB, mB, 1 ); Ones( dCol, n, 1 ); // TODO(poulson): Expose these as control parameters // For now, simply hard-code the number of iterations const Int maxIter = 4; Matrix<Real> scales, maxAbsValsB; const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns // ------------------- ColumnMaxNorms( A, scales ); ColumnMaxNorms( B, maxAbsValsB ); for( Int j=0; j<n; ++j ) scales(j) = Max(scales(j),maxAbsValsB(j)); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dCol ); DiagonalSolve( RIGHT, NORMAL, scales, A ); DiagonalSolve( RIGHT, NORMAL, scales, B ); // Rescale the rows // ---------------- RowMaxNorms( A, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dRowA ); DiagonalSolve( LEFT, NORMAL, scales, A ); RowMaxNorms( B, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dRowB ); DiagonalSolve( LEFT, NORMAL, scales, B ); } SetIndent( indent ); }
void RuizEquil ( DistSparseMatrix<Field>& A, DistMultiVec<Base<Field>>& dRow, DistMultiVec<Base<Field>>& dCol, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; const Int m = A.Height(); const Int n = A.Width(); mpi::Comm comm = A.Comm(); dRow.SetComm( comm ); dCol.SetComm( comm ); Ones( dRow, m, 1 ); Ones( dCol, n, 1 ); // TODO(poulson): Expose to control structure // For, simply hard-code a small number of iterations const Int maxIter = 4; DistMultiVec<Real> scales(comm); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns // ------------------- ColumnMaxNorms( A, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dCol ); DiagonalSolve( RIGHT, NORMAL, scales, A ); // Rescale the rows // ---------------- RowMaxNorms( A, scales ); EntrywiseMap( scales, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, dRow ); DiagonalSolve( LEFT, NORMAL, scales, A ); } SetIndent( indent ); }
void IWnd_stc::_DoUpdateStyle() { BitFlags& flags(param.flags); SetTabWidth (param.wdtab); SetUseTabs (true); SetTabIndents (true); SetBackSpaceUnIndents (true); SetIndent (flags.get(FLAG_INDENT)? param.wdtab: 0); SetViewEOL (flags.get(FLAG_SHOWEOL)); SetIndentationGuides (flags.get(FLAG_INDENTGUIDE)); SetEdgeColumn (80); SetEdgeMode (flags.get(FLAG_LONGLINE)?wxSTC_EDGE_LINE: wxSTC_EDGE_NONE); SetViewWhiteSpace (flags.get(FLAG_WHITESPACE)?wxSTC_WS_VISIBLEALWAYS: wxSTC_WS_INVISIBLE); SetOvertype (flags.get(FLAG_OVERTYPE)); SetReadOnly (flags.get(FLAG_READONLY)); SetWrapMode (flags.get(FLAG_WRAPMODE)?wxSTC_WRAP_WORD: wxSTC_WRAP_NONE); UpdateMarginLineNumWidth(true); }
void CodeEdit::SetEditorSettings(const EditorSettings& settings) { m_indentationSize = settings.GetIndentSize(); SetIndent(m_indentationSize); SetTabWidth(m_indentationSize); bool useTabs = settings.GetUseTabs(); bool showWhiteSpace = settings.GetShowWhiteSpace(); SetUseTabs(useTabs); SetTabIndents(useTabs); SetBackSpaceUnIndents(useTabs); SetViewWhiteSpace(showWhiteSpace); SetMultipleSelection(true); SetAdditionalSelectionTyping(true); SetMultiPaste(1); SetVirtualSpaceOptions(1); if (settings.GetShowLineNumbers()) { // Figure out how wide the margin needs to be do display // the most number of linqes we'd reasonbly have. int marginSize = TextWidth(wxSTC_STYLE_LINENUMBER, "_99999"); SetMarginWidth(0, marginSize); SetMarginType(0,wxSTC_MARGIN_NUMBER); } else { SetMarginWidth(0, 0); } m_enableAutoComplete = settings.GetEnableAutoComplete(); }
void SymmetricRuizEquil ( ElementalMatrix<F>& APre, ElementalMatrix<Base<F>>& dPre, Int maxIter, bool progress ) { DEBUG_CSE typedef Base<F> Real; ElementalProxyCtrl control; control.colConstrain = true; control.rowConstrain = true; control.colAlign = 0; control.rowAlign = 0; DistMatrixReadWriteProxy<F,F,MC,MR> AProx( APre, control ); DistMatrixWriteProxy<Real,Real,MC,STAR> dProx( dPre, control ); auto& A = AProx.Get(); auto& d = dProx.Get(); const Int n = A.Height(); Ones( d, n, 1 ); DistMatrix<Real,MR,STAR> scales(A.Grid()); const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns (and rows) // ------------------------------ ColumnMaxNorms( A, scales ); EntrywiseMap( scales, function<Real(Real)>(DampScaling<Real>) ); EntrywiseMap( scales, function<Real(Real)>(SquareRootScaling<Real>) ); DiagonalScale( LEFT, NORMAL, scales, d ); // TODO: Replace with SymmetricDiagonalSolve DiagonalSolve( RIGHT, NORMAL, scales, A ); DiagonalSolve( LEFT, NORMAL, scales, A ); } SetIndent( indent ); }
void RuizEquil ( Matrix<Field>& A, Matrix<Base<Field>>& dRow, Matrix<Base<Field>>& dCol, bool progress ) { EL_DEBUG_CSE typedef Base<Field> Real; const Int m = A.Height(); const Int n = A.Width(); Ones( dRow, m, 1 ); Ones( dCol, n, 1 ); // TODO(poulson): Expose these as control parameters // For now, simply hard-code the number of iterations const Int maxIter = 4; Matrix<Real> rowScale, colScale; const Int indent = PushIndent(); for( Int iter=0; iter<maxIter; ++iter ) { // Rescale the columns // ------------------- ColumnMaxNorms( A, colScale ); EntrywiseMap( colScale, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, colScale, dCol ); DiagonalSolve( RIGHT, NORMAL, colScale, A ); // Rescale the rows // ---------------- RowMaxNorms( A, rowScale ); EntrywiseMap( rowScale, MakeFunction(DampScaling<Real>) ); DiagonalScale( LEFT, NORMAL, rowScale, dRow ); DiagonalSolve( LEFT, NORMAL, rowScale, A ); } SetIndent( indent ); }
bool Edit::InitializePrefs (const wxString &name) { // initialize styles StyleClearAll(); LanguageInfo const* curInfo = NULL; // determine language bool found = false; int languageNr; for (languageNr = 0; languageNr < g_LanguagePrefsSize; languageNr++) { curInfo = &g_LanguagePrefs [languageNr]; if (curInfo->name == name) { found = true; break; } } if (!found) return false; // set lexer and language SetLexer (curInfo->lexer); m_language = curInfo; // set margin for line numbers SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER); StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); SetMarginWidth (m_LineNrID, 0); // start out not visible // annotations style StyleSetBackground(ANNOTATION_STYLE, wxColour(244, 220, 220)); StyleSetForeground(ANNOTATION_STYLE, *wxBLACK); StyleSetSizeFractional(ANNOTATION_STYLE, (StyleGetSizeFractional(wxSTC_STYLE_DEFAULT)*4)/5); // default fonts for all styles! int Nr; for (Nr = 0; Nr < wxSTC_STYLE_LASTPREDEFINED; Nr++) { wxFont font(wxFontInfo(10).Family(wxFONTFAMILY_MODERN)); StyleSetFont (Nr, font); } // set common styles StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY"))); StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); // initialize settings if (g_CommonPrefs.syntaxEnable) { int keywordnr = 0; for (Nr = 0; Nr < STYLE_TYPES_COUNT; Nr++) { if (curInfo->styles[Nr].type == -1) continue; const StyleInfo &curType = g_StylePrefs [curInfo->styles[Nr].type]; wxFont font(wxFontInfo(curType.fontsize) .Family(wxFONTFAMILY_MODERN) .FaceName(curType.fontname)); StyleSetFont (Nr, font); if (curType.foreground) { StyleSetForeground (Nr, wxColour (curType.foreground)); } if (curType.background) { StyleSetBackground (Nr, wxColour (curType.background)); } StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0); StyleSetItalic (Nr, (curType.fontstyle & mySTC_STYLE_ITALIC) > 0); StyleSetUnderline (Nr, (curType.fontstyle & mySTC_STYLE_UNDERL) > 0); StyleSetVisible (Nr, (curType.fontstyle & mySTC_STYLE_HIDDEN) == 0); StyleSetCase (Nr, curType.lettercase); const char *pwords = curInfo->styles[Nr].words; if (pwords) { SetKeyWords (keywordnr, pwords); keywordnr += 1; } } } // set margin as unused SetMarginType (m_DividerID, wxSTC_MARGIN_SYMBOL); SetMarginWidth (m_DividerID, 0); SetMarginSensitive (m_DividerID, false); // folding SetMarginType (m_FoldingID, wxSTC_MARGIN_SYMBOL); SetMarginMask (m_FoldingID, wxSTC_MASK_FOLDERS); StyleSetBackground (m_FoldingID, *wxWHITE); SetMarginWidth (m_FoldingID, 0); SetMarginSensitive (m_FoldingID, false); if (g_CommonPrefs.foldEnable) { SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0); SetMarginSensitive (m_FoldingID, curInfo->folds != 0); SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.comment"), (curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.compact"), (curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.preprocessor"), (curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.html"), (curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.html.preprocessor"), (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.comment.python"), (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0")); SetProperty (wxT("fold.quotes.python"), (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0")); } SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED); // set spaces and indentation SetTabWidth (4); SetUseTabs (false); SetTabIndents (true); SetBackSpaceUnIndents (true); SetIndent (g_CommonPrefs.indentEnable? 4: 0); // others SetViewEOL (g_CommonPrefs.displayEOLEnable); SetIndentationGuides (g_CommonPrefs.indentGuideEnable); SetEdgeColumn (80); SetEdgeMode (g_CommonPrefs.longLineOnEnable? wxSTC_EDGE_LINE: wxSTC_EDGE_NONE); SetViewWhiteSpace (g_CommonPrefs.whiteSpaceEnable? wxSTC_WS_VISIBLEALWAYS: wxSTC_WS_INVISIBLE); SetOvertype (g_CommonPrefs.overTypeInitial); SetReadOnly (g_CommonPrefs.readOnlyInitial); SetWrapMode (g_CommonPrefs.wrapModeInitial? wxSTC_WRAP_WORD: wxSTC_WRAP_NONE); return true; }
void ScriptEditCtrl::Impl::PreSubclassWindow() { self_->m_hWnd = m_hWnd; // expose HWND SetupDirectAccess(); // If we are running as Unicode, then use the UTF8 codepage #ifdef _UNICODE SetCodePage(SC_CP_UTF8); #endif SetLexer(SCLEX_LUA); StyleSetFont(STYLE_DEFAULT, "Lucida Console"); StyleSetSize(STYLE_DEFAULT, 10); SetKeyWords(0, LuaKeywords); SetKeyWords(1, LuaFunctions); if (enable_input_attribs_) SetKeyWords(2, LuaUser); SetKeyWords(3, ConcatAttributes().c_str()); COLORREF comment= RGB(0,128,128); COLORREF string= RGB(128,128,0); StyleSetFore(SCE_LUA_COMMENT, comment); StyleSetFore(SCE_LUA_COMMENTLINE, comment); StyleSetFore(SCE_LUA_COMMENTDOC, comment); StyleSetFore(SCE_LUA_NUMBER, RGB(0,0,255)); StyleSetFore(SCE_LUA_WORD, RGB(34,78,160)); // keywords StyleSetFore(SCE_LUA_STRING, string); StyleSetFore(SCE_LUA_CHARACTER, string); StyleSetFore(SCE_LUA_LITERALSTRING, string); StyleSetFore(SCE_LUA_WORD2, RGB(53,113,202)); // functions StyleSetFore(SCE_LUA_WORD3, RGB(124,37,203)); // test & number StyleSetBack(SCE_LUA_WORD3, CalcColor(::GetSysColor(COLOR_WINDOW), RGB(0,0,255), 0.95f)); StyleSetFore(SCE_LUA_WORD4, RGB(164,97,49)); // todo: attributes StyleSetFont(SCE_LUA_WORD, "Lucida Console"); StyleSetSize(SCE_LUA_WORD, 10); StyleSetBold(SCE_LUA_WORD, true); //#define SCE_LUA_PREPROCESSOR 9 //#define SCE_LUA_OPERATOR 10 //#define SCE_LUA_IDENTIFIER 11 //#define SCE_LUA_STRINGEOL 12 //#define SCE_LUA_WORD2 13 //#define SCE_LUA_WORD3 14 //#define SCE_LUA_WORD4 15 //#define SCE_LUA_WORD5 16 //#define SCE_LUA_WORD6 17 //#define SCE_LUA_WORD7 18 //#define SCE_LUA_WORD8 19 Colorize(0, -1); //MarkerDefine(MARKER_POINTER, SC_MARK_ARROW); //MarkerSetBack(MARKER_POINTER, RGB(255,255,0)); //MarkerDefine(MARKER_BREAKPOINT, SC_MARK_ROUNDRECT); //MarkerSetBack(MARKER_BREAKPOINT, RGB(0,0,255)); //MarkerDefine(MARKER_ERROR, SC_MARK_ARROW); //MarkerSetBack(MARKER_ERROR, RGB(255,0,0)); int width= 0; SetMarginWidthN(1, width); SetScrollWidthTracking(true); SetScrollWidth(1); SetWrapMode(SC_WRAP_WORD); SetWrapVisualFlags(SC_WRAPVISUALFLAG_END); SetSelBack(true, CalcShade(::GetSysColor(COLOR_HIGHLIGHT), 50.0f)); SetTabWidth(4); SetIndent(4); DWORD pixels= 1; ::SystemParametersInfo(SPI_GETCARETWIDTH, 0, &pixels, 0); SetCaretWidth(pixels); // hwnd is attached, but message processing is not working yet, we are not yet subclassed, // so postpone this WM_NCCALCSIZE call: PostMessage(WM_APP+1234); }
PythonCodeCtrl::PythonCodeCtrl(wxWindow *parent, PythonInterpCtrl *py) : cbStyledTextCtrl(parent, wxID_ANY) { m_pyctrl = py; EditorManager *em = Manager::Get()->GetEditorManager(); // Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(PythonCodeCtrl::OnUserInput)); ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("editor")); //MOST OF THIS STUFF IS TAKEN FROM CB EDITOR wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL); wxString fontstring = mgr->Read(_T("/font"), wxEmptyString); if (!fontstring.IsEmpty()) { wxNativeFontInfo nfi; nfi.FromString(fontstring); font.SetNativeFontInfo(nfi); } SetMouseDwellTime(1000); SetScrollWidthTracking(true); SetScrollWidth(5); //Hides horizontal scrollbar if text doesn't exceed the window width int caretStyle = mgr->ReadInt(_T("/caret/style"), wxSCI_CARETSTYLE_LINE); SetCaretStyle(caretStyle); if (caretStyle == wxSCI_CARETSTYLE_LINE) SetCaretWidth(mgr->ReadInt(_T("/caret/width"), 1)); else SetCaretWidth(1); ColourManager *colours = Manager::Get()->GetColourManager(); SetCaretForeground(colours->GetColour(wxT("editor_caret"))); SetCaretPeriod(mgr->ReadInt(_T("/caret/period"), 500)); SetCaretLineVisible(mgr->ReadBool(_T("/highlight_caret_line"), false)); SetCaretLineBackground( Manager::Get()->GetConfigManager(_T("editor"))->ReadColour(_T("/highlight_caret_line_colour"), wxColour(0xFF, 0xFF, 0x00))); SetFoldMarginColour(true, colours->GetColour(wxT("editor_margin_chrome"))); SetFoldMarginHiColour(true, colours->GetColour(wxT("editor_margin_chrome_highlight"))); // setup for "CamelCase selection" if (mgr->ReadBool(_T("/camel_case"), false)) { // consider CamelCase for both: cursor movement with CTRL and selection with CTRL+SHIFT: CmdKeyAssign(wxSCI_KEY_LEFT, wxSCI_SCMOD_CTRL, wxSCI_CMD_WORDPARTLEFT); CmdKeyAssign(wxSCI_KEY_RIGHT, wxSCI_SCMOD_CTRL, wxSCI_CMD_WORDPARTRIGHT); CmdKeyAssign(wxSCI_KEY_LEFT, wxSCI_SCMOD_CTRL|wxSCI_SCMOD_SHIFT, wxSCI_CMD_WORDPARTLEFTEXTEND); CmdKeyAssign(wxSCI_KEY_RIGHT, wxSCI_SCMOD_CTRL|wxSCI_SCMOD_SHIFT, wxSCI_CMD_WORDPARTRIGHTEXTEND); } else // else set default "none CamelCase" key behavior (also default scintilla behaviour, see scintilla docs) { CmdKeyAssign(wxSCI_KEY_LEFT, wxSCI_SCMOD_CTRL, wxSCI_CMD_WORDLEFT); CmdKeyAssign(wxSCI_KEY_RIGHT, wxSCI_SCMOD_CTRL, wxSCI_CMD_WORDRIGHT); CmdKeyAssign(wxSCI_KEY_LEFT, wxSCI_SCMOD_CTRL|wxSCI_SCMOD_SHIFT, wxSCI_CMD_WORDLEFTEXTEND); CmdKeyAssign(wxSCI_KEY_RIGHT, wxSCI_SCMOD_CTRL|wxSCI_SCMOD_SHIFT, wxSCI_CMD_WORDRIGHTEXTEND); } SetUseTabs(mgr->ReadBool(_T("/use_tab"), false)); SetIndentationGuides(mgr->ReadBool(_T("/show_indent_guides"), false)?wxSCI_IV_LOOKBOTH:wxSCI_IV_NONE); SetTabIndents(mgr->ReadBool(_T("/tab_indents"), true)); SetBackSpaceUnIndents(mgr->ReadBool(_T("/backspace_unindents"), true)); SetWrapMode(mgr->ReadBool(_T("/word_wrap"), false)); if (mgr->ReadBool(_T("/word_wrap_style_home_end"), true)) { // in word wrap mode, home/end keys goto the wrap point if not already there, // otherwise to the start/end of the entire line. // alt+home/end go to start/end of the entire line. // in unwrapped mode, there is no difference between home/end and alt+home/end CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_NORM, wxSCI_CMD_LINEENDWRAP); CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_ALT, wxSCI_CMD_LINEEND); CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_SHIFT, wxSCI_CMD_LINEENDWRAPEXTEND); CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT, wxSCI_CMD_LINEENDEXTEND); // if user wants "Home" key to set cursor to the very beginning of line if (mgr->ReadBool(_T("/simplified_home"), false)) { CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_NORM,wxSCI_CMD_HOMEWRAP); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_ALT,wxSCI_CMD_HOME); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT,wxSCI_CMD_HOMEWRAPEXTEND); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT,wxSCI_CMD_HOMEEXTEND); } else // else set default "Home" key behavior { CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_NORM,wxSCI_CMD_VCHOMEWRAP); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_ALT,wxSCI_CMD_VCHOME); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT,wxSCI_CMD_VCHOMEWRAPEXTEND); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT,wxSCI_CMD_VCHOMEEXTEND); } } else { // in word wrap mode, home/end keys goto start/end of the entire line. alt+home/end goes to wrap points CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_ALT, wxSCI_CMD_LINEENDWRAP); CmdKeyAssign(wxSCI_KEY_END, wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT, wxSCI_CMD_LINEENDWRAPEXTEND); // if user wants "Home" key to set cursor to the very beginning of line if (mgr->ReadBool(_T("/simplified_home"), false)) { CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_ALT,wxSCI_CMD_HOMEWRAP); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT,wxSCI_CMD_HOMEWRAPEXTEND); } else // else set default "Home" key behavior { CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_ALT,wxSCI_CMD_VCHOMEWRAP); CmdKeyAssign(wxSCI_KEY_HOME,wxSCI_SCMOD_SHIFT|wxSCI_SCMOD_ALT,wxSCI_CMD_VCHOMEWRAPEXTEND); } } SetViewEOL(mgr->ReadBool(_T("/show_eol"), false)); SetViewWhiteSpace(mgr->ReadInt(_T("/view_whitespace"), 0)); // gutter SetEdgeMode(mgr->ReadInt(_T("/gutter/mode"), 0)); SetEdgeColour(Manager::Get()->GetColourManager()->GetColour(wxT("editor_gutter"))); SetEdgeColumn(mgr->ReadInt(_T("/gutter/column"), 80)); StyleSetFont(wxSCI_STYLE_DEFAULT, font); StyleClearAll(); SetTabWidth(mgr->ReadInt(_T("/tab_size"), 4)); SetIndent(mgr->ReadInt(_T("/tab_size"), 4)); //NEEDED FOR AUTO INDENTATION (NOT IN CB EDITOR) em->GetColourSet()->Apply(_("Python"),this); }
void wxHtmlContainerCell::RemoveExtraSpacing(bool top, bool bottom) { if ( top ) SetIndent(0, wxHTML_INDENT_TOP); if ( bottom ) SetIndent(0, wxHTML_INDENT_BOTTOM); if ( m_Cells ) { wxHtmlCell *c; wxHtmlContainerCell *cont; if ( top ) { for ( c = m_Cells; c; c = c->GetNext() ) { if ( c->IsTerminalCell() ) { if ( !c->IsFormattingCell() ) break; } else { cont = (wxHtmlContainerCell*)c; if ( IsEmptyContainer(cont) ) { cont->SetIndent(0, wxHTML_INDENT_VERTICAL); } else { cont->RemoveExtraSpacing(true, false); break; } } } } if ( bottom ) { wxArrayPtrVoid arr; for ( c = m_Cells; c; c = c->GetNext() ) arr.Add((void*)c); for ( int i = arr.GetCount() - 1; i >= 0; i--) { c = (wxHtmlCell*)arr[i]; if ( c->IsTerminalCell() ) { if ( !c->IsFormattingCell() ) break; } else { cont = (wxHtmlContainerCell*)c; if ( IsEmptyContainer(cont) ) { cont->SetIndent(0, wxHTML_INDENT_VERTICAL); } else { cont->RemoveExtraSpacing(false, true); break; } } } } } }
CodeEditor::CodeEditor(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style) : wxScintilla (parent, id, pos, size, style) { mFileName = _T(""); //m_language = NULL; mLineNumID = 0; mLineNumMargin = TextWidth(wxSCI_STYLE_LINENUMBER, _T("99999")); mFoldingID = 1; mFoldingMargin = 16; mDividerID = 1; SetProperty(wxT("fold"), wxT("1")); SetFoldFlags(16); SetMarginType(mFoldingID, wxSCI_MARGIN_SYMBOL); SetMarginMask(mFoldingID, wxSCI_MASK_FOLDERS); SetMarginSensitive(mFoldingID, true); SetMarginWidth(mFoldingID, mFoldingMargin); MarkerDefine(wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS); MarkerSetForeground(wxSCI_MARKNUM_FOLDEROPEN, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDEROPEN, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS); MarkerSetForeground(wxSCI_MARKNUM_FOLDER, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDER, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_VLINE); MarkerSetForeground(wxSCI_MARKNUM_FOLDERSUB, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDERSUB, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_LCORNER); MarkerSetForeground(wxSCI_MARKNUM_FOLDERTAIL, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDERTAIL, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_BOXPLUSCONNECTED); MarkerSetForeground(wxSCI_MARKNUM_FOLDEREND, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDEREND, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_BOXMINUSCONNECTED); MarkerSetForeground(wxSCI_MARKNUM_FOLDEROPENMID, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDEROPENMID, wxColour(0x80, 0x80, 0x80)); MarkerDefine(wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_TCORNER); MarkerSetForeground(wxSCI_MARKNUM_FOLDERMIDTAIL, wxColour(0xff, 0xff, 0xff)); MarkerSetBackground(wxSCI_MARKNUM_FOLDERMIDTAIL, wxColour(0x80, 0x80, 0x80)); // Set defaults, these should eventually be set via user prefs SetViewEOL(false); SetIndentationGuides(false); SetMarginWidth(mLineNumID, mLineNumMargin); //SetMarginWidth(mFoldingID, mFoldingMargin); //SetMarginSensitive(mFoldingID, true); SetEdgeMode(wxSCI_EDGE_LINE); //SetViewWhiteSpace(wxSCI_WS_VISIBLEALWAYS); SetOvertype(false); SetReadOnly(false); SetWrapMode(wxSCI_WRAP_NONE); wxFont font(10, wxTELETYPE, wxNORMAL, wxNORMAL); StyleSetFont(wxSCI_STYLE_DEFAULT, font); StyleSetForeground(wxSCI_STYLE_DEFAULT, wxColour(wxT("BLACK"))); StyleSetBackground(wxSCI_STYLE_DEFAULT, wxColour(wxT("WHITE"))); StyleSetForeground(wxSCI_STYLE_LINENUMBER, wxColour(wxT("DARK BLUE"))); StyleSetBackground(wxSCI_STYLE_LINENUMBER, wxColour(wxT("WHITE"))); StyleSetForeground(wxSCI_STYLE_INDENTGUIDE, wxColour(wxT("DARK GREY"))); StyleSetBold(wxSCI_STYLE_BRACELIGHT, true); //InitializePrefs(DEFAULT_LANGUAGE); SetTabWidth(4); SetUseTabs(false); SetTabIndents(true); SetBackSpaceUnIndents(true); SetIndent(4); // Set visibility SetVisiblePolicy(wxSCI_VISIBLE_STRICT | wxSCI_VISIBLE_SLOP, 1); SetXCaretPolicy(wxSCI_CARET_EVEN | wxSCI_VISIBLE_STRICT | wxSCI_CARET_SLOP, 1); SetYCaretPolicy(wxSCI_CARET_EVEN | wxSCI_VISIBLE_STRICT | wxSCI_CARET_SLOP, 1); SetCaretLineVisible(true); SetCaretLineBackground(wxColour(225, 235, 224)); // Markers //MarkerDefine(wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS); //MarkerSetBackground(wxSCI_MARKNUM_FOLDER, wxColour(_T("BLACK"))); //MarkerSetForeground(wxSCI_MARKNUM_FOLDER, wxColour(_T("WHITE"))); //MarkerDefine(wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS); //MarkerSetBackground(wxSCI_MARKNUM_FOLDEROPEN, wxColour(_T("BLACK"))); //MarkerSetForeground(wxSCI_MARKNUM_FOLDEROPEN, wxColour(_T("WHITE"))); //MarkerDefine(wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_EMPTY); //MarkerDefine(wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_SHORTARROW); //MarkerDefine(wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_ARROWDOWN); //MarkerDefine(wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_EMPTY); //MarkerDefine(wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_EMPTY); // Clear wrong default keys #if !defined(__WXGTK__) //CmdKeyClear(wxSCI_KEY_TAB, 0); CmdKeyClear(wxSCI_KEY_TAB, wxSCI_SCMOD_SHIFT); #endif CmdKeyClear('A', wxSCI_SCMOD_CTRL); #if !defined(__WXGTK__) CmdKeyClear('C', wxSCI_SCMOD_CTRL); #endif CmdKeyClear('D', wxSCI_SCMOD_CTRL); CmdKeyClear('D', wxSCI_SCMOD_SHIFT | wxSCI_SCMOD_CTRL); CmdKeyClear('F', wxSCI_SCMOD_ALT | wxSCI_SCMOD_CTRL); CmdKeyClear('L', wxSCI_SCMOD_CTRL); CmdKeyClear('L', wxSCI_SCMOD_SHIFT | wxSCI_SCMOD_CTRL); CmdKeyClear('T', wxSCI_SCMOD_CTRL); CmdKeyClear('T', wxSCI_SCMOD_SHIFT | wxSCI_SCMOD_CTRL); CmdKeyClear('U', wxSCI_SCMOD_CTRL); CmdKeyClear('U', wxSCI_SCMOD_SHIFT | wxSCI_SCMOD_CTRL); #if !defined(__WXGTK__) CmdKeyClear('V', wxSCI_SCMOD_CTRL); CmdKeyClear('X', wxSCI_SCMOD_CTRL); #endif CmdKeyClear('Y', wxSCI_SCMOD_CTRL); #if !defined(__WXGTK__) CmdKeyClear('Z', wxSCI_SCMOD_CTRL); #endif UsePopUp(0); SetLayoutCache(wxSCI_CACHE_PAGE); SetBufferedDraw(1); }
virtual void Layout(int w) { // Reset top indentation, fixes <li><p> SetIndent(0, wxHTML_INDENT_TOP); wxHtmlContainerCell::Layout(w); }
/*---------------------------------------------------------------------------*/ void wxSQLEditor::InitStyle() { SetDefaultFont(wxGetApp().GetStyleFontName(), wxGetApp().GetStyleFontSize()); SetEdgeMode(wxGetApp().GetEdgeLineVisible() ? wxSTC_EDGE_LINE : wxSTC_EDGE_NONE); SetDefaultStyle(wxGetApp().GetStyleFontBold(STYLE_DEFAULT), wxGetApp().GetStyleFontItalic(STYLE_DEFAULT), wxGetApp().GetStyleFontUnderline(STYLE_DEFAULT), wxGetApp().GetStyleCase(STYLE_DEFAULT), wxGetApp().GetStyleColourFore(STYLE_DEFAULT), wxGetApp().GetStyleColourBack(STYLE_DEFAULT)); SetCommentStyle(wxGetApp().GetStyleFontBold(STYLE_COMMENT), wxGetApp().GetStyleFontItalic(STYLE_COMMENT), wxGetApp().GetStyleFontUnderline(STYLE_COMMENT), wxGetApp().GetStyleCase(STYLE_COMMENT), wxGetApp().GetStyleColourFore(STYLE_COMMENT), wxGetApp().GetStyleColourBack(STYLE_COMMENT)); SetCommentLineStyle(wxGetApp().GetStyleFontBold(STYLE_COMMENTLINE), wxGetApp().GetStyleFontItalic(STYLE_COMMENTLINE), wxGetApp().GetStyleFontUnderline(STYLE_COMMENTLINE), wxGetApp().GetStyleCase(STYLE_COMMENTLINE), wxGetApp().GetStyleColourFore(STYLE_COMMENTLINE), wxGetApp().GetStyleColourBack(STYLE_COMMENTLINE)); SetNumberStyle(wxGetApp().GetStyleFontBold(STYLE_NUMBER), wxGetApp().GetStyleFontItalic(STYLE_NUMBER), wxGetApp().GetStyleFontUnderline(STYLE_NUMBER), wxGetApp().GetStyleCase(STYLE_NUMBER), wxGetApp().GetStyleColourFore(STYLE_NUMBER), wxGetApp().GetStyleColourBack(STYLE_NUMBER)); SetKeyWordStyle(1, wxGetApp().GetStyleFontBold(STYLE_WORD1), wxGetApp().GetStyleFontItalic(STYLE_WORD1), wxGetApp().GetStyleFontUnderline(STYLE_WORD1), wxGetApp().GetStyleCase(STYLE_WORD1), wxGetApp().GetStyleColourFore(STYLE_WORD1), wxGetApp().GetStyleColourBack(STYLE_WORD1)); SetStringStyle(wxGetApp().GetStyleFontBold(STYLE_STRING), wxGetApp().GetStyleFontItalic(STYLE_STRING), wxGetApp().GetStyleFontUnderline(STYLE_STRING), wxGetApp().GetStyleCase(STYLE_STRING), wxGetApp().GetStyleColourFore(STYLE_STRING), wxGetApp().GetStyleColourBack(STYLE_STRING)); SetCharacterStyle(wxGetApp().GetStyleFontBold(STYLE_CHARACTER), wxGetApp().GetStyleFontItalic(STYLE_CHARACTER), wxGetApp().GetStyleFontUnderline(STYLE_CHARACTER), wxGetApp().GetStyleCase(STYLE_CHARACTER), wxGetApp().GetStyleColourFore(STYLE_CHARACTER), wxGetApp().GetStyleColourBack(STYLE_CHARACTER)); SetOperatorStyle(wxGetApp().GetStyleFontBold(STYLE_OPERATOR), wxGetApp().GetStyleFontItalic(STYLE_OPERATOR), wxGetApp().GetStyleFontUnderline(STYLE_OPERATOR), wxGetApp().GetStyleCase(STYLE_OPERATOR), wxGetApp().GetStyleColourFore(STYLE_OPERATOR), wxGetApp().GetStyleColourBack(STYLE_OPERATOR)); SetIdentifierStyle(wxGetApp().GetStyleFontBold(STYLE_IDENTIFIER), wxGetApp().GetStyleFontItalic(STYLE_IDENTIFIER), wxGetApp().GetStyleFontUnderline(STYLE_IDENTIFIER), wxGetApp().GetStyleCase(STYLE_IDENTIFIER), wxGetApp().GetStyleColourFore(STYLE_IDENTIFIER), wxGetApp().GetStyleColourBack(STYLE_IDENTIFIER)); SetKeyWordStyle(2, wxGetApp().GetStyleFontBold(STYLE_WORD2), wxGetApp().GetStyleFontItalic(STYLE_WORD2), wxGetApp().GetStyleFontUnderline(STYLE_WORD2), wxGetApp().GetStyleCase(STYLE_WORD2), wxGetApp().GetStyleColourFore(STYLE_WORD2), wxGetApp().GetStyleColourBack(STYLE_WORD2)); SetKeyWordStyle(3, wxGetApp().GetStyleFontBold(STYLE_WORD3), wxGetApp().GetStyleFontItalic(STYLE_WORD3), wxGetApp().GetStyleFontUnderline(STYLE_WORD3), wxGetApp().GetStyleCase(STYLE_WORD3), wxGetApp().GetStyleColourFore(STYLE_WORD3), wxGetApp().GetStyleColourBack(STYLE_WORD3)); SetKeyWordStyle(4, wxGetApp().GetStyleFontBold(STYLE_WORD4), wxGetApp().GetStyleFontItalic(STYLE_WORD4), wxGetApp().GetStyleFontUnderline(STYLE_WORD4), wxGetApp().GetStyleCase(STYLE_WORD4), wxGetApp().GetStyleColourFore(STYLE_WORD4), wxGetApp().GetStyleColourBack(STYLE_WORD4)); SetTabWidth(wxGetApp().GetStyleTabWidth()); SetUseTabs(wxGetApp().GetStyleUseTab()); SetTabIndents(wxGetApp().GetStyleTabIndent()); SetBackSpaceUnIndents(wxGetApp().GetStyleBackspaceUnindent()); SetIndent(wxGetApp().GetStyleIndentWidth()); SetLineNumberMarginStyle(wxGetApp().GetStyleShowLineNumber(), wxGetApp().GetForeLineNumber(), wxGetApp().GetBackLineNumber()); }
void AXMLText::AppendRawData(VString &pDestination,bool pIndented) const { if (pIndented) SetIndent(pDestination); pDestination.AppendString(fText); }
EXPORT_C void CTLogger::UpdateIndent(TInt aInc) { TInt newIndent = Indent() + aInc; ASSERT(newIndent >= 0); SetIndent(newIndent); }