]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxPG_ACTION_EDIT, which allows specifying custom key to move focus to the prope...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Wed, 22 Dec 2010 17:25:45 +0000 (17:25 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Wed, 22 Dec 2010 17:25:45 +0000 (17:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
interface/wx/propgrid/propgrid.h
src/propgrid/propgrid.cpp

index 874c576b091d19f945b8c00e2edad3164d5dde5a..5f275ab91f556f3e7d333a6e56cc564a4f3b55b4 100644 (file)
@@ -524,12 +524,32 @@ private:
 enum wxPG_KEYBOARD_ACTIONS
 {
     wxPG_ACTION_INVALID = 0,
+
+    /** Select the next property. */
     wxPG_ACTION_NEXT_PROPERTY,
+
+    /** Select the previous property. */
     wxPG_ACTION_PREV_PROPERTY,
+
+    /** Expand the selected property, if it has child items. */
     wxPG_ACTION_EXPAND_PROPERTY,
+
+    /** Collapse the selected property, if it has child items. */
     wxPG_ACTION_COLLAPSE_PROPERTY,
+
+    /** Cancel and undo any editing done in the currently active property
+        editor.
+    */
     wxPG_ACTION_CANCEL_EDIT,
-    wxPG_ACTION_PRESS_BUTTON,  // Causes editor button (if any) to be pressed
+
+    /** Move focus to the editor control of the currently selected
+        property.
+    */
+    wxPG_ACTION_EDIT,
+
+    /** Causes editor's button (if any) to be pressed. */
+    wxPG_ACTION_PRESS_BUTTON,
+
     wxPG_ACTION_MAX
 };
 
index c88cf3efcca5c6583e64d08279d2e2801fed10a8..3c03e9829666bbbaa4079df5962207795a601240 100644 (file)
@@ -233,7 +233,7 @@ wxPG_VFB_BEEP                       = 0x02,
 wxPG_VFB_MARK_CELL                  = 0x04,
 
 /**
-    Display a text message explaining the situation. 
+    Display a text message explaining the situation.
 
     To customize the way the message is displayed, you need to
     reimplement wxPropertyGrid::DoShowPropertyError() in a
@@ -320,11 +320,32 @@ public:
 enum wxPG_KEYBOARD_ACTIONS
 {
     wxPG_ACTION_INVALID = 0,
+
+    /** Select the next property. */
     wxPG_ACTION_NEXT_PROPERTY,
+
+    /** Select the previous property. */
     wxPG_ACTION_PREV_PROPERTY,
+
+    /** Expand the selected property, if it has child items. */
     wxPG_ACTION_EXPAND_PROPERTY,
+
+    /** Collapse the selected property, if it has child items. */
     wxPG_ACTION_COLLAPSE_PROPERTY,
+
+    /** Cancel and undo any editing done in the currently active property
+        editor.
+    */
     wxPG_ACTION_CANCEL_EDIT,
+
+    /** Move focus to the editor control of the currently selected
+        property.
+    */
+    wxPG_ACTION_EDIT,
+
+    /** Causes editor's button (if any) to be pressed. */
+    wxPG_ACTION_PRESS_BUTTON,
+
     wxPG_ACTION_MAX
 };
 
@@ -1074,7 +1095,7 @@ public:
         control over wxPropertyGrid behavior.
     */
     //@{
-    
+
     /**
         Override in derived class to display error messages in custom manner
         (these message usually only result from validation failure).
index f79faf1af208198e2bc5154b3f87ce4547e6cc41..fac6436c3bf9a94aa028de1ba962f9b602a601a1 100644 (file)
@@ -5687,6 +5687,12 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
 
         wxPGProperty* p = selected;
 
+        if ( action == wxPG_ACTION_EDIT && !editorFocused )
+        {
+            DoSelectProperty( p, wxPG_SEL_FOCUS );
+            wasHandled = true;
+        }
+
         // Travel and expand/collapse
         int selectDir = -2;