示例#1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Constructs a dialog for choosing, creating, modifying, and deleting Header/Footer
 /// sets
 /// </summary>
 /// <param name="cache">Cache</param>
 /// <param name="pub">The current publication</param>
 /// <param name="helpProvider">Object that gives access to help</param>
 /// <param name="protectedHFSets">List of names of H/F sets that cannot be deleted</param>
 /// <param name="hfOwner">The owner of the H/F set.</param>
 /// ------------------------------------------------------------------------------------
 public HeaderFooterSetupDlg(FdoCache cache, IPublication pub,
                             IHelpTopicProvider helpProvider, List <string> protectedHFSets, ICmMajorObject hfOwner)
 {
     m_cache           = cache;
     m_HfSetOwner      = hfOwner;
     m_pub             = pub;
     m_pubDiv          = m_pub.DivisionsOS[0];
     m_helpProvider    = helpProvider;
     m_protectedHFSets = protectedHFSets;
     Initialize();
 }
示例#2
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged
        /// resources; <c>false</c> to release only unmanaged resources.
        /// </param>
        /// -----------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            CloseRootBoxes();
            m_cache      = null;
            m_HfSetOwner = null;
            m_pub        = null;
            m_pubDiv     = null;

            base.Dispose(disposing);
        }
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged
        /// resources; <c>false</c> to release only unmanaged resources.
        /// </param>
        /// -----------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            CloseRootBoxes();
            m_cache      = null;
            m_HfSetOwner = null;
            m_pub        = null;
            m_pubDiv     = null;

            base.Dispose(disposing);
        }
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public DummyHeaderFooterSetupDlg(FdoCache cache, IPublication pub, ICmMajorObject hfOwner)
			: base(cache, pub, null, null, hfOwner)
		{
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Constructs a dialog for choosing, creating, modifying, and deleting Header/Footer
		/// sets
		/// </summary>
		/// <param name="cache">Cache</param>
		/// <param name="pub">The current publication</param>
		/// <param name="helpProvider">Object that gives access to help</param>
		/// <param name="protectedHFSets">List of names of H/F sets that cannot be deleted</param>
		/// <param name="hfOwner">The owner of the H/F set.</param>
		/// ------------------------------------------------------------------------------------
		public HeaderFooterSetupDlg(FdoCache cache, IPublication pub,
			IHelpTopicProvider helpProvider, List<string> protectedHFSets, ICmMajorObject hfOwner)
		{
			m_cache = cache;
			m_HfSetOwner = hfOwner;
			m_pub = pub;
			m_pubDiv = m_pub.DivisionsOS[0];
			m_helpProvider = helpProvider;
			m_protectedHFSets = protectedHFSets;
			Initialize();
		}
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing"><c>true</c> to release both managed and unmanaged
		/// resources; <c>false</c> to release only unmanaged resources.
		/// </param>
		/// -----------------------------------------------------------------------------------
		protected override void Dispose( bool disposing )
		{
			System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			CloseRootBoxes();
			m_cache = null;
			m_HfSetOwner = null;
			m_pub = null;
			m_pubDiv = null;

			base.Dispose( disposing );
		}
 /// ------------------------------------------------------------------------------------
 /// <summary>
 ///
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public DummyHeaderFooterSetupDlg(FdoCache cache, IPublication pub, ICmMajorObject hfOwner)
     : base(cache, pub, null, null, hfOwner)
 {
 }
示例#8
0
        private bool HasListNameChanged(ICmMajorObject list)
        {
            var oldstrings = list.Name;

            return(HasMsContentChanged(oldstrings, m_lmscListName));
        }
示例#9
0
        private bool HasDescriptionChanged(ICmMajorObject list)
        {
            var oldstrings = list.Description;

            return(HasMsContentChanged(oldstrings, m_lmscDescription));
        }
示例#10
0
		private bool HasListNameChanged(ICmMajorObject list)
		{
			var oldstrings = list.Name;
			return HasMsContentChanged(oldstrings, m_lmscListName);
		}
示例#11
0
		private bool HasDescriptionChanged(ICmMajorObject list)
		{
			var oldstrings = list.Description;
			return HasMsContentChanged(oldstrings, m_lmscDescription);
		}
示例#12
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:PageSetupDlg"/> class.
		/// </summary>
		/// <param name="pgLayout">The page layout.</param>
		/// <param name="pubOwner">The CmMajorObject that owns the publication.</param>
		/// <param name="publication">The publication.</param>
		/// <param name="division">The division. The NumColumns in the division should be
		/// set before calling this dialog.</param>
		/// <param name="callbacks">The callbacks used to get application-specific settings.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="app">The app</param>
		/// <param name="pubPageSizes">The page sizes available for publication.</param>
		/// ------------------------------------------------------------------------------------
		public PageSetupDlg(IPubPageLayout pgLayout, ICmMajorObject pubOwner,
			IPublication publication, IPubDivision division, IPageSetupCallbacks callbacks,
			IHelpTopicProvider helpTopicProvider, IApp app, List<PubPageInfo> pubPageSizes) : this()
		{
			m_pubOwner = pubOwner;
			m_publication = publication;
			m_division = division;
			m_pgLayout = pgLayout;
			m_callbacks = callbacks;
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;

			InitializePaperSizes();

			MsrSysType units = app.MeasurementSystem;
			m_udmTop.MeasureType = units;
			m_udmLeft.MeasureType = units;
			m_udmBottom.MeasureType = units;
			m_udmRight.MeasureType = units;
			m_udmGutter.MeasureType = units;
			m_udmPaperWidth.MeasureType = units;
			m_udmPaperWidth.UseVariablePrecision = true;
			m_udmPaperHeight.MeasureType = units;
			m_udmPaperHeight.UseVariablePrecision = true;
			m_udmHeader.MeasureType = units;
			m_udmFooter.MeasureType = units;

			m_udmTop.MeasureValue = pgLayout.MarginTop;
			m_udmLeft.MeasureValue = pgLayout.MarginInside;
			m_udmBottom.MeasureValue = pgLayout.MarginBottom;
			m_udmRight.MeasureValue = pgLayout.MarginOutside;
			m_udmGutter.MeasureValue = publication.GutterMargin;

			//REVIEW: Do we need to call UpdateMarginControls?
			m_numColumns = m_division.NumColumns;

			m_fBookFoldCurrent = publication.IsLandscape;

			//if (m_fBookFoldCurrent)
			//{
			//    pbBookFold.Image = ResourceHelper.BookFoldSelectedIcon;
			//    pbDraft.Image = ResourceHelper.PortraitIcon;
			//    pnlDraftOptions.Visible = false;
			//    pnlBookFoldOptions.Visible = true;

			//}
			//else // Draft
			//{
			//    pbBookFold.Image = ResourceHelper.BookFoldIcon;
			//    pbDraft.Image = ResourceHelper.PortraitSelectedIcon;
			//    pnlDraftOptions.Visible = true;
			//    pnlBookFoldOptions.Visible = false;
			//}

			//rdoSingleSide.Checked = true;
			//rdoDoubleSide.Checked = false;

			if (pubPageSizes != null && pubPageSizes.Count > 0)
			{
				cboPubPageSize.Items.Clear();
				foreach (PubPageInfo pubPgInfo in pubPageSizes)
				{
					cboPubPageSize.Items.Add(pubPgInfo);
					if (publication.PageHeight == pubPgInfo.Height &&
						publication.PageWidth == pubPgInfo.Width)
					{
						cboPubPageSize.SelectedItem = pubPgInfo;
					}
				}
			}
			else
				cboPubPageSize.SelectedIndex = 0;

			int mptPaperHeight = publication.PaperHeight;
			int mptPaperWidth = publication.PaperWidth;
			if (mptPaperHeight == 0)
			{
				m_fSavePaperSize = false;
				Debug.Assert(mptPaperWidth == 0);
				PrinterUtils.GetDefaultPaperSizeInMp(out mptPaperHeight, out mptPaperWidth);
			}
			else
				m_fSavePaperSize = true;

			// Find the paper size in the combo box.
			foreach (PaperSize size in cbPaperSize.Items)
			{
				if (size.Height * kCentiInchToMilliPoints == mptPaperHeight &&
					size.Width * kCentiInchToMilliPoints == mptPaperWidth)
				{
					cbPaperSize.SelectedItem = size;
				}
			}

			m_udmPaperWidth.MeasureValue = mptPaperWidth;
			m_udmPaperHeight.MeasureValue = mptPaperHeight;
			AdjustPaperSize(mptPaperWidth, mptPaperHeight);

			foreach (PubPageInfo pubPgInfo in cboPubPageSize.Items)
			{
				if (pubPgInfo.Height == m_publication.PageHeight &&
					pubPgInfo.Width == m_publication.PageWidth)
				{
					cboPubPageSize.SelectedItem = pubPgInfo;
					break;
				}
			}

			m_cbBookStart.SelectedIndex = (int)m_division.StartAt;
			m_ckbDiffEvenHF.Checked = m_division.DifferentEvenHF;
			m_ckbDiffFirstHF.Checked = m_division.DifferentFirstHF;
			m_udmHeader.MeasureValue = pgLayout.PosHeader;
			m_udmFooter.MeasureValue = pgLayout.PosFooter;
			switch (publication.FootnoteSepWidth)
			{
				case 0:
					m_cboSeparator.SelectedIndex = kFootnoteSepWidthNone;
					break;
				case 333:
					m_cboSeparator.SelectedIndex = kFootnoteSepWidthThird;
					break;
				case 1000:
					m_cboSeparator.SelectedIndex = kFootnoteSepWidthFull;
					break;
				default:
					Debug.Assert(false, "non-default footnote seperator width");
					m_cboSeparator.SelectedIndex = -1;
					break;
			}

			m_fChangingIndex = false;

			// Initialize dialog settings from the publication.
			NumberOfColumns = m_division.NumColumns;
			UpdateColumnButtonStates();

			SetFontSizeAndLineSpacing = true;
			if (PublicationUsesNormalStyle)
			{
				SetDefaultBaseFontAndLineSizes();
			}
			else
			{
				// In the unlikely event that the publication has a default value for one but not
				// both of these values, set the leading to the default percentage and set the
				// implicit value based on the explicit one.

				// Use the absolute value because we only support "exact" line spacing
				decimal mptPubBaseLineSpacing = (decimal)Math.Abs(publication.BaseLineSpacing);
				m_leadingFactor = (publication.BaseFontSize == 0 || publication.BaseLineSpacing == 0) ?
					StandardLeadingFactor : mptPubBaseLineSpacing / publication.BaseFontSize;

				SetBaseCharacterSize(publication.BaseFontSize);
				SetBaseLineSpacing(mptPubBaseLineSpacing);
				if (publication.BaseFontSize == 0)
					SetBaseCharacterSize(BaseLineSpacing / m_leadingFactor);
				else if (publication.BaseLineSpacing == 0)
					SetBaseLineSpacing(BaseCharacterSize * m_leadingFactor);

				m_fSaveBaseFontAndLineSizes = true;
			}
			SetFontSizeAndLineSpacing = false;

			m_chkNonStdChoices.Checked = !FollowsStandardSettings;
			UpdateTextSizeCtlStatus();
		}
示例#13
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing"><c>true</c> to release both managed and unmanaged
		/// resources; <c>false</c> to release only unmanaged resources.
		/// </param>
		/// -----------------------------------------------------------------------------------
		protected override void Dispose( bool disposing )
		{
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			CloseRootBoxes();
			m_cache = null;
			m_HfSetOwner = null;
			m_pub = null;
			m_pubDiv = null;

			base.Dispose( disposing );
		}