Example #1
0
        private void SetUpUI()
        {
            //source field tab
            FillListboxFields();
            chkLayerIsLabeled.Checked = _mapLayer.IsLabeled;
            if (chkLayerIsLabeled.Checked)
            {
                lblResult.Text = string.Empty;
                if (_mapLayer.LabelSource == "Expression")
                {
                    txtLabelSourceField.Text = _mapLayer.Expression;
                    TestExpression(_mapLayer.Expression);
                }
                else
                {
                    txtLabelSourceField.Text = (string)listboxFields.Items[_mapLayer.LabelField];
                    lblResult.Text           = "No expression";
                    lblResult.ForeColor      = Color.Black;
                }
            }
            chkLayerIsLabeled.Checked   = true;
            chkLabelsVisible.Checked    = _shapeFile.Labels.Visible;
            chkAvoidCollision.Checked   = _shapeFile.Labels.AvoidCollisions;
            txtCollisionBuffer.Text     = _shapeFile.Labels.CollisionBuffer.ToString();
            chkRemoveDuplicates.Checked = _shapeFile.Labels.RemoveDuplicates;
            chkAutoOffset.Checked       = _shapeFile.Labels.AutoOffset;
            txtFontOffsetX.Text         = _shapeFile.Labels.OffsetX.ToString();
            txtFontOffsetY.Text         = _shapeFile.Labels.OffsetY.ToString();
            FillComboVerticalPosition(comboVerticalPosition);
            comboVerticalPosition.SelectedIndex = (int)_shapeFile.Labels.VerticalPosition;
            comboVerticalPosition.DisplayMember = "value";
            txtLabelSourceField.Text            = _shapeFile.Labels.Expression;

            //font tab
            _fontComboBox.Text         = _shapeFile.Labels.FontName;
            txtFontSize.Text           = _shapeFile.Labels.FontSize.ToString();
            txtFontTransparency.Text   = _shapeFile.Labels.FontTransparency.ToString();
            chkItalic.Checked          = _shapeFile.Labels.FontItalic;
            chkUnderline.Checked       = _shapeFile.Labels.FontUnderline;
            chkBold.Checked            = _shapeFile.Labels.FontBold;
            chkOutlineVisible.Checked  = _shapeFile.Labels.FontOutlineVisible;
            rectFontColor.FillColor    = FADColors.UintToColor(_shapeFile.Labels.FontColor);
            rectOutlineColor.FillColor = FADColors.UintToColor(_shapeFile.Labels.FontOutlineColor);
            switch (_shapeFile.Labels.Alignment)
            {
            case tkLabelAlignment.laTopLeft:
                optionTL.Checked = true;
                break;

            case tkLabelAlignment.laTopCenter:
                optionTC.Checked = true;
                break;

            case tkLabelAlignment.laTopRight:
                optionTR.Checked = true;
                break;

            case tkLabelAlignment.laCenterLeft:
                optionCL.Checked = true;
                break;

            case tkLabelAlignment.laCenter:
                optionCC.Checked = true;
                break;

            case tkLabelAlignment.laCenterRight:
                optionCR.Checked = true;
                break;

            case tkLabelAlignment.laBottomLeft:
                optionBL.Checked = true;
                break;

            case tkLabelAlignment.laBottomCenter:
                optionBC.Checked = true;
                break;

            case tkLabelAlignment.laBottomRight:
                optionBL.Checked = true;
                break;
            }

            //frame tab
            chkFrameVisible.Checked = _shapeFile.Labels.FrameVisible;
            FillComboFrameType(comboFrameType);
            comboFrameType.DisplayMember = "value";
            comboFrameType.SelectedIndex = (int)_shapeFile.Labels.FrameType;
            txtFramePaddingX.Text        = _shapeFile.Labels.FramePaddingX.ToString();
            txtFramePaddingY.Text        = _shapeFile.Labels.FramePaddingY.ToString();
            txtFrameTransparency.Text    = _shapeFile.Labels.FrameTransparency.ToString();
            txtFrameLineWidth.Text       = _shapeFile.Labels.FrameOutlineWidth.ToString();
            rectFrameLineColor.FillColor = FADColors.UintToColor(_shapeFile.Labels.FrameOutlineColor);
            rectFrameFillColor.FillColor = FADColors.UintToColor(_shapeFile.Labels.FrameBackColor);
            switch (_shapeFile.Labels.InboxAlignment)
            {
            case tkLabelAlignment.laTopLeft:
                optionFrameTL.Checked = true;
                break;

            case tkLabelAlignment.laTopCenter:
                optionFrameTC.Checked = true;
                break;

            case tkLabelAlignment.laTopRight:
                optionFrameTR.Checked = true;
                break;

            case tkLabelAlignment.laCenterLeft:
                optionFrameCL.Checked = true;
                break;

            case tkLabelAlignment.laCenter:
                optionFrameCC.Checked = true;
                break;

            case tkLabelAlignment.laCenterRight:
                optionFrameCR.Checked = true;
                break;

            case tkLabelAlignment.laBottomLeft:
                optionFrameBL.Checked = true;
                break;

            case tkLabelAlignment.laBottomCenter:
                optionFrameBC.Checked = true;
                break;

            case tkLabelAlignment.laBottomRight:
                optionFrameBR.Checked = true;
                break;
            }

            //decorations
            chkHaloVisible.Checked    = _shapeFile.Labels.HaloVisible;
            chkShadowVisible.Checked  = _shapeFile.Labels.ShadowVisible;
            rectHaloColor.FillColor   = FADColors.UintToColor(_shapeFile.Labels.HaloColor);
            rectShadowColor.FillColor = FADColors.UintToColor(_shapeFile.Labels.ShadowColor);
            txtHaloSize.Text          = _shapeFile.Labels.HaloSize.ToString();
            txtShadowOffsetX.Text     = _shapeFile.Labels.ShadowOffsetX.ToString();
            txtShadowOffsetY.Text     = _shapeFile.Labels.ShadowOffsetY.ToString();

            //visibility
            txtVisibilityExpression.Text = _shapeFile.Labels.VisibilityExpression;
        }