source: Scheduling/trunk/cs/EnhancedPrintPreview/PrintPreview/AdditionalText.cs@ 1654

Last change on this file since 1654 was 1246, checked in by Sam Habiel, 13 years ago

Adding Enhanced Print Preview to Repo

File size: 2.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Drawing;
5using System.ComponentModel;
6
7namespace VR.PrintPreview {
8 public enum TextPosition {
9 HTopLeft, HTopCenter, HTopRight,
10 HBottomLeft, HBottomCenter, HBottomRight,
11 VTopLeft, VMiddleLeft, VBottomLeft,
12 VTopRight, VMiddleRight, VBottomRight,
13 WaterMark
14 }
15
16 public class AdditionalText {
17 private string text;
18 private Font font;
19 private Brush brush;
20 private TextPosition position;
21 private int offsetX = 0;
22 private int offsetY = 0;
23
24 public string Text {
25 get { return text; }
26 set { text = value; }
27 }
28
29 public Font Font {
30 get { return font; }
31 set { font = value; }
32 }
33
34 [Browsable(false)]
35 public Brush Brush {
36 get { return brush; }
37 set { brush = value; }
38 }
39
40 public TextPosition Position {
41 get { return position; }
42 set { position = value; }
43 }
44
45 public int OffsetX {
46 get { return offsetX; }
47 set { offsetX = value; }
48 }
49
50 public int OffsetY {
51 get { return offsetY; }
52 set { offsetY = value; }
53 }
54
55 public Color Color {
56 get { return (brush is SolidBrush) ? ((SolidBrush)brush).Color : Color.Black; }
57 set { brush = new SolidBrush(value); }
58 }
59
60
61 public AdditionalText(string text, Font font, Brush brush, TextPosition position, int offsetX, int offsetY) {
62 this.text = text;
63 this.font = (font != null) ? font : new Font("Arial", 12f);
64 this.brush = (brush != null) ? brush : Brushes.Gray;
65 this.position = position;
66 this.offsetX = offsetX;
67 this.offsetY = offsetY;
68 }
69
70 public AdditionalText(string text, TextPosition position) : this(text, null, null, position, 0, 0) { }
71
72 public AdditionalText(string text, TextPosition position, int offsetX, int offsetY) : this(text, null, null, position, offsetX, offsetY) { }
73
74 public AdditionalText(string text) : this(text, null, null, TextPosition.HBottomCenter, 0, 0) { }
75
76 }
77}
Note: See TracBrowser for help on using the repository browser.