Add compatibility warning for invalid GTK accelerator keys
This commit is contained in:
@@ -53,7 +53,9 @@ public:
|
||||
, m_keyCode(keyCode)
|
||||
, m_command(cmd)
|
||||
, m_item(item)
|
||||
{ }
|
||||
{
|
||||
ValidateKey(flags, keyCode);
|
||||
}
|
||||
|
||||
// create accelerator corresponding to the specified string, return NULL if
|
||||
// string couldn't be parsed or a pointer to be deleted by the caller
|
||||
@@ -61,6 +63,8 @@ public:
|
||||
|
||||
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
|
||||
{
|
||||
ValidateKey(flags, keyCode);
|
||||
|
||||
m_flags = flags;
|
||||
m_keyCode = keyCode;
|
||||
m_command = cmd;
|
||||
@@ -118,6 +122,8 @@ public:
|
||||
private:
|
||||
wxString AsPossiblyLocalizedString(bool localized) const;
|
||||
|
||||
static bool ValidateKey(int flags, int keycode);
|
||||
|
||||
// common part of Create() and FromString()
|
||||
static bool ParseAccel(const wxString& str, int *flags, int *keycode);
|
||||
|
||||
|
Reference in New Issue
Block a user