CraftSynth.ImageEditor – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System;
2 using System.Drawing;
3 using System.Windows.Forms;
4  
5 namespace CraftSynth.ImageEditor
6 {
7 public partial class TextDialog : Form
8 {
9 public TextDialog()
10 {
11 InitializeComponent();
12 }
13  
14 private string _text;
15  
16 public string TheText
17 {
18 get { return _text; }
19 set { _text = value; }
20 }
21  
22 private Font _font;
23  
24 public Font TheFont
25 {
26 get { return _font; }
27 set { _font = value; }
28 }
29  
30 private Color _color;
31  
32 public Color TheColor
33 {
34 get { return _color; }
35 set { _color = value; }
36 }
37  
38 private float _zoom = 1;
39  
40 public float Zoom
41 {
42 get { return _zoom; }
43 set { _zoom = value; }
44 }
45  
46 private void TextDialog_Load(object sender, EventArgs e)
47 {
48 this.Height = this.txtTheText.Height + 100;
49 this.txtTheText.Font = new Font(_font.FontFamily, _font.Size*this.Zoom, _font.Style);
50 this.txtTheText.ForeColor = _color;
51 this.txtTheText.Text = _text;
52 this.txtTheText.SelectAll();
53 this.Height = this.txtTheText.Height + 100;
54 }
55  
56 private void btnFont_Click(object sender, EventArgs e)
57 {
58 dlgFont.Font = _font;
59 dlgFont.Color = _color;
60 dlgFont.AllowSimulations = true;
61 dlgFont.AllowVectorFonts = true;
62 dlgFont.AllowVerticalFonts = true;
63 dlgFont.MaxSize = 200;
64 dlgFont.MinSize = 4;
65 dlgFont.ShowApply = false;
66 dlgFont.ShowColor = true;
67 dlgFont.ShowEffects = true;
68 if (dlgFont.ShowDialog() == DialogResult.OK)
69 {
70 _font = dlgFont.Font;
71 _color = dlgFont.Color;
72 this.txtTheText.Font = new Font(_font.FontFamily, _font.Size*this.Zoom, _font.Style);
73 txtTheText.ForeColor = _color;
74 this.Height = this.txtTheText.Height + 100;
75 }
76 }
77  
78 private void btnOK_Click(object sender, EventArgs e)
79 {
80 _text = txtTheText.Text;
81  
82 }
83  
84 private void TextDialog_ResizeEnd(object sender, EventArgs e)
85 {
86 this.Height = this.txtTheText.Height + 100;
87 }
88 }
89 }