Exemplo n.º 1
0
        public GridBlockDefinition()
            : base()
        {
            BlockSelectionMode = GridSelectionMode.Cell;

            DefaultSlotDefaultPaletteEntryIndex = -1;
            MinimumColumnWidthPercent           = 20;
            MaximumColumnWidthPercent           = 50;

            HorizontalScrollIndicationType = ScrollIndication.Bar;
            VerticalScrollIndicationType   = ScrollIndication.Bar;
        }
Exemplo n.º 2
0
        public void Unpack(FieldList source)
        {
            if (source == null)
            {
                return;
            }

            UnpackDefinitionID(source);

            // unpack paint styles
            Foreground = new PaintStyle(source, DefAgentFieldID.ForegroundPaintStyle);
            Background = new PaintStyle(source, DefAgentFieldID.BackgroundPaintStyle);

            // font
            Font = source[DefAgentFieldID.FontReference].AsShort() ?? 0;

            BlockSelectionMode = (GridSelectionMode)(source[DefAgentFieldID.SelectionMode].AsByte() ?? (byte)GridSelectionMode.Cell);
            DefaultSlotDefaultPaletteEntryIndex = source[DefAgentFieldID.DefaultSlotDefaultPaletteEntry].AsShort() ?? -1;

            MinimumColumnWidthPercent = source[DefAgentFieldID.MinimumColumnWidth].AsByte() ?? 20;
            MaximumColumnWidthPercent = source[DefAgentFieldID.MaximumColumnWidth].AsByte() ?? 50;

            Spacing = source[DefAgentFieldID.Spacing].AsShort() ?? 0;

            AreColumnsHeadersFocusable = source[DefAgentFieldID.ColumnsHeadersFocusable].AsBoolean() ?? false;
            AreRowHeadersFocusable     = source[DefAgentFieldID.RowHeadersFocusable].AsBoolean() ?? false;

            KeepColumnHeadersVisible = source[DefAgentFieldID.KeepColumnsHeadersVisible].AsBoolean() ?? false;
            KeepRowHeadersVisible    = source[DefAgentFieldID.KeepRowHeadersVisible].AsBoolean() ?? false;

            // scroll indication
            HorizontalScrollIndicationType = (ScrollIndication)(source[DefAgentFieldID.HorizontalScrollIndicationType].AsByte() ?? (byte)ScrollIndication.Bar);
            VerticalScrollIndicationType   = (ScrollIndication)(source[DefAgentFieldID.VerticalScrollIndicationType].AsByte() ?? (byte)ScrollIndication.Bar);

            UnpackMarginsAndPadding(source);

            ForceContentsToGridWidth = source[DefAgentFieldID.ForceContentToWidth].AsBoolean() ?? false;

            UnpackBlockHints(source);

            // done
            IsUnpacked = true;
        }