Added a 'Read Only' to the Editor scenario Format menu. (#1882)

This commit is contained in:
BDisp
2022-07-23 14:05:27 +01:00
committed by GitHub
parent fc9e84a429
commit 0e05baef62

View File

@@ -94,7 +94,8 @@ namespace UICatalog.Scenarios {
new MenuBarItem ("Forma_t", new MenuItem [] {
CreateWrapChecked (),
CreateAutocomplete(),
CreateAllowsTabChecked ()
CreateAllowsTabChecked (),
CreateReadOnlyChecked ()
}),
new MenuBarItem ("_Responder", new MenuItem [] {
CreateCanFocusChecked (),
@@ -572,6 +573,18 @@ namespace UICatalog.Scenarios {
return item;
}
private MenuItem CreateReadOnlyChecked ()
{
var item = new MenuItem {
Title = "Read Only"
};
item.CheckType |= MenuItemCheckStyle.Checked;
item.Checked = _textView.ReadOnly;
item.Action += () => _textView.ReadOnly = item.Checked = !item.Checked;
return item;
}
private MenuItem CreateCanFocusChecked ()
{
var item = new MenuItem {