 void SetBitSelection(UIElement@ parent, int value)
 {
     int mask = value;
-    const int MAX_MASK_BITS = 8;
+    bool enabled = true;
+
     if (mask ==  -1)
-        mask = (1 << MAX_MASK_BITS) - 1;
-
-    for (int i = 0; i < MAX_MASK_BITS; i++)
+        mask = MAX_BITMASK_VALUE;
+    else if (mask > MAX_BITMASK_VALUE)
+        enabled = false;
+
+    for (int i = 0; i < MAX_BITMASK_BITS; i++)
     {
         CheckBox@ bitBox = parent.GetChild("BitSelect_" + String(i), true);
+        bitBox.enabled = enabled;
+        if (!enabled)
+            bitBox.color = nonEditableBitSelectorColor;
+        else
+            bitBox.color = editableBitSelectorColor;
 
         if ((1 << i) & mask != 0)
             bitBox.checked = true;

void UpdateBitSelection(UIElement@ parent)
{
    int mask = 0;
    const int MAX_MASK_BITS = 8;
    for (int i = 0; i < MAX_MASK_BITS; i++)
    {
        CheckBox@ bitBox = parent.GetChild("BitSelect_" + String(i), true);
        mask = mask | (bitBox.checked ? 1 << i : 0);
    }

    if (mask == (1 << MAX_MASK_BITS) - 1 )
        mask = -1;

    inUpdateBitSelection = true;

{
    UIElement@ parent = CreateAttributeEditorParent(list, info.name, index, subIndex);

    // Check for masks and layers
    if (bitSelectionAttrs.Find(info.name) > -1)
    {
        LineEdit@ attrEdit = CreateAttributeBitSelector(parent, serializables, index, subIndex);
    }
    // Check for enums
    else if (info.enumNames is null || info.enumNames.empty)
