C# Class SIL.FieldWorks.Common.PrintLayout.PageSetupDlg

Summary description for PageSetupDlg.
Inheritance: System.Windows.Forms.Form, IFWDisposable, IPageSetupDialog
Mostrar archivo Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
cbPaperSize SIL.FieldWorks.Common.Controls.FwOverrideComboBox
cboPubPageSize System.Windows.Forms.ComboBox
m_chkNonStdChoices System.Windows.Forms.CheckBox
m_fSaveBaseFontAndLineSizes bool
m_fSetFontSizeAndLineSpacing bool
m_nudBaseCharSize System.Windows.Forms.NumericUpDown
m_nudLineSpacing System.Windows.Forms.NumericUpDown
m_udmBottom SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmGutter SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmLeft SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmPaperHeight SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmPaperWidth SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmRight SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl
m_udmTop SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

Public Methods

Method Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

HideAllowNonStandardChoicesOption ( ) : void

Sets a value indicating whether the "Allow Non-standard Choices" checkbox is visible.

PageSetupDlg ( ) : System

Page Setup Dialog

PageSetupDlg ( IPubPageLayout pgLayout, ICmMajorObject pubOwner, IPublication publication, IPubDivision division, IPageSetupCallbacks callbacks, IHelpTopicProvider helpTopicProvider, IApp app, List pubPageSizes ) : System

Initializes a new instance of the T:PageSetupDlg class.

SetDefaultBaseFontAndLineSizes ( ) : void

Sets the default size of the base character and line spacing in millipoints. This is used when the current publication does not specify specific values (i.e., its BaseFontSize and BaseLineSpacing == 0).

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

SnapValueToRange ( decimal min, decimal max, decimal value ) : decimal

Ensures that the given value falls within the specified range. If the value is below the minimum, we return the minimum. If it is above the maximum, we return the maximum. Otherwise, we just return the given value.

UpdateBaseSizeControlsMinAndMax ( ) : void

Updates the min and max values for the base font size and line spacing controls.

UpdateMarginControls ( ) : void

Updates the margin controls. The current implementation does what TE needs. If this proves useless for other apps, this logic should be moved into the TE-specific subclass.

ValidateDialogSettings ( ) : PageSetupErrorType

Validates the dialog settings.

Private Methods

Method Description
AddPaperSize ( string paperName, int width, int height ) : void

Adds the size of the paper.

AdjustPaperSize ( int mptWidth, int mptHeight ) : void

Adjust the paper orientation to portrait or landscape to match the paper width and paper height. And adjust the paper size selection to match the paper width and paper height.

AdjustPaperSizePreview ( ) : void

Adjusts the paper size preview panel.

Approx ( int mptSize, int mptStd ) : bool

Returns true if the given size is within 5000 millipoints of the standard.

Approx ( int size, int std, int threshold ) : bool

Returns true if the given size is within the standard.

ColumnButton_Click ( object sender, EventArgs e ) : void

Handles the Click event of the One/Two Column controls.

DisplayErrorMessage ( PageSetupErrorType error ) : void

Displays the error message.

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializePaperSizes ( ) : void

Gets a list of default paper sizes for a FieldWorks application.

SaveDialogSettings ( ) : void

Saves the settings on the dialog in the database.

ScaleFontSize ( ) : void

Updates the base font size to keep it scaled consistently with the line spacing.

REVIEW: This seems to be app-specific with the use of PubPageSizeType

ScaleLineSpacing ( ) : void

Updates the base line spacing to maintain scaling consistent with character size.

SetBaseCharacterSize ( decimal value ) : void

Sets the size of the base character, snapping it to be within the minimum/maximum range.

SetBaseLineSpacing ( decimal value ) : void

Sets the base (normal) line spacing, snapping it to be within the minimum/maximum range.

SetNumberOfColumns ( int numberOfColumns ) : void

Sets the number of columns.

UpdateColumnButtonStates ( ) : void

Updates the column button images to reflect the number of columns.

UpdateTextSizeCtlStatus ( ) : void

Updates the enabled status of the text size controls.

btnHeaderFooter_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnHeaderFooter control.

btnOneColumn_PreviewKeyDown ( object sender, PreviewKeyDownEventArgs e ) : void

Handles the PreviewKeyDown event of the btnOneColumn control. Used to treat a right-arrow as a click on the other column button.

btnTwoColumn_PreviewKeyDown ( object sender, PreviewKeyDownEventArgs e ) : void

Handles the PreviewKeyDown event of the btnTwoColumn control. Used to treat a left-arrow as a click on the other column button.

cbPaperSize_SelectedIndexChanged ( object sender, System e ) : void

Called when the paper size is changed.

cboPubPageSize_SelectedIndexChanged ( object sender, EventArgs e ) : void

Handles the SelectedIndexChanged event of the cboPubPageSize control.

m_btnHelp_Click ( object sender, System e ) : void

Show help for this dialog.

m_btnOK_Click ( object sender, EventArgs e ) : void

Handles the Click event of the m_btnOK control.

m_chkNonStdChoices_CheckedChanged ( object sender, EventArgs e ) : void

Handles the CheckedChanged event of the m_chkNonStdChoices control.

m_nudBaseCharSize_ValueChanged ( object sender, EventArgs e ) : void

Handles the ValueChanged event of the m_nudBaseCharSize control.

m_nudLineSpacing_ValueChanged ( object sender, EventArgs e ) : void

