Question with integration NoesisGUI / Ogre
Hello,
I currently trying NoesisGUI with Ogre3D. I have integrated NoesisGUI with the exemples.
Exemple with Time.xaml work fine, and TicTacToe too ^^.
In the provided examples, I tried to integrate all exemple and only XAML exemple which contains only vectorial design work fine (time.xaml, butterfly.xaml, tiger and tux.xaml work fine) but other exemple don't work.
If i try to integrate, for exemple, Palette.xaml, there are no error but nothing is display.
After several test, I have generate a exemple where the viewer show the content correctly and where my application bug (left the viewer, right my application) :

My application can display canvas, certain type of TextBlock (with 3 Textblock, only one is displayed) and button is not display.
Can you help me to understand ?
I currently trying NoesisGUI with Ogre3D. I have integrated NoesisGUI with the exemples.
Exemple with Time.xaml work fine, and TicTacToe too ^^.
In the provided examples, I tried to integrate all exemple and only XAML exemple which contains only vectorial design work fine (time.xaml, butterfly.xaml, tiger and tux.xaml work fine) but other exemple don't work.
If i try to integrate, for exemple, Palette.xaml, there are no error but nothing is display.
After several test, I have generate a exemple where the viewer show the content correctly and where my application bug (left the viewer, right my application) :

My application can display canvas, certain type of TextBlock (with 3 Textblock, only one is displayed) and button is not display.
Can you help me to understand ?
-
-
sfernandez
Site Admin
- Posts: 3222
- Joined:
Re: Question with integration NoesisGUI / Ogre
Hello Olivier,
As it occurs in WPF, every control needs a valid Template to get a visual representation. Our engine doesn't define a default theme (where default styles and templates are usually defined for each control) becuase sometimes there is no need for them and resources are saved.
When you are designing a XAML that includes control elements, you must provide a template for each control type. This can be done explicitly:
By including an external file with all the styles and templates for the controls you use already defined:
Or you can specify that external resource file directly when loading the XAML using the Ogre Bindings API:
Anyway, seeing that this behavior has caused more confusion in the past and it is not at all intuitive, in the following release we will notify by a clear error that a control does not have a valid template for rendering.
As it occurs in WPF, every control needs a valid Template to get a visual representation. Our engine doesn't define a default theme (where default styles and templates are usually defined for each control) becuase sometimes there is no need for them and resources are saved.
When you are designing a XAML that includes control elements, you must provide a template for each control type. This can be done explicitly:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
<Border Background="Silver" Padding="10,5">
<ContentPresenter
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Grid.Resources>
<Button
Template="{StaticResource ButtonTemplate}"
Content="Button"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Gui/Themes/NoesisStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>
<Button
Template="{StaticResource ButtonTemplate}"
Content="Button"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
Code: Select all
void* uiRoot;
void* uiRenderer;
Noesis_LoadXAML(&uiRoot, &uiRenderer, "Gui/Samples/Button.xaml", "Gui/Themes/NoesisStyle.xaml");
Re: Question with integration NoesisGUI / Ogre
Thank you for your reply,
It works well !
It works well !
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests