Part Transitions & Caret Size

Editors for WPF Forum

Posted 15 years ago by Mike Strobel - New York, NY
Avatar
Great job with the editors, guys--having had more time to explore them, they really are quite slick.

First, a quick observation: the caret displayed in an editor part appears to have a width of 2px while the standard WPF caret (displayed between parts) has a width of 1px. I just think it looks a little inconsistent. I'd suggest either changing it to 1px or adding a property to CaretLayer to set the width.

Second, I noticed that when I enter a complete value for an editor part (e.g. a "MM" month field in the DateTimeEditBox), typing another character does not send me to the next part. For example, given a DateTimeEditBox:

01^/dd/yyyy

...where ^ represents the position of the caret, typing another number does not transfer focus to the day field. I have to manually hit '/', tab, etc. I think in cases where the current part's data is complete, focus should transfer automatically (assuming valid input), so I could simply type the sequence "01241984" to fill out "01/24/1984". If there are potential issues with this behavior that I'm overlooking, a property to toggle the behavior on/off would be fine.

Regards,
Mike

[Modified at 03/29/2009 01:30 PM]

Comments (5)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mike,

We followed the native WPF TextBox, which uses 2-pixels (on Vista Aero anyway). I see that the non-WPF TextBoxes use 1-pixel, so I added an attached property that will allow you to change the width of the caret though.

I added your second item to the TODO list. Right now the underlying MaskedTextBox only has an IsMatched property and associated event, but this also fires when say "1" is entered. Since "1" is valid, as is "01" and "12". So really this would only transition when the mask is completed *and* no more characters can be entered.


Actipro Software Support

Posted 15 years ago by Mike Strobel - Software Engineer, CDC Software
Avatar
Thanks! Seems you're right about the caret size in the standard WPF textbox. I was actually more concerned with the inconsistency within the same editor control.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ah, I see. Looks like the MaskTextBox is clipping the caret, which it probably should not do when used inside a part. I've made a note to fix this next. Thanks :)


Actipro Software Support

Posted 15 years ago by Robert A. McCarter
Avatar
I second Mike's request for simply being able to type in a series of numbers and having the control automatically skip over the date separators.

Thanks - this control is SO much nicer (and faster, and less buggy) than Infragistic's version!
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Robert,

Thanks for the compliments :-) We've already implemented this feature for the next maintenance release. Look for the "PartEditBox Moving Focus QuickStart" to see it in action.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.