func (tr *EnumRegistry) AddEnumExt(parTyp reflect.Type, en interface{}, bitFlag bool, props map[string]interface{}) reflect.Type {
	typ := tr.AddEnum(en, bitFlag, props)
	snm := ShortTypeName(typ)
	if parTyp == typ {
		log.Printf("kit.Enums.AddEnumExt: parent type: %v is same as type being defined -- must be different!\n", parTyp.String())
	} else {
		tr.SetProp(snm, "ParType", parTyp)
	}
	return typ
}
AddEnumExt adds a given type to the registry that extends an existing parTyp enum.
Requires the N value to set N from and grab type info from.
if bitFlag then sets BitFlag property, and each value represents a bit in a set of bit
flags, so the string rep of a value contains an or-list of names for each bit set,
separated by | -- can also add additional properties -- they are copied so
can be re-used across enums
package kit
import (
	"bytes"
	"fmt"
	"log"
	"reflect"
	"strings"
	"github.com/goki/ki/bitflag"
)
type EnumRegistry struct {
	Enums map[string]reflect.Type
	Props map[string]map[string]interface{}
	Vals map[string][]EnumValue
}
var Enums EnumRegistry
const (
	BitFlag = true
	NotBitFlag = false
)
func (tr *EnumRegistry) AddEnum(en interface{}, bitFlag bool, props map[string]interface{}) reflect.Type {
	if tr.Enums == nil {
		tr.Enums = make(map[string]reflect.Type)
		tr.Props = make(map[string]map[string]interface{})
		tr.Vals = make(map[string][]EnumValue)
	}
	typ := PtrType(reflect.TypeOf(en)).Elem()
	n := EnumIfaceToInt64(en)
	snm := ShortTypeName(typ)
	tr.Enums[snm] = typ
	if props != nil {
		nwprops := make(map[string]interface{}, len(props))
		for key, val := range props {
			nwprops[key] = val
		}
		tr.Props[snm] = nwprops
	}
	tp := tr.Properties(snm)
	tp["N"] = n
	if bitFlag {
		tp := tr.Properties(snm)
		tp["BitFlag"] = true
		EnumBitDepthCheck(typ, n)
	}
	return typ
}
func EnumBitDepthCheck(typ reflect.Type, n int64) error {
	cp := typ.Size() * 8
	if n > int64(cp) {
		err := fmt.Errorf("kit.EnumBitDepthCheck ERROR: enum: %v is a bitflag of kind: %v with capacity of: %d bits, but more flags were defined: %d", ShortTypeName(typ), typ.Kind(), cp, n)
		log.Println(err)
		return err
	}
	return nil
}
func (tr *EnumRegistry) AddEnumAltLower(en interface{}, bitFlag bool, props map[string]interface{}, prefix string) reflect.Type {
	typ := tr.AddEnum(en, bitFlag, props)
	n := EnumIfaceToInt64(en)
	snm := ShortTypeName(typ)
	alts := make(map[int64]string)
	tp := tr.Properties(snm)
	for i := int64(0); i < n; i++ {
		str := EnumInt64ToString(i, typ)
		str = strings.ToLower(strings.TrimPrefix(str, prefix))
		alts[i] = str
	}
	tp["AltStrings"] = alts
	return typ
}