* BUG: TextArea: Shortcuts that could modify the text are now disabled if the TextArea is read-only.

[GB.GTK3]
* BUG: TextArea: Shortcuts that could modify the text are now disabled if the TextArea is read-only.


git-svn-id: svn://localhost/gambas/trunk@7830 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2016-07-23 09:37:38 +00:00
parent 5355d8b955
commit 5e9d52e73d

View File

@ -406,17 +406,33 @@ static gboolean cb_keypress(GtkWidget *widget, GdkEvent *event, gTextArea *ctrl)
{
int key = gdk_keyval_to_unicode(gdk_keyval_to_upper(event->key.keyval));
if (key == 'Z')
if (!ctrl->readOnly())
{
ctrl->undo();
return true;
if (key == 'Z')
{
ctrl->undo();
return true;
}
else if (key == 'Y')
{
ctrl->redo();
return true;
}
else if (key == 'X')
{
ctrl->cut();
ctrl->ensureVisible();
return true;
}
else if (key == 'V')
{
ctrl->paste();
ctrl->ensureVisible();
return true;
}
}
else if (key == 'Y')
{
ctrl->redo();
return true;
}
else if (key == 'A')
if (key == 'A')
{
ctrl->selectAll();
return true;
@ -426,18 +442,6 @@ static gboolean cb_keypress(GtkWidget *widget, GdkEvent *event, gTextArea *ctrl)
ctrl->copy();
return true;
}
else if (key == 'X')
{
ctrl->cut();
ctrl->ensureVisible();
return true;
}
else if (key == 'V')
{
ctrl->paste();
ctrl->ensureVisible();
return true;
}
}
return false;