Noob questions about wether some things are possible or not
Hi,
I am a total noob in WPF, so before investing time in learning it, i would like to know if it is possible to do the following things with WPF and NoesisGUI.
-draggable/resizable panels
-i want have a panel containing buttons/controls, but i don't know in advance how many buttons there will
be, is it possible to create that panel and button list at runtime?
Thanks in advance.
I am a total noob in WPF, so before investing time in learning it, i would like to know if it is possible to do the following things with WPF and NoesisGUI.
-draggable/resizable panels
-i want have a panel containing buttons/controls, but i don't know in advance how many buttons there will
be, is it possible to create that panel and button list at runtime?
Thanks in advance.
-
sfernandez
Site Admin
- Posts: 3093
- Joined:
Re: Noob questions about wether some things are possible or
Welcome to our forums. I will try to shed some light on your questions...Hi,
I am a total noob in WPF, so before investing time in learning it, i would like to know if it is possible to do the following things with WPF and NoesisGUI.
You can capture mouse events to apply transformations to UI elements: for dragging you would apply translate transforms, and for resizing you would modify panel dimensions (Width and Height properties).-draggable/resizable panels
It is perfectly possible to create UI elements dynamically and add them to any known container. For example, if you have a StackPanel panel in your interface named "ButtonContainer", you can do the following:-i want have a panel containing buttons/controls, but i don't know in advance how many buttons there will
be, is it possible to create that panel and button list at runtime?
Code: Select all
Ptr<FrameworkElement> xaml = LoadXaml<FrameworkElement>("Gui/Test/Panel.xaml");
Ptr<StackPanel> buttonContainer = xaml->FindName<StackPanel>("ButtonContainer");
Ptr<Button> button = *new Button();
button->SetContent("Dynamically Created!");
buttonContainer->GetChildren()->Add(button.GetPtr());
Re: Noob questions about wether some things are possible or
Hi,
Thanks for this information.
Thanks for this information.
Re: Noob questions about wether some things are possible or
Hi,
I have another question.
Is it possible to use the x:Class="MyClass" when using NoesisGUI in Unity with C#?
I get an error when i do so.
I think i saw in another thread that it was not supported but it would be supported in version 1.0, is it the case?
Thanks in advance.
I have another question.
Is it possible to use the x:Class="MyClass" when using NoesisGUI in Unity with C#?
I get an error when i do so.
I think i saw in another thread that it was not supported but it would be supported in version 1.0, is it the case?
Thanks in advance.
Re: Noob questions about wether some things are possible or
Yes, x:Class is supported in Unity.
What error are you getting?
Could you paste the xaml here?
What error are you getting?
Could you paste the xaml here?
Re: Noob questions about wether some things are possible or
Hi here is the XAMl in a file named Test.xaml :
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/marku ... ility/2006"
mc:Ignorable="d"
Margin="10"
x:Class="TestClass"
>
<Button>Test</Button>
</Grid>
Here is the C# code in a file named TestClass.cs :
using UnityEngine;
using System.Collections;
public class TestClass : Noesis.Grid
{
public void OnButtonClicked(Object sender, Noesis.RoutedEventArgs e)
{
Debug.Log("ButtonClicked");
}
}
The error i get is :
[DX9] Assets/GUI/TestClass.xaml
Parsing Grid (@1,0)
Unknown type 'TestClass'
UnityEngine.Debug:LogError(Object)
Noesis.BuildToolKernel:OnLog(Int32, String) (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:161)
System.Object:wrapper_native_24424170()
Noesis.BuildToolKernel:Build() (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:136)
NoesisPostProcessor:Build(String, Boolean, Boolean) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:207)
NoesisPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:170)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
the same error appear for GL
I'm still using the trial package.
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/marku ... ility/2006"
mc:Ignorable="d"
Margin="10"
x:Class="TestClass"
>
<Button>Test</Button>
</Grid>
Here is the C# code in a file named TestClass.cs :
using UnityEngine;
using System.Collections;
public class TestClass : Noesis.Grid
{
public void OnButtonClicked(Object sender, Noesis.RoutedEventArgs e)
{
Debug.Log("ButtonClicked");
}
}
The error i get is :
[DX9] Assets/GUI/TestClass.xaml
Parsing Grid (@1,0)
Unknown type 'TestClass'
UnityEngine.Debug:LogError(Object)
Noesis.BuildToolKernel:OnLog(Int32, String) (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:161)
System.Object:wrapper_native_24424170()
Noesis.BuildToolKernel:Build() (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:136)
NoesisPostProcessor:Build(String, Boolean, Boolean) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:207)
NoesisPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:170)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
the same error appear for GL
I'm still using the trial package.
Re: Noob questions about wether some things are possible or
Sorry for the confusion, x:Class is supported only for UserControls for now...
Yes, Code-Behind (what you are trying to achieve) is yet not implemented in Unity. You have to manually find the controls (marked wih x:Name) you are interested in and connect the delegates.
Yes, Code-Behind (what you are trying to achieve) is yet not implemented in Unity. You have to manually find the controls (marked wih x:Name) you are interested in and connect the delegates.
Code: Select all
_button = grid.FindName<Button>("Button");
_button.Click += this.OnButtonClicked;
Re: Noob questions about wether some things are possible or
Ok, i knew about the other method, but i preferred this one.
It will do for now but is this feature on the roadmap?
Thanks in advance.
Edit :
By the way, when i click play despite the error in PostProcess, Unity kind of bugs, it become impossible to stop the play mode by clicking on the button in the main panel. I found a way to unblock it, by using the Edit/Pause then clicking on play again to stop the play mode. I don't know if it comes from Unity or from NoesisGUI, but i thought i should report it to you.
It will do for now but is this feature on the roadmap?
Thanks in advance.
Edit :
By the way, when i click play despite the error in PostProcess, Unity kind of bugs, it become impossible to stop the play mode by clicking on the button in the main panel. I found a way to unblock it, by using the Edit/Pause then clicking on play again to stop the play mode. I don't know if it comes from Unity or from NoesisGUI, but i thought i should report it to you.
Re: Noob questions about wether some things are possible or
Main blocker from us is that code like this:Ok, i knew about the other method, but i preferred this one.
It will do for now but is this feature on the roadmap?
Code: Select all
public class TestClass : Noesis.Grid
{
public void OnButtonClicked(Object sender, Noesis.RoutedEventArgs e)
{
Debug.Log("ButtonClicked");
}
}
As soon as this work is finished incorporating Code-Behind is trivial. Apart from bugs reported by customers (that is the max priority) this is the next is our priority list.
Strange that you don't get an error when clickin on Play beause TestClass.xaml didn't build and you have it referrenced inside a NoesisGUI Panel component, havent you?By the way, when i click play despite the error in PostProcess, Unity kind of bugs, it become impossible to stop the play mode by clicking on the button in the main panel. I found a way to unblock it, by using the Edit/Pause then clicking on play again to stop the play mode. I don't know if it comes from Unity or from NoesisGUI, but i thought i should report it to you.
Re: Noob questions about wether some things are possible or
Hi,
Yes i understand bug correction is high priority.
About your question, i get an Exception thrown by the Noesis.Error class, which makes sense.
But, i have this behavior that i cannot exit play mode in the main Unity panel, i have to do it from the menu.
However, i just found out that it is not reproducible during some test before posting. I had this bug, and now i can't have it again. Anyway if i have new info i will update you.
By the way i just bought my license on Unity asset store. I will send a PM to you so that you can update my forum account.
Yes i understand bug correction is high priority.
About your question, i get an Exception thrown by the Noesis.Error class, which makes sense.
But, i have this behavior that i cannot exit play mode in the main Unity panel, i have to do it from the menu.
However, i just found out that it is not reproducible during some test before posting. I had this bug, and now i can't have it again. Anyway if i have new info i will update you.
By the way i just bought my license on Unity asset store. I will send a PM to you so that you can update my forum account.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests