Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Behavior of EditComponent (Read 3106 times)
goblue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 1st, 2020
Behavior of EditComponent
Jul 25th, 2020 at 3:35am
Print Post  
I'm having the following issues with using EditComponent in CompositeNode.

When typing in the text and it gets longer than the EditComponent, all the previously-typed letters disappear instead of moving to the left. It's like a new line being started. To make matters worse, the first "line" does not re-appear even after EditComponent loses focus. Also, the user cannot use mouse cursor to navigate between the visible and invisible part of the text. The only way to navigate is to use left and right keys.

Is it possible to change its behavior so it's the same as the standard TextBox?



-
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Behavior of EditComponent
Reply #1 - Jul 27th, 2020 at 6:12am
Print Post  
The text wraps to a new line. If you have enough space to show more than one line, there will always be some text visible (see Demo/Composite Nodes).

You should be able to scroll up or down using arrow keys, but make sure the key events actually reach the DiagramView. E.g. check if you aren't consuming arrow key events from PreviewKeyDown event handler. If DiagramView is inside a user control, the parent control might be doing that internally (https://stackoverflow.com/questions/6177201/how-to-prevent-usercontrol-form-hand...).

You might try setting EditComponent's ScrollFirstLine property to 0 after editing text to make sure it shows the first line.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
goblue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 1st, 2020
Re: Behavior of EditComponent
Reply #2 - Jul 31st, 2020 at 5:50am
Print Post  
Thank you. I can accept that.

Another question - is it possible to cancel key inputs in KeyDown event? I'd like the EditComponent to ignore Up/Down keys when Ctrl+Up/Down are pressed.
  
Back to top
 
IP Logged
 
goblue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 1st, 2020
Re: Behavior of EditComponent
Reply #3 - Aug 1st, 2020 at 6:45pm
Print Post  
I was able to do it by overriding the OnKeyDown method. It would be nice if there was a Cancel or Handled property.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint