Added wxPropertyGrid::DedicateKey(), which prevents specific key presses from being eaten by editor controls. This is useful for customizing keyboard navigation. Also added utility function wxPGFindInVector<>(), which is used in the new code, and also in some other places.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-06-12 09:30:57 +00:00
parent b589082adc
commit 8d2c70414c
9 changed files with 103 additions and 17 deletions

View File

@@ -709,12 +709,34 @@ public:
/** Adds given key combination to trigger given action.
Here is a sample code to make Enter key press move focus to
the next property.
@code
propGrid->AddActionTrigger(wxPG_ACTION_NEXT_PROPERTY,
WXK_RETURN);
propGrid->DedicateKey(WXK_RETURN);
@endcode
@param action
Which action to trigger. See @link pgactions List of list of
wxPropertyGrid actions@endlink.
*/
void AddActionTrigger( int action, int keycode, int modifiers = 0 );
/**
Dedicates a specific keycode to wxPropertyGrid. This means that such
key presses will not be redirected to editor controls.
Using this function allows, for example, navigation between
properties using arrow keys even when the focus is in the editor
control.
*/
void DedicateKey( int keycode )
{
m_dedicatedKeys.push_back(keycode);
}
/**
This static function enables or disables automatic use of
wxGetTranslation for following strings: wxEnumProperty list labels,
@@ -1814,6 +1836,10 @@ protected:
wxArrayPGProperty m_deletedProperties;
wxArrayPGProperty m_removedProperties;
/** List of key codes that will not be handed over to editor controls. */
// FIXME: Make this a hash set once there is template-based wxHashSet.
wxVector<int> m_dedicatedKeys;
//
// Temporary values
//