Esempio n. 1
0
	private void btnCalculateNumberOfLines_Click(System.Object sender, System.EventArgs e)
	{
		Main.dLineHeightInPoints = (int)NumericUpDownLineHeight.Value;
        Main.dMarginTopInPoints = (int)NumericUpDownTopMarginInPoints.Value;
		Main.dMarginBottomInPoints = NumericUpDownBottomMarginInPoints.Value;
        Main.dPageHeightInPoints = decimal.Parse(tbPageHeightInPoints.Text);
		int dMargins = (int) (Main.dMarginTopInPoints + Main.dMarginBottomInPoints);
		Main.sColumnHeightInPoints = (Main.dPageHeightInPoints - dMargins).ToString();
		Main.sColumnHeightInLines = (decimal.Parse(Main.sColumnHeightInPoints) / Main.dLineHeightInPoints).ToString();
		tbColumnHeightInLines.Text = Main.sColumnHeightInLines;
        Main main = new Main();
		main.writeIniFile();
	}
Esempio n. 2
0
	private void calculateColumnWidthInPoints()
	{
		Main.iNumberOfColumns = (int)NumericUpDownNumberOfColumns.Value;
		Main.dColumnGapInPoints = NumericUpDownColumnGapInPoints.Value;
		if (NumericUpDownNumberOfColumns.Value < 2) {
			// if for some reason it thinks it is zero reset it to 1
			Main.iNumberOfColumns = 1;
			Main.dColumnGapInPoints = 0;
		} else {
			if (Main.dColumnGapInPoints < 3) {
				Main.dColumnGapInPoints = 3;
			} else {
				//skip
			}
		}
		// Main.iNumberOfColumns = NumericUpDownNumberOfColumns.Value
		// Main.dColumnGapInPoints = NumericUpDownColumnGapInPoints.Value
		NumericUpDownNumberOfColumns.Value = Main.iNumberOfColumns;
		NumericUpDownColumnGapInPoints.Value = Main.dColumnGapInPoints;
		Main.dMarginLeftInPoints = NumericUpDownLeftMarginPoints.Value;
		Main.dMarginRightInPoints = NumericUpDownRightMarginInPoints.Value;

		// If Main.iNumberOfColumns > 1 Then
		// If Main.dColumnGapInPoints < 3 Then
		// Main.dColumnGapInPoints = 3
		// Else
		// 'skip
		// End If
		// Else
		//Main.dColumnGapInPoints = 0
		//End If
		//NumericUpDownColumnGapInPoints.Value = Main.dColumnGapInPoints
		int dMarginsAndGap =(int)(Main.dColumnGapInPoints + Main.dMarginLeftInPoints + Main.dMarginRightInPoints);
		Main.dColumnWidthInPoints = (Main.dPageWidthInPoints - dMarginsAndGap) / Main.iNumberOfColumns;
		tbColumnWidthInPoints.Text = Main.dColumnWidthInPoints.ToString();
        Main main = new Main();

        main.writeIniFile();
	}
Esempio n. 3
0
	private void calculateNumberOfLines()
	{
		Main.dMarginTopInPoints = NumericUpDownTopMarginInPoints.Value;
		Main.dMarginBottomInPoints = NumericUpDownBottomMarginInPoints.Value;
		if (Main.iNumberOfColumns > 1) {
			if (Main.dColumnGapInPoints < 3) {
				Main.dColumnGapInPoints = 3;
			} else {
				//skip
			}
		} else {
			Main.dColumnGapInPoints = 0;
		}
		NumericUpDownColumnGapInPoints.Value = Main.dColumnGapInPoints;
		Main.dColumnWidthInPoints = (Main.dPageWidthInPoints - (Main.dColumnGapInPoints + Main.dMarginLeftInPoints + Main.dMarginRightInPoints)) / Main.iNumberOfColumns;
		tbColumnWidthInPoints.Text = Main.dColumnWidthInPoints.ToString();
        Main main = new Main();
        main.writeIniFile();
	}
Esempio n. 4
0
	private void btnOK_Click(System.Object sender, System.EventArgs e)
	{
		// calculate and save line height and column width in points
		//   Main.dColumnWidthInPoints = picture.convertUnitsToPoints(Me.lbInputUnits.SelectedItem, Me.tbColumnWidth.Text)
		//  Main.sLineHeightInPoints = picture.convertUnitsToPoints(Me.lbLineHeightUnits.SelectedItem, Me.NumericUpDownLineHeight.Value)
        Main main = new Main();

		main.writeIniFile();
		this.Close();

	}