Added wxKeyEvent ctor for creating event of the different type for same key.
This is useful for implementation code in a couple of ports so provide a higher level ctor doing this instead of having to use a copy ctor and then manually changing the event type. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1661,7 +1661,12 @@ class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent,
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxKeyEvent(wxEventType keyType = wxEVT_NULL);
|
wxKeyEvent(wxEventType keyType = wxEVT_NULL);
|
||||||
|
|
||||||
|
// Normal copy ctor and a ctor creating a new event for the same key as the
|
||||||
|
// given one but a different event type (this is used in implementation
|
||||||
|
// code only, do not use outside of the library).
|
||||||
wxKeyEvent(const wxKeyEvent& evt);
|
wxKeyEvent(const wxKeyEvent& evt);
|
||||||
|
wxKeyEvent(wxEventType eventType, const wxKeyEvent& evt);
|
||||||
|
|
||||||
// get the key code: an ASCII7 char or an element of wxKeyCode enum
|
// get the key code: an ASCII7 char or an element of wxKeyCode enum
|
||||||
int GetKeyCode() const { return (int)m_keyCode; }
|
int GetKeyCode() const { return (int)m_keyCode; }
|
||||||
|
@@ -744,6 +744,15 @@ wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt)
|
|||||||
DoAssignMembers(evt);
|
DoAssignMembers(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxKeyEvent::wxKeyEvent(wxEventType eventType, const wxKeyEvent& evt)
|
||||||
|
: wxEvent(evt),
|
||||||
|
wxKeyboardState(evt)
|
||||||
|
{
|
||||||
|
DoAssignMembers(evt);
|
||||||
|
|
||||||
|
m_eventType = eventType;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxKeyEvent::IsKeyInCategory(int category) const
|
bool wxKeyEvent::IsKeyInCategory(int category) const
|
||||||
{
|
{
|
||||||
switch ( GetKeyCode() )
|
switch ( GetKeyCode() )
|
||||||
|
Reference in New Issue
Block a user