SyntaxEditor hosted in PopupButton.PopupContentTemplate can't enter Chinese characters

SyntaxEditor for WPF Forum

Posted 9 months ago by Joey Lu
Version: 23.1.2
Avatar

Hello,

We have a scenario where we are using SyntaxEditor controls as item hosted in PopupContentTemplate. The problem we are facing is that SyntaxEditor does not accpect Chinese character even my current input method is Chinese(Simplified)

This can be easily replicated by modifying the provided sample project PopupButtonIntro - by changing the field template as follows:


        <DataTemplate x:Key="EditorPopupContentTemplate">
            <shared:ResizableContentControl MinHeight="50" Width="298">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Border Background="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerBackgroundMidBrushKey}}"
							BorderThickness="0,0,0,1" BorderBrush="{DynamicResource {x:Static themes:AssetResourceKeys.PopupBorderNormalBrushKey}}">
                        <DockPanel LastChildFill="True" Margin="4,1,1,1">
                            <Button DockPanel.Dock="Right" Width="19" Height="19" Command="{x:Static shared:PopupButton.ClosePopupCommand}"
									Style="{DynamicResource {x:Static themes:SharedResourceKeys.EmbeddedButtonBaseOverrideStyleKey}}"
									ContentTemplate="{DynamicResource {x:Static themes:SharedResourceKeys.CloseGlyphTemplateKey}}" />
                            <TextBlock Text="Popup" VerticalAlignment="Center" />
                        </DockPanel>
                    </Border>
                    <editor:SyntaxEditor Grid.Row="1"
                                         WordWrapMode="Word" 
                                         AreWordWrapGlyphsVisible="True"
                                         VerticalAlignment="Stretch">
                        <editor:SyntaxEditor.ViewMarginFactories>
                            <sample:CustomMarginFactory />
                        </editor:SyntaxEditor.ViewMarginFactories>

                        <editor:EditorDocument xml:space="preserve"><![CDATA[This QuickStart shows how to create an advanced custom vertical margin that displays the number of characters on each view line.  The foreground brush used to render the character count changes as the number of characters increases.
		
This is an excellent sample for seeing how to create a margin that renders custom content related directly to the visible view lines.]]></editor:EditorDocument>

                    </editor:SyntaxEditor>
                </Grid>
            </shared:ResizableContentControl>
        </DataTemplate>

In this configuration, you can clearly see that the Chinese character does not work for the syntax editor but works perfectly for the textbox.

Please help us in resolving this issue as we need to be able to use Chinese character within syntax editors hosted in a PopupContentTemplete.

Kinds regards,

Joey Lu

[Modified 9 months ago]

Comments (1)

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

Hello,

Thanks for reporting this.  It appears that the Win32 IME composition wouldn't take effect if the Popup's Win32 handle was passed to the APIs.  We were able to work around this for the next maintenance release, which should be v23.1.3.


Actipro Software Support

The latest build of this product (v24.1.2) was released 4 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.