Git Product home page Git Product logo

scintillanet.wpf's People

Contributors

stumpii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scintillanet.wpf's Issues

unable to save floating documents or documents in new tab group

I discovered an issue likely pertaining to the docking manager. When you drag a window outside the container (i.e., make it a floating window), it cannot be saved. At this point, the ActiveDocument property in MainWindow.xaml.cs returns null.

Also, when you create a new tab group, you also cannot save documents from there.

I wonder if this is by design?

Style does not seem to apply

Trying to create the control in XAML, I have set the lexer to Cpp but no syntax highlighting seems to occur. Just a generic white textbox.

<sc:ScintillaWPF Content="{Binding value, UpdateSourceTrigger=PropertyChanged}" Height="300" Lexer="Cpp"/>

New file: put focus on new document

When you File | New, I expect a new document to open and be able to start typing in it. As it is, it does open a new document but I have to explicitly put mouse-focus on it (there may be a keyboard way, haven't found it). In NewDocument(), there is doc.IsActive = true;, but I think that only makes it the active document in the document tabs. How would you go about actually focussing the new document so you can start typing right away? I've done quite a bit of research and so far haven't come up with a solution. Just to be clear: I know there is the Focus() method, but in certain circumstances, like this one, it just doesn't do anything.

Consider multi-targetting .NET Core and .NET Framework

Hello,

There is a method incompatibility in ScintillaNET between .NET Framework and .NET Core which
means it needs to be re-targeted if .NET Core needs to be supported (see this issue). As one of my projects using ScintillaNET is also targeting both frameworks, I have gone ahead and created a ScintillaNET fork that supports multi-targeting. It is available here in GitHub and here in NuGet. ScintillaNET.WPF could also support multi-targeting if using this version of ScintillaNET instead.

Now, my project also uses ScintillaNET.WPF, currently as a slightly modified of the project embedded in my solution. However, I was planning to do the same I did with ScintillaNET: fork your repo, make the changes I need, and then release a new NuGet package.

If you are interested in multi-targeting .NET Core and .NET Framework, I could also make the changes I need directly in this repo as pull requests instead.

Regards,
Fernando

Setting focus within a DocumentForm object

Hi,

I am trying to set the logical focus and the keyboard focus within a DocumentForm object in WPF.
This does not seem to work:

       this.Scintilla.Scintilla.Focus ();
       Keyboard.Focus (this.Scintilla);

Thanks!

Unable to set the focus programmatically

Hi!

How can I set the focus to this control programmatically? The .Focus() method is not working, no matters if the control is at root level of the window or inside a tabcontrol, I must click the editor or press TAB key to set the focus manually.

Any suggestion?

<Window x:Class="Scitest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Scitest"
        mc:Ignorable="d"
        xmlns:sn="http://scintillanet.codeplex.com"
        Title="MainWindow" Height="450" Width="800">
    <Grid>

        <sn:ScintillaWPF Margin="253,67,234,157" Name="TestEditor"></sn:ScintillaWPF>
        <Button Name="TestButton" Margin="305,292,272,47" Click="TestButton_Click">Set the Focus!</Button>
    </Grid>
</Window>
private void TestButton_Click(object sender, RoutedEventArgs e)
{
    // Not working
    TestEditor.Focus();
}

NullReferenceException in dockPanel_ActiveContentChanged

This happens fairly often when using the IDE.

File: MainWindow.xaml.cs

Code

        private void dockPanel_ActiveContentChanged(object sender, EventArgs e)
        {
            // Update the main form _text to show the current document
            if (ActiveDocument != null)
            {
                this.Title = string.Format(CultureInfo.CurrentCulture, "{0} - {1}", ActiveDocument.Title, Program.Title);
                MyFindReplace.Scintilla = ActiveDocument.Scintilla.Scintilla;
                ActiveDocument.FindReplace = MyFindReplace; // Exception happens here ActiveDocument is null
            }
            else
                this.Title = Program.Title;
        }

Stack trace

   at SCide.WPF.MainWindow.dockPanel_ActiveContentChanged(Object sender, EventArgs e) in E:\AlsProjects\Spi-o-Matic\solution\SCide.WPF\MainWindow.xaml.cs:line 480
   at Xceed.Wpf.AvalonDock.DockingManager.OnActiveContentChanged(DependencyPropertyChangedEventArgs e)
   at Xceed.Wpf.AvalonDock.DockingManager.OnActiveContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Xceed.Wpf.AvalonDock.DockingManager.OnLayoutRootPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Xceed.Wpf.AvalonDock.Layout.LayoutElement.RaisePropertyChanged(String propertyName)
   at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.InternalSetActiveContent(LayoutContent currentValue, LayoutContent newActiveContent)
   at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.set_ActiveContent(LayoutContent value)
   at Xceed.Wpf.AvalonDock.Layout.LayoutContent.set_IsActive(Boolean value)
   at Xceed.Wpf.AvalonDock.Controls.LayoutDocumentControl.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
   at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
   at System.Windows.Forms.Integration.WindowsFormsHost.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndHost.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Save strips last character

In DocumentForm.xaml.cs, the Save(string filePath) method trims the trailing NULL in line:

bw.Write(scintilla.Text.ToCharArray(), 0, scintilla.Text.Length - 1); // Omit trailing NULL

My experience is that that just strips off the last character. Omitting the -1 gives the desired result.

Key bindings do not work in Scintilla editor

When you press for example Ctrl-S in an editor window, a control character (for Ctrl-S it is [SO]) is added to the text. I expected the document to be saved. When I put the focus outside the editor, it works as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.