TextBox not updating when entering characters, but delete/backspace/ctrl-v works
Hello,
I'm looking to get some help/tips/advice for diagnosing an issue with a textbox.
I'm currently integrated Noesis into a C++ application. I'm purposely not using the launcher application framework, and have ported just the minimal number of files i need to get the noesis engine to update/render. I can visually see the UI and it updating with animations and all on some of the sample screens brought from the samples noesis provided.
I recently tried the login screen sample, from https://github.com/Noesis/Tutorials/tre ... ples/Login. Everything works but the text boxes. THe login button works from mouse input, or hitting the enter key. But whenever i try to type in the text box, no text appears. I have confirmed that keyboard input is hooked up, as i added a keyDown event in the interaction triggers and confirmed that my even fires (i tried a playSound for example whenever a key was entered in the box). However, it remains blank. Interestingly, i can paste text in the text box, and i can use my arrow keys/backspace/delete keys to remove characters from the pasted text.
So i'm pretty sure i've hooked up the input correctly. Has anyone run into this, or maybe could offer some advice on where i might add some debugging or diagnostics to see why the text box doesn't display characters that i type, while ctrl-paste works? Outside of some minor cosmetic changes to the login xaml, the tutorial is more or less left in tact.
My basic C++ program looks something like so:
as a refresher, the text box from the tutorial just looks like this:
the viewmodel that is hooked up to this screen, -- for example, the accountName -- it is never updated as well.
any suggestions or advice would be greatly appreciated!
Thanks!
-adrian
I'm looking to get some help/tips/advice for diagnosing an issue with a textbox.
I'm currently integrated Noesis into a C++ application. I'm purposely not using the launcher application framework, and have ported just the minimal number of files i need to get the noesis engine to update/render. I can visually see the UI and it updating with animations and all on some of the sample screens brought from the samples noesis provided.
I recently tried the login screen sample, from https://github.com/Noesis/Tutorials/tre ... ples/Login. Everything works but the text boxes. THe login button works from mouse input, or hitting the enter key. But whenever i try to type in the text box, no text appears. I have confirmed that keyboard input is hooked up, as i added a keyDown event in the interaction triggers and confirmed that my even fires (i tried a playSound for example whenever a key was entered in the box). However, it remains blank. Interestingly, i can paste text in the text box, and i can use my arrow keys/backspace/delete keys to remove characters from the pasted text.
So i'm pretty sure i've hooked up the input correctly. Has anyone run into this, or maybe could offer some advice on where i might add some debugging or diagnostics to see why the text box doesn't display characters that i type, while ctrl-paste works? Outside of some minor cosmetic changes to the login xaml, the tutorial is more or less left in tact.
My basic C++ program looks something like so:
Code: Select all
...
// load screen
Noesis::Ptr<BaseScreen> screen = Noesis::DynamicPtrCast<BaseScreen>(Noesis::GUI::LoadXaml(screenName.c_str()));
Noesis::Ptr<Noesis::IView> view = Noesis::GUI::CreateView(screen);
mActiveView = view;
mActiveView->AddReference();
mActiveView->GetRenderer()->Init(Noesis_GetRenderDevice());
// application loop:
if (mActiveView)
{
// loop through any keys that changed --
mActiveView->KeyDown(key);
uint32_t w = SYSTEM<WindowSystem>()->GetWindow()->GetWidth();
uint32_t h = SYSTEM<WindowSystem>()->GetWindow()->GetHeight();
mActiveView->SetSize(w, h);
double globalTime = Timing::GetMillisecondsSince(startTime);
mActiveView->Update(globalTime / 1000);
}
Code: Select all
<TextBox x:Name="UserBox" Grid.Row="4" VerticalAlignment="Bottom" Margin="5,0,10,0" Text="{Binding AccountName, Mode=OneWayToSource}" noesis:Text.Placeholder="Type your username">
<b:Interaction.Triggers>
<b:EventTrigger EventName="MouseEnter">
<noesis:SetFocusAction/>
</b:EventTrigger>
<b:EventTrigger EventName="GotKeyboardFocus">
<noesis:SelectAllAction/>
</b:EventTrigger>
<b:KeyTrigger Key="Return" ActiveOnFocus="True">
<b:ChangePropertyAction TargetName="Message" PropertyName="Text" Value=""/>
<b:InvokeCommandAction Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=PassBox}"/>
</b:KeyTrigger>
</b:Interaction.Triggers>
</TextBox>
any suggestions or advice would be greatly appreciated!
Thanks!
-adrian
Re: TextBox not updating when entering characters, but delete/backspace/ctrl-v works
Thanks for the excellent report, Adrian.
Just to confirm I understand correctly, this issue is occurring in your integration, right? If you try the Login sample included in the latest version of the C++ SDK, everything works as expected, correct?
Just to confirm I understand correctly, this issue is occurring in your integration, right? If you try the Login sample included in the latest version of the C++ SDK, everything works as expected, correct?
Re: TextBox not updating when entering characters, but delete/backspace/ctrl-v works
re: Just to confirm I understand correctly, this issue is occurring in your integration, right? If you try the Login sample included in the latest version of the C++ SDK, everything works as expected, correct?
Yes, that's correct; this is in our integration. The sample works perfectly. It's likely something i did, but i'm just looking for ways to debug/diagnose this issue.
Yes, that's correct; this is in our integration. The sample works perfectly. It's likely something i did, but i'm just looking for ways to debug/diagnose this issue.
Re: TextBox not updating when entering characters, but delete/backspace/ctrl-v works
Are you sending Char events to the View?
Code: Select all
/// Notifies that a key was translated to the corresponding unicode character.
/// If a key is repeatedly pressed, its corresponding 'Char' event is sent again.
/// 'Char' messages are expected to be sent between the corresponding 'Down' and 'Up' events:
/// - KeyDown
/// - Char
/// - KeyUp
/// Returns true if event was handled
virtual bool Char(uint32_t ch) = 0;
Re: TextBox not updating when entering characters, but delete/backspace/ctrl-v works
I was not calling Char function to the view,
I've updated the code, and it is working now! Thank you for your help!
I've updated the code, and it is working now! Thank you for your help!
Re: TextBox not updating when entering characters, but delete/backspace/ctrl-v works
Great! Happy to help
Who is online
Users browsing this forum: No registered users and 4 guests