コード例 #1
0
 public void Apply()
 {
     if (this.m_IsPageDirty)
     {
         this.m_IsPageDirty = false;
         IGridLadderLabels pMapGrid        = GridAxisPropertyPage.m_pMapGrid as IGridLadderLabels;
         stdole.IFontDisp  ladderLabelFont = pMapGrid.LadderLabelFont;
         if (this.cboFontName.SelectedIndex != -1)
         {
             ladderLabelFont.Name = this.cboFontName.Text;
         }
         ladderLabelFont.Bold      = this.chkBold.Checked;
         ladderLabelFont.Italic    = this.chkIta.Checked;
         ladderLabelFont.Underline = this.chkUnderLine.Checked;
         pMapGrid.LadderLabelFont  = ladderLabelFont;
         try
         {
             pMapGrid.LadderLabelSize = double.Parse(this.cboFontSize.Text);
         }
         catch
         {
         }
         IColor ladderLabelColor = pMapGrid.LadderLabelColor;
         this.UpdateColorFromColorEdit(this.colorEdit1, ladderLabelColor);
         pMapGrid.LadderLabelColor       = ladderLabelColor;
         pMapGrid.LadderLabelColumnCount = (int)this.txtColumnCount.Value;
         pMapGrid.LadderLabelRowCount    = (int)this.txtRowCount.Value;
         pMapGrid.ShowLadderLabels       = this.chkShowLadderLabels.Checked;
         pMapGrid.ShowOuterLabelsOnly    = this.chkShowOuterLabelsOnly.Checked;
         IMgrsGrid grid = GridAxisPropertyPage.m_pMapGrid as IMgrsGrid;
         ladderLabelFont = grid.GridSquareLabelFont;
         if (this.cboGSLFontName.SelectedIndex != -1)
         {
             ladderLabelFont.Name = this.cboGSLFontName.Text;
         }
         ladderLabelFont.Bold      = this.chkBold_GSL.Checked;
         ladderLabelFont.Italic    = this.chkIta_GSL.Checked;
         ladderLabelFont.Underline = this.chkUnderLine_GSL.Checked;
         grid.GridSquareLabelFont  = ladderLabelFont;
         try
         {
             grid.GridSquareLabelSize = double.Parse(this.cboGSLFontsize.Text);
         }
         catch
         {
         }
         ladderLabelColor = grid.GridSquareLabelColor;
         this.UpdateColorFromColorEdit(this.colorEdit2, ladderLabelColor);
         grid.GridSquareLabelColor      = ladderLabelColor;
         grid.ShowGridSquareIdentifiers = this.chkShowGSIdentifiers.Checked;
         grid.GridSquareBoundarySymbol  = this.btnBorder.Style as ILineSymbol;
         grid.GridSquareLabelStyle      = (esriGridSquareLabelStyleEnum)this.cboGSLStyle.SelectedIndex;
         grid.InteriorTickSymbol        = this.btnTickSymbol.Style as ILineSymbol;
         grid.InteriorTickLength        = (double)this.txtTickLength.Value;
         this.m_CanDo = true;
     }
 }
コード例 #2
0
        private void MGRSPropertyPage_Load(object sender, EventArgs e)
        {
            int num;
            IGridLadderLabels pMapGrid = GridAxisPropertyPage.m_pMapGrid as IGridLadderLabels;
            string            name     = pMapGrid.LadderLabelFont.Name;

            for (num = 0; num < this.cboFontName.Items.Count; num++)
            {
                if (name == this.cboFontName.Items[num].ToString())
                {
                    this.cboFontName.SelectedIndex = num;
                    break;
                }
            }
            this.cboFontSize.Text     = pMapGrid.LadderLabelSize.ToString();
            this.chkBold.Checked      = pMapGrid.LadderLabelFont.Bold;
            this.chkIta.Checked       = pMapGrid.LadderLabelFont.Italic;
            this.chkUnderLine.Checked = pMapGrid.LadderLabelFont.Underline;
            this.SetColorEdit(this.colorEdit1, pMapGrid.LadderLabelColor);
            this.txtColumnCount.Value           = pMapGrid.LadderLabelColumnCount;
            this.txtRowCount.Value              = pMapGrid.LadderLabelRowCount;
            this.chkShowLadderLabels.Checked    = pMapGrid.ShowLadderLabels;
            this.chkShowOuterLabelsOnly.Checked = pMapGrid.ShowOuterLabelsOnly;
            IMgrsGrid grid = GridAxisPropertyPage.m_pMapGrid as IMgrsGrid;

            name = grid.GridSquareLabelFont.Name;
            for (num = 0; num < this.cboGSLFontName.Items.Count; num++)
            {
                if (name == this.cboGSLFontName.Items[num].ToString())
                {
                    this.cboGSLFontName.SelectedIndex = num;
                    break;
                }
            }
            this.cboGSLFontsize.Text      = grid.GridSquareLabelSize.ToString();
            this.chkBold_GSL.Checked      = grid.GridSquareLabelFont.Bold;
            this.chkIta_GSL.Checked       = grid.GridSquareLabelFont.Italic;
            this.chkUnderLine_GSL.Checked = grid.GridSquareLabelFont.Underline;
            this.SetColorEdit(this.colorEdit2, grid.GridSquareLabelColor);
            this.chkShowGSIdentifiers.Checked = grid.ShowGridSquareIdentifiers;
            this.btnBorder.Style           = grid.GridSquareBoundarySymbol;
            this.cboGSLStyle.SelectedIndex = (int)grid.GridSquareLabelStyle;
            this.btnTickSymbol.Style       = grid.InteriorTickSymbol;
            this.txtTickLength.Value       = (decimal)grid.InteriorTickLength;
            this.m_CanDo = true;
        }