Handles the ValueChanged event of the m_nudLineSpacing control.

m_udmBottom_Click ( object sender, EventArgs e ) : void

Handles the Click event of the m_udmBottom control.

m_udmBottom_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmBottom control.

m_udmFooter_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmFooter control.

m_udmGutter_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmGutter control.

m_udmHeader_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmHeader control.

m_udmLeft_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmLeft control.

m_udmPaperWidthOrHeight_Changed ( object sender, System e ) : void

Called when the paper width is changed

m_udmRight_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmRight control.

m_udmTop_TextChanged ( object sender, EventArgs e ) : void

Handles the TextChanged event of the m_udmTop control.

panelPreview_Paint ( object sender, PaintEventArgs e ) : void
pbBookFold_Click ( object sender, System e ) : void

Handles the Click event of the pbBookFold control.

pbDraft_Click ( object sender, System e ) : void

Handles the Click event of the pbDraft control.

Method Details

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
return void

HideAllowNonStandardChoicesOption() public method

Sets a value indicating whether the "Allow Non-standard Choices" checkbox is visible.
public HideAllowNonStandardChoicesOption ( ) : void
return void

PageSetupDlg() public method

Page Setup Dialog
public PageSetupDlg ( ) : System
return System

PageSetupDlg() public method

Initializes a new instance of the T:PageSetupDlg class.
public PageSetupDlg ( IPubPageLayout pgLayout, ICmMajorObject pubOwner, IPublication publication, IPubDivision division, IPageSetupCallbacks callbacks, IHelpTopicProvider helpTopicProvider, IApp app, List pubPageSizes ) : System
pgLayout IPubPageLayout The page layout.
pubOwner ICmMajorObject The CmMajorObject that owns the publication.
publication IPublication The publication.
division IPubDivision The division. The NumColumns in the division should be /// set before calling this dialog.
callbacks IPageSetupCallbacks The callbacks used to get application-specific settings.
helpTopicProvider IHelpTopicProvider The help topic provider.
app IApp The app
pubPageSizes List The page sizes available for publication.
return System

SetDefaultBaseFontAndLineSizes() public method

Sets the default size of the base character and line spacing in millipoints. This is used when the current publication does not specify specific values (i.e., its BaseFontSize and BaseLineSpacing == 0).
public SetDefaultBaseFontAndLineSizes ( ) : void
return void

SnapValueToRange() protected method

Ensures that the given value falls within the specified range. If the value is below the minimum, we return the minimum. If it is above the maximum, we return the maximum. Otherwise, we just return the given value.
protected SnapValueToRange ( decimal min, decimal max, decimal value ) : decimal
min decimal The minimum value allowed.
max decimal The maximum value allowed.
value decimal The value.
return decimal

UpdateBaseSizeControlsMinAndMax() protected method

Updates the min and max values for the base font size and line spacing controls.
protected UpdateBaseSizeControlsMinAndMax ( ) : void
return void

UpdateMarginControls() protected method

Updates the margin controls. The current implementation does what TE needs. If this proves useless for other apps, this logic should be moved into the TE-specific subclass.
protected UpdateMarginControls ( ) : void
return void

ValidateDialogSettings() protected method

Validates the dialog settings.
protected ValidateDialogSettings ( ) : PageSetupErrorType
return PageSetupErrorType

Property Details

cbPaperSize protected_oe property

Combo box containing the list of possible paper sizes
protected FwOverrideComboBox,SIL.FieldWorks.Common.Controls cbPaperSize
return SIL.FieldWorks.Common.Controls.FwOverrideComboBox

cboPubPageSize protected_oe property

combobox which contains the list of possible publication page sizes
protected ComboBox,System.Windows.Forms cboPubPageSize
return System.Windows.Forms.ComboBox

m_chkNonStdChoices protected_oe property

Check box that allows the user to make choices that don't follow iPub standards.
protected CheckBox,System.Windows.Forms m_chkNonStdChoices
return System.Windows.Forms.CheckBox

m_fSaveBaseFontAndLineSizes protected_oe property

Flag to save base font and line height sizes (if changed)
protected bool m_fSaveBaseFontAndLineSizes
return bool

m_fSetFontSizeAndLineSpacing protected_oe property

Flag that indictes both font size and line spacing are being set to default values, so do not adjust line spacing to maintain leading.
protected bool m_fSetFontSizeAndLineSpacing
return bool

m_nudBaseCharSize protected_oe property

numeric up-down control for setting the base character size
protected NumericUpDown,System.Windows.Forms m_nudBaseCharSize
return System.Windows.Forms.NumericUpDown

m_nudLineSpacing protected_oe property

numeric up-down control for setting the line spacing
protected NumericUpDown,System.Windows.Forms m_nudLineSpacing
return System.Windows.Forms.NumericUpDown

m_udmBottom protected_oe property

up-down measure control for the bottom margin
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmBottom
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmGutter protected_oe property

up-down measure control for the gutter
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmGutter
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmLeft protected_oe property

up-down measure control for the inside margin
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmLeft
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmPaperHeight protected_oe property

current paper height
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmPaperHeight
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmPaperWidth protected_oe property

current paper width
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmPaperWidth
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmRight protected_oe property

up-down measure control for the outside margin
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmRight
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl

m_udmTop protected_oe property

up-down measure control for the top margin
protected SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl m_udmTop
return SIL.FieldWorks.FwCoreDlgControls.UpDownMeasureControl