UE4
Topic Author
Posts: 62
Joined: 29 Dec 2017, 06:32

[UE4] ToolTip does not work well

08 Apr 2018, 15:11

The tooltip is flashing
 <ItemsControl x:Name="ItemsControlBuffList" ItemsSource="{Binding BuffList}"      
                    Canvas.Left="550" Canvas.Top="475" Foreground="{x:Null}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel Width="300" Height="50" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>

                    <ItemsControl.ItemTemplate>
                        <DataTemplate>

                            <Grid>
                                <Border x:Name="BuffType" BorderBrush="#FF3EB6EE" Width="50" Height="50">
                                    <Border.Triggers>
                                        <DataTrigger Binding="{Binding bBuffFlag}" Value="True">
                                            <Setter Property="Border.BorderBrush" Value="Red"></Setter>
                                        </DataTrigger>
                                    </Border.Triggers>

                                </Border>

                                <Button x:Name="BuffBtn" Width="45" Height="45" Command="{Binding DataContext.ShowBuffTips, ElementName=SpellPanelControl}" 
                                        CommandParameter="{Binding Description}">
                                    <Button.Background>
                                        <ImageBrush ImageSource="{Binding Icon}"></ImageBrush>
                                    </Button.Background>
                                </Button>

                                <ToolTip x:Name="BuffDesc" IsHitTestVisible="False"
                                    PlacementTarget="{Binding ElementName=BuffBtn}"
                                    PlacementRectangle="0 -80 50 0"
                                     BorderThickness="0" Visibility="{Binding ElementName=BuffBtn, Path=IsMouseOver, Converter={StaticResource BoolToVisible}}">
                                    <Grid>

                                        <TextBlock x:Name="BuffDescContent" Background="LightGray" Foreground="Black" Text="{Binding Description, FallbackValue=Windows_Presentation_Foundation }" FontFamily="{StaticResource Font_KaiTi}" FontSize="16" TextWrapping="Wrap" MinWidth="0" MaxWidth="300"></TextBlock>
                                    </Grid>
                                </ToolTip>

                            </Grid>

                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
The second not displayed on UE4, correct in WPF
<Grid Width="300" Height="100" Canvas.Left="500" Canvas.Top="100">
                    <Button x:Name="testBtn" Content="Hello WPF" FontSize="48" Margin="0" Background="#FF919191">

                        <Button.ToolTip>
                            <ToolTip x:Name="TestBuffDesc" IsHitTestVisible="False"
                                    PlacementTarget="{Binding ElementName=testBtn}"
                                     BorderThickness="0" Visibility="{Binding ElementName=testBtn, Path=IsMouseOver, Converter={StaticResource BoolToVisible}}">
                                <Grid>

                                    <TextBlock x:Name="BuffDescContent" Background="Black" Foreground="White" Text="Hello WPF" FontFamily="{StaticResource Font_KaiTi}" FontSize="16" TextWrapping="Wrap" MinWidth="0" MaxWidth="300"></TextBlock>
                                </Grid>
                            </ToolTip>
                        </Button.ToolTip>
                    </Button>


                </Grid>


 
User avatar
hcpizzi
Site Admin
Posts: 236
Joined: 09 Feb 2012, 12:40

Re: [UE4] ToolTip does not work well

10 Apr 2018, 09:22

Hi,

The first method shouldn't work. You shouldn't be able to add a ToolTip like that. From Microsoft's documentation here (https://msdn.microsoft.com/en-us/librar ... .110).aspx): "A ToolTip control cannot have a parent. For example, you cannot set the Content property of a Button to a ToolTip Instead, assign a ToolTip to the FrameworkContentElement.ToolTip and FrameworkElement.ToolTip properties."

The second method should work, but there's a bug in the plugin handling some MouseMove events that Unreal produces even when the mouse hasn't moved. That will be fixed in a code release I plan on doing today.

I'll update this post again when the fix is on GitHub.
 
User avatar
hcpizzi
Site Admin
Posts: 236
Joined: 09 Feb 2012, 12:40

Re: [UE4] ToolTip does not work well

10 Apr 2018, 17:41

Hi,

The fix for the flicker on the second sample is on GitHub. Also, validation to prevent the first sample, which is invalid, has been added to the Noesis runtime and will be in the next release of the SDK.

Also, please take into consideration the changes we've made to how the plugin is distributed. Gone are the precompiled editor binaries, and instead we expect users to build them themselves. For a C++ project this should happen automatically, but we've also created a Python script to do it, mostly to support Blueprint only projects and some Launcher configurations. Please, take a moment to read the new revised README.

As always, please let us know if you find any problems.

Who is online

Users browsing this forum: No registered users and 2 guests