AddActionTrigger( wxPG_ACTION_COPY, WXK_INSERT, wxMOD_CONTROL );
AddActionTrigger( wxPG_ACTION_PASTE, 'V', wxMOD_CONTROL );
AddActionTrigger( wxPG_ACTION_PASTE, WXK_INSERT, wxMOD_SHIFT );
+ AddActionTrigger( wxPG_ACTION_PRESS_BUTTON, WXK_DOWN, wxMOD_ALT );
m_coloursCustomized = 0;
m_frozen = 0;
m_width = m_height = 0;
- SetButtonShortcut(0);
-
- m_keyComboConsumed = 0;
-
m_commonValues.push_back(new wxPGCommonValue(_("Unspecified"), wxPGGlobalVars->m_defaultRenderer) );
m_cvUnspecified = 0;
}
-// -----------------------------------------------------------------------
-
-void wxPropertyGrid::SetButtonShortcut( int keycode, bool ctrlDown, bool altDown )
-{
- if ( keycode )
- {
- m_pushButKeyCode = keycode;
- m_pushButKeyCodeNeedsCtrl = ctrlDown ? 1 : 0;
- m_pushButKeyCodeNeedsAlt = altDown ? 1 : 0;
- }
- else
- {
- m_pushButKeyCode = WXK_DOWN;
- m_pushButKeyCodeNeedsCtrl = 0;
- m_pushButKeyCodeNeedsAlt = 1;
- }
-}
-
// -----------------------------------------------------------------------
// Methods related to change in value, value modification and sending events
// -----------------------------------------------------------------------
{
// Show dialog?
- if ( ButtonTriggerKeyTest(event) )
+ if ( ButtonTriggerKeyTest(action, event) )
return;
wxPGProperty* p = m_selected;
void wxPropertyGrid::OnKeyUp(wxKeyEvent &event)
{
- m_keyComboConsumed = 0;
-
event.Skip();
}
// -----------------------------------------------------------------------
-bool wxPropertyGrid::ButtonTriggerKeyTest( wxKeyEvent &event )
+bool wxPropertyGrid::ButtonTriggerKeyTest( int action, wxKeyEvent& event )
{
- int keycode = event.GetKeyCode();
+ if ( action == -1 )
+ {
+ int secondAction;
+ action = KeyEventToActions(event, &secondAction);
+ }
// Does the keycode trigger button?
- if ( keycode == m_pushButKeyCode &&
- m_wndEditor2 &&
- (!m_pushButKeyCodeNeedsAlt || event.AltDown()) &&
- (!m_pushButKeyCodeNeedsCtrl || event.ControlDown()) )
+ if ( action == wxPG_ACTION_PRESS_BUTTON &&
+ m_wndEditor2 )
{
- m_keyComboConsumed = 1;
-
- wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,m_wndEditor2->GetId());
+ wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED, m_wndEditor2->GetId());
GetEventHandler()->AddPendingEvent(evt);
return true;
}
return;
}
- if ( ButtonTriggerKeyTest(event) )
+ if ( ButtonTriggerKeyTest(-1, event) )
return;
if ( HandleChildKey(event) == true )
void wxPropertyGrid::OnChildKeyUp( wxKeyEvent &event )
{
- m_keyComboConsumed = 0;
-
GetEventHandler()->AddPendingEvent(event);
event.Skip();