PageRenderTime 69ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/src/ToolConfigStrip.cs

https://bitbucket.org/tcz001/openpdn
C# | 3124 lines | 2471 code | 428 blank | 225 comment | 225 complexity | 3fcd10914ff97202e869d92fec081adf MD5 | raw file
Possible License(s): Unlicense

Large files files are truncated, but you can click here to view the full file

  1. /////////////////////////////////////////////////////////////////////////////////
  2. // Paint.NET //
  3. // Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors. //
  4. // Portions Copyright (C) Microsoft Corporation. All Rights Reserved. //
  5. // See src/Resources/Files/License.txt for full licensing and attribution //
  6. // details. //
  7. // . //
  8. /////////////////////////////////////////////////////////////////////////////////
  9. using PaintDotNet.SystemLayer;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Drawing;
  14. using System.Drawing.Drawing2D;
  15. using System.Globalization;
  16. using System.Text;
  17. using System.Threading;
  18. using System.Windows.Forms;
  19. namespace PaintDotNet
  20. {
  21. // TODO: for 4.0, refactor into smaller ToolConfigStrip "Sections"
  22. // better yet, use IndirectUI
  23. internal class ToolConfigStrip
  24. : ToolStripEx,
  25. IBrushConfig,
  26. IShapeTypeConfig,
  27. IPenConfig,
  28. IAntiAliasingConfig,
  29. IAlphaBlendingConfig,
  30. ITextConfig,
  31. IToleranceConfig,
  32. IColorPickerConfig,
  33. IGradientConfig,
  34. IResamplingConfig,
  35. ISelectionCombineModeConfig,
  36. IFloodModeConfig,
  37. ISelectionDrawModeConfig
  38. {
  39. private ToolBarConfigItems toolBarConfigItems = ToolBarConfigItems.None;
  40. private EnumLocalizer hatchStyleNames = EnumLocalizer.Create(typeof(HatchStyle));
  41. private string solidBrushText;
  42. private ImageResource shapeOutlineImage = PdnResources.GetImageResource("Icons.ShapeOutlineIcon.png");
  43. private ImageResource shapeInteriorImage = PdnResources.GetImageResource("Icons.ShapeInteriorIcon.png");
  44. private ImageResource shapeBothImage = PdnResources.GetImageResource("Icons.ShapeBothIcon.png");
  45. private ToolStripSeparator brushSeparator;
  46. private ToolStripLabel brushStyleLabel;
  47. private ToolStripComboBox brushStyleComboBox;
  48. private ToolStripSeparator shapeSeparator;
  49. private ToolStripSplitButton shapeButton;
  50. private ToolStripSeparator penSeparator;
  51. private ToolStripLabel penSizeLabel;
  52. private ToolStripButton penSizeDecButton;
  53. private ToolStripComboBox penSizeComboBox;
  54. private ToolStripButton penSizeIncButton;
  55. private ToolStripLabel penStyleLabel;
  56. private ToolStripSplitButton penStartCapSplitButton; // Tag property is used to store chosen LineCap value
  57. private ToolStripSplitButton penDashStyleSplitButton; // Tag property is used to store chosen DashStyle value
  58. private ToolStripSplitButton penEndCapSplitButton; // Tag property is used to store chosen LineCap value
  59. private EnumLocalizer lineCapLocalizer = EnumLocalizer.Create(typeof(LineCap2));
  60. private EnumLocalizer dashStyleLocalizer = EnumLocalizer.Create(typeof(DashStyle));
  61. private ToolStripSeparator blendingSeparator;
  62. private ToolStripSplitButton alphaBlendingSplitButton;
  63. private bool alphaBlendingEnabled = true;
  64. private ImageResource alphaBlendingEnabledImage;
  65. private ImageResource alphaBlendingOverwriteImage;
  66. private ToolStripSplitButton antiAliasingSplitButton;
  67. private bool antiAliasingEnabled = true;
  68. private ImageResource antiAliasingEnabledImage;
  69. private ImageResource antiAliasingDisabledImage;
  70. private EnumLocalizer resamplingAlgorithmNames = EnumLocalizer.Create(typeof(ResamplingAlgorithm));
  71. private ToolStripSeparator resamplingSeparator;
  72. private ToolStripLabel resamplingLabel;
  73. private ToolStripComboBox resamplingComboBox;
  74. private EnumLocalizer colorPickerBehaviorNames = EnumLocalizer.Create(typeof(ColorPickerClickBehavior));
  75. private ToolStripSeparator colorPickerSeparator;
  76. private ToolStripLabel colorPickerLabel;
  77. private ToolStripComboBox colorPickerComboBox;
  78. private ToolStripSeparator toleranceSeparator;
  79. private ToolStripLabel toleranceLabel;
  80. private ToolStripControlHost toleranceSliderStrip;
  81. private ToleranceSliderControl toleranceSlider;
  82. private LineCap2[] lineCaps =
  83. new LineCap2[]
  84. {
  85. LineCap2.Flat,
  86. LineCap2.Arrow,
  87. LineCap2.ArrowFilled,
  88. LineCap2.Rounded
  89. };
  90. private DashStyle[] dashStyles =
  91. new DashStyle[]
  92. {
  93. DashStyle.Solid,
  94. DashStyle.Dash,
  95. DashStyle.DashDot,
  96. DashStyle.DashDotDot,
  97. DashStyle.Dot
  98. };
  99. private const float minPenSize = 1.0f;
  100. private const float maxPenSize = 500.0f;
  101. private int[] brushSizes =
  102. new int[]
  103. {
  104. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
  105. 11, 12, 13, 14, 15, 20, 25, 30,
  106. 35, 40, 45, 50, 55, 60, 65, 70,
  107. 75, 80, 85, 90, 95, 100, 125,
  108. 150, 175, 200, 225, 250, 275, 300,
  109. 325, 350, 375, 400, 425, 450, 475,
  110. 500
  111. };
  112. private ShapeDrawType shapeDrawType;
  113. private EnumLocalizer gradientTypeNames = EnumLocalizer.Create(typeof(GradientType));
  114. private GradientInfo gradientInfo = new GradientInfo(GradientType.LinearClamped, false);
  115. private ToolStripSeparator gradientSeparator1;
  116. private ToolStripButton gradientLinearClampedButton;
  117. private ToolStripButton gradientLinearReflectedButton;
  118. private ToolStripButton gradientLinearDiamondButton;
  119. private ToolStripButton gradientRadialButton;
  120. private ToolStripButton gradientConicalButton;
  121. private ToolStripSeparator gradientSeparator2;
  122. private ToolStripSplitButton gradientChannelsSplitButton;
  123. private ImageResource gradientAllColorChannelsImage;
  124. private ImageResource gradientAlphaChannelOnlyImage;
  125. private EnumLocalizer fontSmoothingLocalizer = EnumLocalizer.Create(typeof(FontSmoothing));
  126. private const int maxFontSize = 2000;
  127. private const int minFontSize = 1;
  128. private const int initialFontSize = 12;
  129. private FontFamily arialFontFamily;
  130. private FontStyle fontStyle;
  131. private TextAlignment alignment;
  132. private float oldSizeValue;
  133. private Brush highlightBrush;
  134. private Brush highlightTextBrush;
  135. private Brush windowBrush;
  136. private Brush windowTextBrush;
  137. private Font arialFontBase;
  138. private const string arialName = "Arial";
  139. private static ManualResetEvent staticFontNamesPopulatedEvent = new ManualResetEvent(false);
  140. private static List<string> staticFontNames = null;
  141. private bool fontsComboBoxPopulated = false;
  142. private ToolStripSeparator fontSeparator;
  143. private ToolStripLabel fontLabel;
  144. private ToolStripComboBox fontFamilyComboBox;
  145. private ToolStripComboBox fontSizeComboBox;
  146. private ToolStripComboBox fontSmoothingComboBox;
  147. private ToolStripSeparator fontStyleSeparator;
  148. private ToolStripButton fontBoldButton;
  149. private ToolStripButton fontItalicsButton;
  150. private ToolStripButton fontUnderlineButton;
  151. private ToolStripSeparator fontAlignSeparator;
  152. private ToolStripButton fontAlignLeftButton;
  153. private ToolStripButton fontAlignCenterButton;
  154. private ToolStripButton fontAlignRightButton;
  155. private int[] defaultFontSizes =
  156. new int[]
  157. {
  158. 8, 9, 10, 11, 12, 14, 16, 18, 20,
  159. 22, 24, 26, 28, 36, 48, 72, 84, 96,
  160. 108, 144, 192, 216, 288
  161. };
  162. private ToolStripSeparator selectionCombineModeSeparator;
  163. private ToolStripLabel selectionCombineModeLabel;
  164. private ToolStripSplitButton selectionCombineModeSplitButton;
  165. private ToolStripSeparator floodModeSeparator;
  166. private ToolStripLabel floodModeLabel;
  167. private ToolStripSplitButton floodModeSplitButton;
  168. private SelectionDrawModeInfo selectionDrawModeInfo;
  169. private ToolStripSeparator selectionDrawModeSeparator;
  170. private ToolStripLabel selectionDrawModeModeLabel;
  171. private ToolStripSplitButton selectionDrawModeSplitButton;
  172. private ToolStripLabel selectionDrawModeWidthLabel;
  173. private ToolStripTextBox selectionDrawModeWidthTextBox;
  174. private ToolStripButton selectionDrawModeSwapButton;
  175. private ToolStripLabel selectionDrawModeHeightLabel;
  176. private ToolStripTextBox selectionDrawModeHeightTextBox;
  177. private UnitsComboBoxStrip selectionDrawModeUnits;
  178. public event EventHandler SelectionDrawModeUnitsChanging;
  179. protected void OnSelectionDrawModeUnitsChanging()
  180. {
  181. if (SelectionDrawModeUnitsChanging != null)
  182. {
  183. SelectionDrawModeUnitsChanging(this, EventArgs.Empty);
  184. }
  185. }
  186. public event EventHandler SelectionDrawModeUnitsChanged;
  187. protected void OnSelectionDrawModeUnitsChanged()
  188. {
  189. if (SelectionDrawModeUnitsChanged != null)
  190. {
  191. SelectionDrawModeUnitsChanged(this, EventArgs.Empty);
  192. }
  193. }
  194. public void LoadFromAppEnvironment(AppEnvironment appEnvironment)
  195. {
  196. AlphaBlending = appEnvironment.AlphaBlending;
  197. AntiAliasing = appEnvironment.AntiAliasing;
  198. BrushInfo = appEnvironment.BrushInfo;
  199. ColorPickerClickBehavior = appEnvironment.ColorPickerClickBehavior;
  200. GradientInfo = appEnvironment.GradientInfo;
  201. PenInfo = appEnvironment.PenInfo;
  202. ResamplingAlgorithm = appEnvironment.ResamplingAlgorithm;
  203. ShapeDrawType = appEnvironment.ShapeDrawType;
  204. FontInfo = appEnvironment.FontInfo;
  205. FontSmoothing = appEnvironment.FontSmoothing;
  206. FontAlignment = appEnvironment.TextAlignment;
  207. Tolerance = appEnvironment.Tolerance;
  208. SelectionCombineMode = appEnvironment.SelectionCombineMode;
  209. FloodMode = appEnvironment.FloodMode;
  210. SelectionDrawModeInfo = appEnvironment.SelectionDrawModeInfo;
  211. }
  212. public event EventHandler BrushInfoChanged;
  213. protected virtual void OnBrushChanged()
  214. {
  215. if (BrushInfoChanged != null)
  216. {
  217. BrushInfoChanged(this, EventArgs.Empty);
  218. }
  219. }
  220. public BrushInfo BrushInfo
  221. {
  222. get
  223. {
  224. if (this.brushStyleComboBox.SelectedItem.ToString() == this.solidBrushText)
  225. {
  226. return new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal);
  227. }
  228. if (this.brushStyleComboBox.SelectedIndex == -1)
  229. {
  230. return new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal);
  231. }
  232. else
  233. {
  234. return new BrushInfo(
  235. BrushType.Hatch,
  236. (HatchStyle)this.hatchStyleNames.LocalizedNameToEnumValue(this.brushStyleComboBox.SelectedItem.ToString()));
  237. }
  238. }
  239. set
  240. {
  241. if (value.BrushType == BrushType.Solid)
  242. {
  243. this.brushStyleComboBox.SelectedItem = this.solidBrushText;
  244. }
  245. else
  246. {
  247. this.brushStyleComboBox.SelectedItem = this.hatchStyleNames.EnumValueToLocalizedName(value.HatchStyle);
  248. }
  249. }
  250. }
  251. public event EventHandler GradientInfoChanged;
  252. protected virtual void OnGradientInfoChanged()
  253. {
  254. if (GradientInfoChanged != null)
  255. {
  256. GradientInfoChanged(this, EventArgs.Empty);
  257. }
  258. }
  259. public void PerformGradientInfoChanged()
  260. {
  261. OnGradientInfoChanged();
  262. }
  263. public GradientInfo GradientInfo
  264. {
  265. get
  266. {
  267. return this.gradientInfo;
  268. }
  269. set
  270. {
  271. if (value == null)
  272. {
  273. throw new ArgumentNullException();
  274. }
  275. this.gradientInfo = value;
  276. OnGradientInfoChanged();
  277. SyncGradientInfo();
  278. }
  279. }
  280. private void SyncGradientInfo()
  281. {
  282. this.gradientConicalButton.Checked = false;
  283. this.gradientRadialButton.Checked = false;
  284. this.gradientLinearClampedButton.Checked = false;
  285. this.gradientLinearReflectedButton.Checked = false;
  286. this.gradientLinearDiamondButton.Checked = false;
  287. switch (this.gradientInfo.GradientType)
  288. {
  289. case GradientType.Conical:
  290. this.gradientConicalButton.Checked = true;
  291. break;
  292. case GradientType.LinearClamped:
  293. this.gradientLinearClampedButton.Checked = true;
  294. break;
  295. case GradientType.LinearReflected:
  296. this.gradientLinearReflectedButton.Checked = true;
  297. break;
  298. case GradientType.LinearDiamond:
  299. this.gradientLinearDiamondButton.Checked = true;
  300. break;
  301. case GradientType.Radial:
  302. this.gradientRadialButton.Checked = true;
  303. break;
  304. default:
  305. throw new InvalidEnumArgumentException();
  306. }
  307. if (this.gradientInfo.AlphaOnly)
  308. {
  309. this.gradientChannelsSplitButton.Image = this.gradientAlphaChannelOnlyImage.Reference;
  310. }
  311. else
  312. {
  313. this.gradientChannelsSplitButton.Image = this.gradientAllColorChannelsImage.Reference;
  314. }
  315. }
  316. private void ShapeButton_DropDownOpening(object sender, EventArgs e)
  317. {
  318. ToolStripMenuItem outlineMI = new ToolStripMenuItem();
  319. outlineMI.Text = PdnResources.GetString("ShapeDrawTypeConfigWidget.OutlineButton.ToolTipText");
  320. outlineMI.Image = this.shapeOutlineImage.Reference;
  321. outlineMI.Tag = (object)ShapeDrawType.Outline;
  322. outlineMI.Click += new EventHandler(ShapeMI_Click);
  323. ToolStripMenuItem interiorMI = new ToolStripMenuItem();
  324. interiorMI.Text = PdnResources.GetString("ShapeDrawTypeConfigWidget.InteriorButton.ToolTipText");
  325. interiorMI.Image = this.shapeInteriorImage.Reference;
  326. interiorMI.Tag = (object)ShapeDrawType.Interior;
  327. interiorMI.Click += new EventHandler(ShapeMI_Click);
  328. ToolStripMenuItem bothMI = new ToolStripMenuItem();
  329. bothMI.Text = PdnResources.GetString("ShapeDrawTypeConfigWidget.BothButton.ToolTipText");
  330. bothMI.Image = this.shapeBothImage.Reference;
  331. bothMI.Tag = (object)ShapeDrawType.Both;
  332. bothMI.Click += new EventHandler(ShapeMI_Click);
  333. switch (this.shapeDrawType)
  334. {
  335. case ShapeDrawType.Outline:
  336. outlineMI.Checked = true;
  337. break;
  338. case ShapeDrawType.Interior:
  339. interiorMI.Checked = true;
  340. break;
  341. case ShapeDrawType.Both:
  342. bothMI.Checked = true;
  343. break;
  344. default:
  345. throw new InvalidEnumArgumentException();
  346. }
  347. this.shapeButton.DropDownItems.AddRange(
  348. new ToolStripItem[]
  349. {
  350. outlineMI,
  351. interiorMI,
  352. bothMI
  353. });
  354. }
  355. private void ShapeMI_Click(object sender, EventArgs e)
  356. {
  357. ShapeDrawType sdt = (ShapeDrawType)((ToolStripMenuItem)sender).Tag;
  358. Tracing.LogFeature("ToolConfigStrip(" + sdt.ToString() + ")");
  359. this.ShapeDrawType = sdt;
  360. }
  361. public ToolConfigStrip()
  362. {
  363. SuspendLayout();
  364. InitializeComponent();
  365. this.solidBrushText = PdnResources.GetString("BrushConfigWidget.SolidBrush.Text"); // "Solid Brush"
  366. this.brushStyleComboBox.Items.Add(this.solidBrushText);
  367. string[] styleNames = this.hatchStyleNames.GetLocalizedNames();
  368. Array.Sort(styleNames);
  369. foreach (string styleName in styleNames)
  370. {
  371. brushStyleComboBox.Items.Add(styleName);
  372. }
  373. brushStyleComboBox.SelectedIndex = 0;
  374. this.brushStyleLabel.Text = PdnResources.GetString("BrushConfigWidget.FillStyleLabel.Text");
  375. this.shapeDrawType = ShapeDrawType.Outline;
  376. this.shapeButton.Image = this.shapeOutlineImage.Reference;
  377. this.penSizeLabel.Text = PdnResources.GetString("PenConfigWidget.BrushWidthLabel");
  378. this.penSizeComboBox.ComboBox.SuspendLayout();
  379. for (int i = 0; i < this.brushSizes.Length; ++i)
  380. {
  381. this.penSizeComboBox.Items.Add(this.brushSizes[i].ToString());
  382. }
  383. this.penSizeComboBox.ComboBox.ResumeLayout(false);
  384. this.penSizeComboBox.SelectedIndex = 1; // default to brush size of 2
  385. this.penSizeDecButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenSizeDecButton.ToolTipText");
  386. this.penSizeDecButton.Image = PdnResources.GetImageResource("Icons.MinusButtonIcon.png").Reference;
  387. this.penSizeIncButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenSizeIncButton.ToolTipText");
  388. this.penSizeIncButton.Image = PdnResources.GetImageResource("Icons.PlusButtonIcon.png").Reference;
  389. this.penStyleLabel.Text = PdnResources.GetString("ToolConfigStrip.PenStyleLabel.Text");
  390. this.penStartCapSplitButton.Tag = PenInfo.DefaultLineCap;
  391. this.penStartCapSplitButton.Image = GetLineCapImage(PenInfo.DefaultLineCap, true).Reference;
  392. this.penStartCapSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenStartCapSplitButton.ToolTipText");
  393. this.penDashStyleSplitButton.Tag = PenInfo.DefaultDashStyle;
  394. this.penDashStyleSplitButton.Image = GetDashStyleImage(PenInfo.DefaultDashStyle);
  395. this.penDashStyleSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenDashStyleSplitButton.ToolTipText");
  396. this.penEndCapSplitButton.Tag = PenInfo.DefaultLineCap;
  397. this.penEndCapSplitButton.Image = GetLineCapImage(PenInfo.DefaultLineCap, false).Reference;
  398. this.penEndCapSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenEndCapSplitButton.ToolTipText");
  399. this.gradientLinearClampedButton.ToolTipText = this.gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearClamped);
  400. this.gradientLinearClampedButton.Image = PdnResources.GetImageResource("Icons.LinearClampedGradientIcon.png").Reference;
  401. this.gradientLinearReflectedButton.ToolTipText = this.gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearReflected);
  402. this.gradientLinearReflectedButton.Image = PdnResources.GetImageResource("Icons.LinearReflectedGradientIcon.png").Reference;
  403. this.gradientLinearDiamondButton.ToolTipText = this.gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearDiamond);
  404. this.gradientLinearDiamondButton.Image = PdnResources.GetImageResource("Icons.LinearDiamondGradientIcon.png").Reference;
  405. this.gradientRadialButton.ToolTipText = this.gradientTypeNames.EnumValueToLocalizedName(GradientType.Radial);
  406. this.gradientRadialButton.Image = PdnResources.GetImageResource("Icons.RadialGradientIcon.png").Reference;
  407. this.gradientConicalButton.ToolTipText = this.gradientTypeNames.EnumValueToLocalizedName(GradientType.Conical);
  408. this.gradientConicalButton.Image = PdnResources.GetImageResource("Icons.ConicalGradientIcon.png").Reference;
  409. this.gradientAllColorChannelsImage = PdnResources.GetImageResource("Icons.AllColorChannelsIcon.png");
  410. this.gradientAlphaChannelOnlyImage = PdnResources.GetImageResource("Icons.AlphaChannelOnlyIcon.png");
  411. this.gradientChannelsSplitButton.Image = this.gradientAllColorChannelsImage.Reference;
  412. this.antiAliasingEnabledImage = PdnResources.GetImageResource("Icons.AntiAliasingEnabledIcon.png");
  413. this.antiAliasingDisabledImage = PdnResources.GetImageResource("Icons.AntiAliasingDisabledIcon.png");
  414. this.antiAliasingSplitButton.Image = this.antiAliasingEnabledImage.Reference;
  415. this.alphaBlendingEnabledImage = PdnResources.GetImageResource("Icons.BlendingEnabledIcon.png");
  416. this.alphaBlendingOverwriteImage = PdnResources.GetImageResource("Icons.BlendingOverwriteIcon.png");
  417. this.alphaBlendingSplitButton.Image = this.alphaBlendingEnabledImage.Reference;
  418. this.penSizeComboBox.Size = new Size(UI.ScaleWidth(this.penSizeComboBox.Width), penSizeComboBox.Height);
  419. this.brushStyleComboBox.Size = new Size(UI.ScaleWidth(this.brushStyleComboBox.Width), brushStyleComboBox.Height);
  420. this.brushStyleComboBox.DropDownWidth = UI.ScaleWidth(this.brushStyleComboBox.DropDownWidth);
  421. this.brushStyleComboBox.DropDownHeight = UI.ScaleHeight(this.brushStyleComboBox.DropDownHeight);
  422. this.toleranceLabel.Text = PdnResources.GetString("ToleranceConfig.ToleranceLabel.Text");
  423. this.toleranceSlider.Tolerance = 0.5f;
  424. this.fontSizeComboBox.ComboBox.SuspendLayout();
  425. for (int i = 0; i < this.defaultFontSizes.Length; ++i)
  426. {
  427. this.fontSizeComboBox.Items.Add(this.defaultFontSizes[i].ToString());
  428. }
  429. this.fontSizeComboBox.ComboBox.ResumeLayout(false);
  430. this.fontSmoothingComboBox.Items.AddRange(
  431. new object[]
  432. {
  433. this.fontSmoothingLocalizer.EnumValueToLocalizedName(FontSmoothing.Smooth),
  434. this.fontSmoothingLocalizer.EnumValueToLocalizedName(FontSmoothing.Sharp)
  435. });
  436. this.fontSmoothingComboBox.SelectedIndex = 0;
  437. this.fontLabel.Text = PdnResources.GetString("TextConfigWidget.FontLabel.Text");
  438. try
  439. {
  440. this.arialFontFamily = new FontFamily(arialName);
  441. }
  442. catch (Exception)
  443. {
  444. this.arialFontFamily = new FontFamily(System.Drawing.Text.GenericFontFamilies.SansSerif);
  445. }
  446. try
  447. {
  448. this.arialFontBase = new Font(arialFontFamily, initialFontSize, FontStyle.Regular);
  449. }
  450. catch (Exception)
  451. {
  452. this.arialFontBase = new Font(FontFamily.GenericSansSerif, initialFontSize, FontStyle.Regular);
  453. }
  454. this.fontFamilyComboBox.ComboBox.DropDownHeight = 600;
  455. this.alignment = TextAlignment.Left;
  456. this.fontAlignLeftButton.Checked = true;
  457. this.oldSizeValue = initialFontSize;
  458. this.highlightBrush = new SolidBrush(SystemColors.Highlight);
  459. this.highlightTextBrush = new SolidBrush(SystemColors.HighlightText);
  460. this.windowBrush = new SolidBrush(SystemColors.Window);
  461. this.windowTextBrush = new SolidBrush(SystemColors.WindowText);
  462. // These buttons need a color key to maintain consistency with v2.5 language packs
  463. this.fontBoldButton.ImageTransparentColor = Utility.TransparentKey;
  464. this.fontItalicsButton.ImageTransparentColor = Utility.TransparentKey;
  465. this.fontUnderlineButton.ImageTransparentColor = Utility.TransparentKey;
  466. this.fontBoldButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontBoldIcon");
  467. this.fontItalicsButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontItalicIcon");
  468. this.fontUnderlineButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontUnderlineIcon");
  469. this.fontAlignLeftButton.Image = PdnResources.GetImageResource("Icons.TextAlignLeftIcon.png").Reference;
  470. this.fontAlignCenterButton.Image = PdnResources.GetImageResource("Icons.TextAlignCenterIcon.png").Reference;
  471. this.fontAlignRightButton.Image = PdnResources.GetImageResource("Icons.TextAlignRightIcon.png").Reference;
  472. this.fontBoldButton.ToolTipText = PdnResources.GetString("TextConfigWidget.BoldButton.ToolTipText");
  473. this.fontItalicsButton.ToolTipText = PdnResources.GetString("TextConfigWidget.ItalicButton.ToolTipText");
  474. this.fontUnderlineButton.ToolTipText = PdnResources.GetString("TextConfigWidget.UnderlineButton.ToolTipText");
  475. this.fontAlignLeftButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignLeftButton.ToolTipText");
  476. this.fontAlignCenterButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignCenterButton.ToolTipText");
  477. this.fontAlignRightButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignRightButton.ToolTipText");
  478. this.fontFamilyComboBox.Size = new Size(UI.ScaleWidth(this.fontFamilyComboBox.Width), fontFamilyComboBox.Height);
  479. this.fontFamilyComboBox.DropDownWidth = UI.ScaleWidth(this.fontFamilyComboBox.DropDownWidth);
  480. this.fontSizeComboBox.Size = new Size(UI.ScaleWidth(this.fontSizeComboBox.Width), fontSizeComboBox.Height);
  481. this.fontSmoothingComboBox.Size = new Size(UI.ScaleWidth(this.fontSmoothingComboBox.Width), fontSmoothingComboBox.Height);
  482. this.fontSmoothingComboBox.DropDownWidth = UI.ScaleWidth(this.fontSmoothingComboBox.DropDownWidth);
  483. this.resamplingLabel.Text = PdnResources.GetString("ToolConfigStrip.ResamplingLabel.Text");
  484. this.resamplingComboBox.BeginUpdate();
  485. this.resamplingComboBox.Items.Add(this.resamplingAlgorithmNames.EnumValueToLocalizedName(ResamplingAlgorithm.Bilinear));
  486. this.resamplingComboBox.Items.Add(this.resamplingAlgorithmNames.EnumValueToLocalizedName(ResamplingAlgorithm.NearestNeighbor));
  487. this.resamplingComboBox.EndUpdate();
  488. this.resamplingComboBox.SelectedIndex = 0; // bilinear
  489. this.resamplingComboBox.Size = new Size(UI.ScaleWidth(this.resamplingComboBox.Width), resamplingComboBox.Height);
  490. this.resamplingComboBox.DropDownWidth = UI.ScaleWidth(this.resamplingComboBox.DropDownWidth);
  491. this.colorPickerLabel.Text = PdnResources.GetString("ToolConfigStrip.ColorPickerLabel.Text");
  492. string[] colorPickerBehaviorNames = this.colorPickerBehaviorNames.GetLocalizedNames();
  493. // Make sure these items are sorted to be in the order specified by the enumeration
  494. Array.Sort<string>(
  495. colorPickerBehaviorNames,
  496. delegate(string lhs, string rhs)
  497. {
  498. ColorPickerClickBehavior lhsE = (ColorPickerClickBehavior)this.colorPickerBehaviorNames.LocalizedNameToEnumValue(lhs);
  499. ColorPickerClickBehavior rhsE = (ColorPickerClickBehavior)this.colorPickerBehaviorNames.LocalizedNameToEnumValue(rhs);
  500. if ((int)lhsE < (int)rhsE)
  501. {
  502. return -1;
  503. }
  504. else if ((int)lhsE > (int)rhsE)
  505. {
  506. return +1;
  507. }
  508. else
  509. {
  510. return 0;
  511. }
  512. });
  513. this.colorPickerComboBox.Items.AddRange(colorPickerBehaviorNames);
  514. this.colorPickerComboBox.SelectedIndex = 0;
  515. this.colorPickerComboBox.Size = new Size(UI.ScaleWidth(this.colorPickerComboBox.Width), colorPickerComboBox.Height);
  516. this.colorPickerComboBox.DropDownWidth = UI.ScaleWidth(this.colorPickerComboBox.DropDownWidth);
  517. this.toleranceSlider.Size = UI.ScaleSize(this.toleranceSlider.Size);
  518. this.selectionCombineModeLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionCombineModeLabel.Text");
  519. this.floodModeLabel.Text = PdnResources.GetString("ToolConfigStrip.FloodModeLabel.Text");
  520. this.selectionDrawModeModeLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeLabel.Text");
  521. this.selectionDrawModeWidthLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeWidthLabel.Text");
  522. this.selectionDrawModeHeightLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeHeightLabel.Text");
  523. this.selectionDrawModeSwapButton.Image = PdnResources.GetImageResource("Icons.ToolConfigStrip.SelectionDrawModeSwapButton.png").Reference;
  524. this.selectionDrawModeWidthTextBox.Size = new Size(UI.ScaleWidth(this.selectionDrawModeWidthTextBox.Width), this.selectionDrawModeWidthTextBox.Height);
  525. this.selectionDrawModeHeightTextBox.Size = new Size(UI.ScaleWidth(this.selectionDrawModeHeightTextBox.Width), this.selectionDrawModeHeightTextBox.Height);
  526. this.selectionDrawModeUnits.Size = new Size(UI.ScaleWidth(this.selectionDrawModeUnits.Width), this.selectionDrawModeUnits.Height);
  527. ToolBarConfigItems = ToolBarConfigItems.None;
  528. ResumeLayout(false);
  529. }
  530. private void AsyncInitFontNames()
  531. {
  532. if (!IsHandleCreated)
  533. {
  534. CreateControl();
  535. }
  536. if (!this.fontFamilyComboBox.ComboBox.IsHandleCreated)
  537. {
  538. this.fontFamilyComboBox.ComboBox.CreateControl();
  539. }
  540. if (staticFontNames == null)
  541. {
  542. ThreadPool.QueueUserWorkItem(new WaitCallback(this.PopulateFontsBackgroundThread), null);
  543. }
  544. }
  545. protected override void OnHandleCreated(EventArgs e)
  546. {
  547. if ((this.toolBarConfigItems & ToolBarConfigItems.Text) == ToolBarConfigItems.Text)
  548. {
  549. AsyncInitFontNames();
  550. }
  551. base.OnHandleCreated(e);
  552. }
  553. private void InitializeComponent()
  554. {
  555. this.brushSeparator = new ToolStripSeparator();
  556. this.brushStyleLabel = new ToolStripLabel();
  557. this.brushStyleComboBox = new ToolStripComboBox();
  558. this.shapeSeparator = new ToolStripSeparator();
  559. this.shapeButton = new ToolStripSplitButton();
  560. this.gradientSeparator1 = new ToolStripSeparator();
  561. this.gradientLinearClampedButton = new ToolStripButton();
  562. this.gradientLinearReflectedButton = new ToolStripButton();
  563. this.gradientLinearDiamondButton = new ToolStripButton();
  564. this.gradientRadialButton = new ToolStripButton();
  565. this.gradientConicalButton = new ToolStripButton();
  566. this.gradientSeparator2 = new ToolStripSeparator();
  567. this.gradientChannelsSplitButton = new ToolStripSplitButton();
  568. this.penSeparator = new ToolStripSeparator();
  569. this.penSizeLabel = new ToolStripLabel();
  570. this.penSizeDecButton = new ToolStripButton();
  571. this.penSizeComboBox = new ToolStripComboBox();
  572. this.penSizeIncButton = new ToolStripButton();
  573. this.penStyleLabel = new ToolStripLabel();
  574. this.penStartCapSplitButton = new ToolStripSplitButton();
  575. this.penDashStyleSplitButton = new ToolStripSplitButton();
  576. this.penEndCapSplitButton = new ToolStripSplitButton();
  577. this.blendingSeparator = new ToolStripSeparator();
  578. this.antiAliasingSplitButton = new ToolStripSplitButton();
  579. this.alphaBlendingSplitButton = new ToolStripSplitButton();
  580. this.toleranceSeparator = new ToolStripSeparator();
  581. this.toleranceLabel = new ToolStripLabel();
  582. this.toleranceSlider = new ToleranceSliderControl();
  583. this.toleranceSliderStrip = new ToolStripControlHost(this.toleranceSlider);
  584. this.fontSeparator = new ToolStripSeparator();
  585. this.fontLabel = new ToolStripLabel();
  586. this.fontFamilyComboBox = new ToolStripComboBox();
  587. this.fontSizeComboBox = new ToolStripComboBox();
  588. this.fontSmoothingComboBox = new ToolStripComboBox();
  589. this.fontStyleSeparator = new ToolStripSeparator();
  590. this.fontBoldButton = new ToolStripButton();
  591. this.fontItalicsButton = new ToolStripButton();
  592. this.fontUnderlineButton = new ToolStripButton();
  593. this.fontAlignSeparator = new ToolStripSeparator();
  594. this.fontAlignLeftButton = new ToolStripButton();
  595. this.fontAlignCenterButton = new ToolStripButton();
  596. this.fontAlignRightButton = new ToolStripButton();
  597. this.resamplingSeparator = new ToolStripSeparator();
  598. this.resamplingLabel = new ToolStripLabel();
  599. this.resamplingComboBox = new ToolStripComboBox();
  600. this.colorPickerSeparator = new ToolStripSeparator();
  601. this.colorPickerLabel = new ToolStripLabel();
  602. this.colorPickerComboBox = new ToolStripComboBox();
  603. this.selectionCombineModeSeparator = new ToolStripSeparator();
  604. this.selectionCombineModeLabel = new ToolStripLabel();
  605. this.selectionCombineModeSplitButton = new ToolStripSplitButton();
  606. this.floodModeSeparator = new ToolStripSeparator();
  607. this.floodModeLabel = new ToolStripLabel();
  608. this.floodModeSplitButton = new ToolStripSplitButton();
  609. this.selectionDrawModeSeparator = new ToolStripSeparator();
  610. this.selectionDrawModeModeLabel = new ToolStripLabel();
  611. this.selectionDrawModeSplitButton = new ToolStripSplitButton();
  612. this.selectionDrawModeWidthLabel = new ToolStripLabel();
  613. this.selectionDrawModeWidthTextBox = new ToolStripTextBox();
  614. this.selectionDrawModeSwapButton = new ToolStripButton();
  615. this.selectionDrawModeHeightLabel = new ToolStripLabel();
  616. this.selectionDrawModeHeightTextBox = new ToolStripTextBox();
  617. this.selectionDrawModeUnits = new UnitsComboBoxStrip();
  618. this.SuspendLayout();
  619. //
  620. // brushStyleLabel
  621. //
  622. this.brushStyleLabel.Name = "fillStyleLabel";
  623. //
  624. // brushStyleComboBox
  625. //
  626. this.brushStyleComboBox.Name = "styleComboBox";
  627. this.brushStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  628. this.brushStyleComboBox.DropDownWidth = 234;
  629. this.brushStyleComboBox.AutoSize = true;
  630. //
  631. // brushStyleComboBox.ComboBox
  632. //
  633. this.brushStyleComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawVariable;
  634. this.brushStyleComboBox.ComboBox.MeasureItem += ComboBoxStyle_MeasureItem;
  635. this.brushStyleComboBox.ComboBox.SelectedValueChanged += ComboBoxStyle_SelectedValueChanged;
  636. this.brushStyleComboBox.ComboBox.DrawItem += ComboBoxStyle_DrawItem;
  637. //
  638. // shapeButton
  639. //
  640. this.shapeButton.Name = "shapeButton";
  641. this.shapeButton.DropDownOpening += new EventHandler(ShapeButton_DropDownOpening);
  642. this.shapeButton.DropDownClosed +=
  643. delegate(object sender, EventArgs e)
  644. {
  645. this.shapeButton.DropDownItems.Clear();
  646. };
  647. this.shapeButton.ButtonClick +=
  648. delegate(object sender, EventArgs e)
  649. {
  650. Tracing.LogFeature("ToolConfigStrip(shapeButton)");
  651. switch (ShapeDrawType)
  652. {
  653. case ShapeDrawType.Outline:
  654. ShapeDrawType = ShapeDrawType.Interior;
  655. break;
  656. case ShapeDrawType.Interior:
  657. ShapeDrawType = ShapeDrawType.Both;
  658. break;
  659. case ShapeDrawType.Both:
  660. ShapeDrawType = ShapeDrawType.Outline;
  661. break;
  662. default:
  663. throw new InvalidEnumArgumentException();
  664. }
  665. };
  666. //
  667. // gradientSeparator
  668. //
  669. this.gradientSeparator1.Name = "gradientSeparator";
  670. //
  671. // gradientLinearClampedButton
  672. //
  673. this.gradientLinearClampedButton.Name = "gradientLinearClampedButton";
  674. this.gradientLinearClampedButton.Click += GradientTypeButtonClicked;
  675. this.gradientLinearClampedButton.Tag = GradientType.LinearClamped;
  676. //
  677. // gradientLinearReflectedButton
  678. //
  679. this.gradientLinearReflectedButton.Name = "gradientLinearReflectedButton";
  680. this.gradientLinearReflectedButton.Click += GradientTypeButtonClicked;
  681. this.gradientLinearReflectedButton.Tag = GradientType.LinearReflected;
  682. //
  683. // gradientLinearDiamondButton
  684. //
  685. this.gradientLinearDiamondButton.Name = "gradientLinearDiamondButton";
  686. this.gradientLinearDiamondButton.Click += GradientTypeButtonClicked;
  687. this.gradientLinearDiamondButton.Tag = GradientType.LinearDiamond;
  688. //
  689. // gradientRadialButton
  690. //
  691. this.gradientRadialButton.Name = "gradientRadialButton";
  692. this.gradientRadialButton.Click += GradientTypeButtonClicked;
  693. this.gradientRadialButton.Tag = GradientType.Radial;
  694. //
  695. // gradientConicalButton
  696. //
  697. this.gradientConicalButton.Name = "gradientConicalButton";
  698. this.gradientConicalButton.Click += GradientTypeButtonClicked;
  699. this.gradientConicalButton.Tag = GradientType.Conical;
  700. //
  701. // gradientSeparator2
  702. //
  703. this.gradientSeparator2.Name = "gradientSeparator2";
  704. //
  705. // gradientChannelsSplitButton
  706. //
  707. this.gradientChannelsSplitButton.Name = "gradientChannelsSplitButton";
  708. this.gradientChannelsSplitButton.DropDownOpening += new EventHandler(GradientChannelsSplitButton_DropDownOpening);
  709. this.gradientChannelsSplitButton.DropDownClosed +=
  710. delegate(object sender, EventArgs e)
  711. {
  712. this.gradientChannelsSplitButton.DropDownItems.Clear();
  713. };
  714. this.gradientChannelsSplitButton.ButtonClick +=
  715. delegate(object sender, EventArgs e)
  716. {
  717. Tracing.LogFeature("ToolConfigStrip(gradientChannelsSplitButton)");
  718. GradientInfo = new GradientInfo(GradientInfo.GradientType, !GradientInfo.AlphaOnly);
  719. };
  720. //
  721. // penSeparator
  722. //
  723. this.penSeparator.Name = "penSeparator";
  724. //
  725. // penSizeLabel
  726. //
  727. this.penSizeLabel.Name = "brushSizeLabel";
  728. //
  729. // penSizeDecButton
  730. //
  731. this.penSizeDecButton.Name = "penSizeDecButton";
  732. this.penSizeDecButton.Click +=
  733. delegate(object sender, EventArgs e)
  734. {
  735. Tracing.LogFeature("ToolConfigStrip(penSizeDecButton)");
  736. float amount = -1.0f;
  737. if ((Control.ModifierKeys & Keys.Control) != 0)
  738. {
  739. amount *= 5.0f;
  740. }
  741. AddToPenSize(amount);
  742. };
  743. //
  744. // penSizeComboBox
  745. //
  746. this.penSizeComboBox.Name = "penSizeComboBox";
  747. this.penSizeComboBox.Validating += new CancelEventHandler(this.BrushSizeComboBox_Validating);
  748. this.penSizeComboBox.TextChanged += new EventHandler(this.SizeComboBox_TextChanged);
  749. this.penSizeComboBox.AutoSize = false;
  750. this.penSizeComboBox.Width = 44;
  751. //
  752. // penSizeIncButton
  753. //
  754. this.penSizeIncButton.Name = "penSizeIncButton";
  755. this.penSizeIncButton.Click +=
  756. delegate(object sender, EventArgs e)
  757. {
  758. Tracing.LogFeature("ToolConfigStrip(penSizeIncButton)");
  759. float amount = 1.0f;
  760. if ((Control.ModifierKeys & Keys.Control) != 0)
  761. {
  762. amount *= 5.0f;
  763. }
  764. AddToPenSize(amount);
  765. };
  766. //
  767. // penStartCapLabel
  768. //
  769. this.penStyleLabel.Name = "penStartCapLabel";
  770. //
  771. // penStartCapSplitButton
  772. //
  773. this.penStartCapSplitButton.Name = "penStartCapSplitButton";
  774. this.penStartCapSplitButton.DropDownOpening += PenCapSplitButton_DropDownOpening;
  775. this.penStartCapSplitButton.DropDownClosed +=
  776. delegate(object sender, EventArgs e)
  777. {
  778. this.penStartCapSplitButton.DropDownItems.Clear();
  779. };
  780. this.penStartCapSplitButton.ButtonClick +=
  781. delegate(object sender, EventArgs e)
  782. {
  783. Tracing.LogFeature("ToolConfigStrip(penStartCapSplitButton)");
  784. CyclePenStartCap();
  785. };
  786. //
  787. // penDashStyleSplitButton
  788. //
  789. this.penDashStyleSplitButton.Name = "penDashStyleSplitButton";
  790. this.penDashStyleSplitButton.ImageScaling = ToolStripItemImageScaling.None;
  791. this.penDashStyleSplitButton.DropDownOpening += PenDashStyleButton_DropDownOpening;
  792. this.penDashStyleSplitButton.DropDownClosed +=
  793. delegate(object sender, EventArgs e)
  794. {
  795. this.penDashStyleSplitButton.DropDownItems.Clear();
  796. };
  797. this.penDashStyleSplitButton.ButtonClick +=
  798. delegate(object sender, EventArgs e)
  799. {
  800. Tracing.LogFeature("ToolConfigStrip(penDashStyleSplitButton)");
  801. CyclePenDashStyle();
  802. };
  803. //
  804. // penEndCapSplitButton
  805. //
  806. this.penEndCapSplitButton.Name = "penEndCapSplitButton";
  807. this.penEndCapSplitButton.DropDownOpening += PenCapSplitButton_DropDownOpening;
  808. this.penEndCapSplitButton.DropDownClosed +=
  809. delegate(object sender, EventArgs e)
  810. {
  811. this.penEndCapSplitButton.DropDownItems.Clear();
  812. };
  813. this.penEndCapSplitButton.ButtonClick +=
  814. delegate(object sender, EventArgs e)
  815. {
  816. Tracing.LogFeature("ToolConfigStrip(penEndCapSplitButton)");
  817. CyclePenEndCap();
  818. };
  819. //
  820. // antiAliasingSplitButton
  821. //
  822. this.antiAliasingSplitButton.Name = "antiAliasingSplitButton";
  823. this.antiAliasingSplitButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
  824. this.antiAliasingSplitButton.DropDownOpening += AntiAliasingSplitButton_DropDownOpening;
  825. this.antiAliasingSplitButton.DropDownClosed +=
  826. delegate(object sender, EventArgs e)
  827. {
  828. this.antiAliasingSplitButton.DropDownItems.Clear();
  829. };
  830. this.antiAliasingSplitButton.ButtonClick +=
  831. delegate(object sender, EventArgs e)
  832. {
  833. Tracing.LogFeature("ToolConfigStrip(antiAliasingSplitButton)");
  834. AntiAliasing = !AntiAliasing;
  835. };
  836. //
  837. // alphaBlendingSplitButton
  838. //
  839. this.alphaBlendingSplitButton.Name = "alphaBlendingSplitButton";
  840. this.alphaBlendingSplitButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
  841. this.alphaBlendingSplitButton.DropDownOpening += new EventHandler(AlphaBlendingSplitButton_DropDownOpening);
  842. this.alphaBlendingSplitButton.DropDownClosed +=
  843. delegate(object sender, EventArgs e)
  844. {
  845. this.alphaBlendingSplitButton.DropDownItems.Clear();
  846. };
  847. this.alphaBlendingSplitButton.ButtonClick +=
  848. delegate(object sender, EventArgs e)
  849. {
  850. Tracing.LogFeature("ToolConfigStrip(alphaBlendingSplitButton)");
  851. AlphaBlending = !AlphaBlending;
  852. };
  853. //
  854. // toleranceLabel
  855. //
  856. this.toleranceLabel.Name = "toleranceLabel";
  857. //
  858. // toleranceSlider
  859. //
  860. this.toleranceSlider.Name = "toleranceSlider";
  861. this.toleranceSlider.ToleranceChanged += new EventHandler(ToleranceSlider_ToleranceChanged);
  862. this.toleranceSlider.Size = new Size(150, 16);
  863. //
  864. // toleranceSliderStrip
  865. //
  866. this.toleranceSliderStrip.Name = "toleranceSliderStrip";
  867. this.toleranceSliderStrip.AutoSize = false;
  868. //
  869. // fontLabel
  870. //
  871. this.fontLabel.Name = "fontLabel";
  872. //
  873. // fontFamilyComboBox
  874. //
  875. this.fontFamilyComboBox.Name = "fontComboBox";
  876. this.fontFamilyComboBox.DropDownWidth = 240;
  877. this.fontFamilyComboBox.MaxDropDownItems = 12;
  878. this.fontFamilyComboBox.Sorted = true;
  879. this.fontFamilyComboBox.GotFocus += new EventHandler(FontFamilyComboBox_GotFocus);
  880. this.fontFamilyComboBox.Items.Add(arialName);
  881. this.fontFamilyComboBox.SelectedItem = arialName;
  882. this.fontFamilyComboBox.SelectedIndexChanged += FontFamilyComboBox_SelectedIndexChanged;
  883. this.fontFamilyComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  884. //
  885. // fontFamilyComboBox.ComboBox
  886. //
  887. this.fontFamilyComboBox.ComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
  888. this.fontFamilyComboBox.ComboBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.FontFamilyComboBox_MeasureItem);
  889. this.fontFamilyComboBox.ComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.FontFamilyComboBox_DrawItem);
  890. //
  891. // fontSizeComboBox
  892. //
  893. this.fontSizeComboBox.Name = "fontSizeComboBox";
  894. this.fontSizeComboBox.AutoSize = false;
  895. this.fontSizeComboBox.TextChanged += new EventHandler(FontSizeComboBox_TextChanged);
  896. this.fontSizeComboBox.Validating += new CancelEventHandler(FontSizeComboBox_Validating);
  897. this.fontSizeComboBox.Text = initialFontSize.ToString();
  898. this.fontSizeComboBox.Width = 44;
  899. //
  900. // fontSmoothingComboBox
  901. //
  902. this.fontSmoothingComboBox.Name = "smoothingComboBOx";
  903. this.fontSmoothingComboBox.AutoSize = false;
  904. this.fontSmoothingComboBox.Sorted = false;
  905. this.fontSmoothingComboBox.Width = 70;
  906. this.fontSmoothingComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  907. this.fontSmoothingComboBox.SelectedIndexChanged += new EventHandler(SmoothingComboBox_SelectedIndexChanged);
  908. //
  909. // fontBoldButton
  910. //
  911. this.fontBoldButton.Name = "boldButton";
  912. //
  913. // fontItalicsButton
  914. //
  915. this.fontItalicsButton.Name = "italicsButton";
  916. //
  917. // fontUnderlineButton
  918. //
  919. this.fontUnderlineButton.Name = "underlineButton";
  920. //
  921. // fontAlignLeftButton
  922. //
  923. this.fontAlignLeftButton.Name =

Large files files are truncated, but you can click here to view the full file