#4 Allowing an option to ClearSelection() on enter.

closed
5
2008-06-22
2006-08-15
Anonymous
No

It annoys me if you click on a value to edit it, then
hit enter and the selection stays. It will only do
something with enter if you have actually edited the
control. This does not feel natural to me. I would like
an option that would clear the selection (or do some
action I can overwrite), when the enter key is pressed.
This feels more natural and how other property controls
do it in other applications.

Discussion

  • Jaakko Salli

    Jaakko Salli - 2006-08-16

    Logged In: YES
    user_id=1193883

    Hi,

    Do you mean like in SharpDevelop (which uses .NET 2.0),
    where pressing ENTER seems to unfocus the editor control?

     
  • Jaakko Salli

    Jaakko Salli - 2006-08-16
    • assigned_to: nobody --> jmsalli
     
  • Nobody/Anonymous

    Logged In: NO

    Yea, but I figured out how to do it. Sorry I posted this
    before I figured it out. All I had to do was define my own
    wxPropertyGrid class, then use
    EVT_TEXT_ENTER (-1, PropertyGrid::OnTextEnter)
    Then in that function just ClearSelection () and it works as
    I described.

     
  • Jaakko Salli

    Jaakko Salli - 2006-08-16

    Logged In: YES
    user_id=1193883

    It's okay, adding alternative mode that is more faithful to
    the .NET property grid would be a good feature to have.
    However, by unfocus I didn't mean ClearSelection() but
    something that happens when you press ESC in wxPropertyGrid
    when editing a text property.

    Looking at the SharpDevelop propgrid, I initially noticed
    following key handling differences when compared to
    wxPropertyGrid:
    * ENTER unfocuses.
    * ESC doesn't revert changes.

    Please let me know if you have comments or additions.

    Also, for the next version, I'll change the keyboard
    handling so that you can also intercept enter, along with
    all the other keys, with EVT_KEY_DOWN handler of pushed
    wxEvtHandler (or with class derived from wxPropertyGrid,
    whichever you prefer).

     
  • Jaakko Salli

    Jaakko Salli - 2008-06-22

    Logged In: YES
    user_id=1193883
    Originator: NO

    Can be achieved by sub classing.

     
  • Jaakko Salli

    Jaakko Salli - 2008-06-22
    • status: open --> closed
     

Log in to post a comment.