Adding custom fields to the footer (line/column bar at the bottom)

SyntaxEditor for WPF Forum

Posted 10 months ago by Andrea
Version: 17.2.0
Avatar

Version=20.1.1.0 (Unsure of year)

How can I add custom data to the horizontal bar at the bottom of the script editor that shows the line number and column?

I think this is considered one of the "margins" (maybe SelectionMargin) but I'm not really sure which, in addition to not being sure how to add a label and data point. I don't seem to be able to access any of the margins from the SyntaxEditor XAML or a handle to the editor's name. 

I want to keep Line Number & Column Number. I just want to add another data point. 

            <syntax:SyntaxEditor Name="m_scriptText" DocumentTextChanged="OnDocumentTextChanged" DocumentTextChanging="OnDocumentTextChanging" Grid.Row="0" Margin="0" AcceptsTab="True" PreviewMouseLeftButtonUp="OnScriptTextPreviewMouseLeftButtonUp"
                                 FontFamily="{Binding FixedWidthFontFamily, Source={x:Static ui:GUIManager.Defaults}}" FontSize="14" ViewSelectionChanged="OnViewSelectionChanged" IsDelimiterHighlightingEnabled="True" CanSplitHorizontally="True"
                                 IsOutliningMarginVisible="True" IsLineNumberMarginVisible="True" IsIndicatorMarginVisible="True" IsRulerMarginVisible="False">
            </syntax:SyntaxEditor>

[Modified 10 months ago]

Comments (2)

Posted 10 months ago by Andrea
Avatar

I just found this in the documentation:

"The SyntaxEditor.ViewMarginFactories property is a collection of IEditorViewMarginFactory objects. By default, it is auto-populated with the DefaultEditorViewMarginFactory, meaning all built-in margins are available. Add additional margin factories to the collection if you wish to add custom margins. A QuickStart is available in the samples that shows how to do this.

Docs

Where could I find these samples?

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you download our WPF Controls installer from our web site, the samples are installed as part of that.  That's the easiest way to get going.

Or you can also find the SyntaxEditor QuickStarts source on GitHub.  The EditorViewMargin* QuickStarts have code related to customizing margins.

[Modified 10 months ago]


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.