2 // System.Windows.Forms.FontDialog.cs
5 // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
6 // Dennis Hayes (dennish@raytek.com)
7 // Implemented by Jordi Mas i Hernàndez (jmas@softcatala.org)
9 // (C) 2002-2003 Ximian, Inc
12 using System
.Runtime
.InteropServices
;
13 namespace System
.Windows
.Forms
15 public class FontDialog
: CommonDialog
{
16 private bool bAllowScriptChange
;
17 private bool bAllowSimulations
;
18 private bool bAllowVectorFonts
;
19 private bool bAllowVerticalFonts
;
20 private Color color
= Color
.Black
;
21 private bool bFixedPitchOnly
;
23 private bool bFontMustExist
;
26 private bool bScriptsOnly
;
27 private bool bShowApply
;
28 private bool bShowColor
;
29 private bool bShowEffects
;
30 private bool bShowHelp
;
32 protected static readonly object EventApply
;
41 internal void defaultValues(){
42 font
= new Font("Microsoft Sans Serif", 8);
43 bAllowScriptChange
= true;
44 bAllowSimulations
= true;
45 bAllowVectorFonts
= true;
46 bAllowVerticalFonts
= true;
48 bFixedPitchOnly
= false;
49 bFontMustExist
= false;
60 // --- Public Properties
62 public bool AllowScriptChange
{
63 get { return bAllowScriptChange; }
64 set { bAllowScriptChange = value; }
67 public bool AllowSimulations
{
68 get { return bAllowSimulations; }
69 set { bAllowSimulations = value; }
72 public bool AllowVectorFonts
{
73 get { return bAllowVectorFonts; }
74 set { bAllowVectorFonts = value; }
77 public bool AllowVerticalFonts
{
78 get { return bAllowVerticalFonts; }
79 set { bAllowVerticalFonts = value; }
84 set { color = value; }
87 public bool FixedPitchOnly
{
88 get { return bFixedPitchOnly; }
89 set { bFixedPitchOnly = value; }
97 public bool FontMustExist
{
98 get { return bFontMustExist; }
99 set { bFontMustExist = value; }
103 get { return nMaxSize; }
104 set { nMaxSize = value; }
108 get { return nMinSize; }
109 set { nMinSize = value; }
112 public bool ScriptsOnly
{
113 get { return bScriptsOnly; }
114 set { bScriptsOnly = value; }
117 public bool ShowApply
{
118 get { return bShowApply; }
119 set { bShowApply = value; }
122 public bool ShowColor
{
123 get { return bShowColor; }
124 set { bShowColor = value; }
127 public bool ShowEffects
{
128 get { return bShowEffects; }
129 set { bShowEffects = value; }
132 public bool ShowHelp
{
133 get { return bShowHelp; }
134 set { bShowHelp = value; }
138 // --- Public Methods
139 public override void Reset(){
143 public override string ToString(){
144 return base.ToString();
147 protected virtual void OnApply(EventArgs e
){
155 public event EventHandler Apply
;
159 protected override bool RunDialog(IntPtr hWndOwner
){
164 internal override Gtk
.Dialog
CreateDialog(){
165 return new Gtk
.FontSelectionDialog("");