PageRenderTime 57ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 1ms

/src/ToolConfigStrip.cs

https://bitbucket.org/tuldok89/openpdn
C# | 2979 lines | 2335 code | 419 blank | 225 comment | 220 complexity | b71bda30139507e48234f6a58848dd64 MD5 | raw file

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 System.Linq;
  10. using PaintDotNet.Base;
  11. using PaintDotNet.SystemLayer;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.ComponentModel;
  15. using System.Drawing;
  16. using System.Drawing.Drawing2D;
  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 readonly EnumLocalizer _hatchStyleNames = EnumLocalizer.Create(typeof(HatchStyle));
  41. private readonly string _solidBrushText;
  42. private readonly ImageResource _shapeOutlineImage = PdnResources.GetImageResource("Icons.ShapeOutlineIcon.png");
  43. private readonly ImageResource _shapeInteriorImage = PdnResources.GetImageResource("Icons.ShapeInteriorIcon.png");
  44. private readonly 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 readonly EnumLocalizer _lineCapLocalizer = EnumLocalizer.Create(typeof(LineCap2));
  60. private readonly EnumLocalizer _dashStyleLocalizer = EnumLocalizer.Create(typeof(DashStyle));
  61. private ToolStripSeparator _blendingSeparator;
  62. private ToolStripSplitButton _alphaBlendingSplitButton;
  63. private bool _alphaBlendingEnabled = true;
  64. private readonly ImageResource _alphaBlendingEnabledImage;
  65. private readonly ImageResource _alphaBlendingOverwriteImage;
  66. private ToolStripSplitButton _antiAliasingSplitButton;
  67. private bool _antiAliasingEnabled = true;
  68. private readonly ImageResource _antiAliasingEnabledImage;
  69. private readonly ImageResource _antiAliasingDisabledImage;
  70. private readonly EnumLocalizer _resamplingAlgorithmNames = EnumLocalizer.Create(typeof(ResamplingAlgorithm));
  71. private ToolStripSeparator _resamplingSeparator;
  72. private ToolStripLabel _resamplingLabel;
  73. private ToolStripComboBox _resamplingComboBox;
  74. private readonly 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 readonly LineCap2[] _lineCaps =
  83. new[]
  84. {
  85. LineCap2.Flat,
  86. LineCap2.Arrow,
  87. LineCap2.ArrowFilled,
  88. LineCap2.Rounded
  89. };
  90. private readonly DashStyle[] _dashStyles =
  91. new[]
  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 readonly int[] _brushSizes =
  102. new[]
  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 readonly 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 readonly ImageResource _gradientAllColorChannelsImage;
  124. private readonly ImageResource _gradientAlphaChannelOnlyImage;
  125. private readonly 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 readonly FontFamily _arialFontFamily;
  130. private FontStyle _fontStyle;
  131. private TextAlignment _alignment;
  132. private float _oldSizeValue;
  133. private readonly Brush _highlightBrush;
  134. private readonly Brush _highlightTextBrush;
  135. private readonly Brush _windowBrush;
  136. private readonly Brush _windowTextBrush;
  137. private readonly Font _arialFontBase;
  138. private const string ArialName = "Arial";
  139. private static readonly ManualResetEvent StaticFontNamesPopulatedEvent = new ManualResetEvent(false);
  140. private static List<string> _staticFontNames;
  141. private bool _fontsComboBoxPopulated;
  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 readonly int[] _defaultFontSizes =
  156. new[]
  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 (_brushStyleComboBox.SelectedItem.ToString() == _solidBrushText)
  225. {
  226. return new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal);
  227. }
  228. if (_brushStyleComboBox.SelectedIndex == -1)
  229. {
  230. return new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal);
  231. }
  232. return new BrushInfo(
  233. BrushType.Hatch,
  234. (HatchStyle)_hatchStyleNames.LocalizedNameToEnumValue(_brushStyleComboBox.SelectedItem.ToString()));
  235. }
  236. set {
  237. _brushStyleComboBox.SelectedItem = value.BrushType == BrushType.Solid ? _solidBrushText : _hatchStyleNames.EnumValueToLocalizedName(value.HatchStyle);
  238. }
  239. }
  240. public event EventHandler GradientInfoChanged;
  241. protected virtual void OnGradientInfoChanged()
  242. {
  243. if (GradientInfoChanged != null)
  244. {
  245. GradientInfoChanged(this, EventArgs.Empty);
  246. }
  247. }
  248. public void PerformGradientInfoChanged()
  249. {
  250. OnGradientInfoChanged();
  251. }
  252. public GradientInfo GradientInfo
  253. {
  254. get
  255. {
  256. return _gradientInfo;
  257. }
  258. set
  259. {
  260. if (value == null)
  261. {
  262. throw new ArgumentNullException();
  263. }
  264. _gradientInfo = value;
  265. OnGradientInfoChanged();
  266. SyncGradientInfo();
  267. }
  268. }
  269. private void SyncGradientInfo()
  270. {
  271. _gradientConicalButton.Checked = false;
  272. _gradientRadialButton.Checked = false;
  273. _gradientLinearClampedButton.Checked = false;
  274. _gradientLinearReflectedButton.Checked = false;
  275. _gradientLinearDiamondButton.Checked = false;
  276. switch (_gradientInfo.GradientType)
  277. {
  278. case GradientType.Conical:
  279. _gradientConicalButton.Checked = true;
  280. break;
  281. case GradientType.LinearClamped:
  282. _gradientLinearClampedButton.Checked = true;
  283. break;
  284. case GradientType.LinearReflected:
  285. _gradientLinearReflectedButton.Checked = true;
  286. break;
  287. case GradientType.LinearDiamond:
  288. _gradientLinearDiamondButton.Checked = true;
  289. break;
  290. case GradientType.Radial:
  291. _gradientRadialButton.Checked = true;
  292. break;
  293. default:
  294. throw new InvalidEnumArgumentException();
  295. }
  296. _gradientChannelsSplitButton.Image = _gradientInfo.AlphaOnly ? _gradientAlphaChannelOnlyImage.Reference : _gradientAllColorChannelsImage.Reference;
  297. }
  298. private void ShapeButtonDropDownOpening(object sender, EventArgs e)
  299. {
  300. var outlineMI = new ToolStripMenuItem
  301. {
  302. Text = PdnResources.GetString("ShapeDrawTypeConfigWidget.OutlineButton.ToolTipText"),
  303. Image = _shapeOutlineImage.Reference,
  304. Tag = ShapeDrawType.Outline
  305. };
  306. outlineMI.Click += ShapeMIClick;
  307. var interiorMI = new ToolStripMenuItem
  308. {
  309. Text =
  310. PdnResources.GetString("ShapeDrawTypeConfigWidget.InteriorButton.ToolTipText"),
  311. Image = _shapeInteriorImage.Reference,
  312. Tag = ShapeDrawType.Interior
  313. };
  314. interiorMI.Click += ShapeMIClick;
  315. var bothMI = new ToolStripMenuItem
  316. {
  317. Text = PdnResources.GetString("ShapeDrawTypeConfigWidget.BothButton.ToolTipText"),
  318. Image = _shapeBothImage.Reference,
  319. Tag = ShapeDrawType.Both
  320. };
  321. bothMI.Click += ShapeMIClick;
  322. switch (_shapeDrawType)
  323. {
  324. case ShapeDrawType.Outline:
  325. outlineMI.Checked = true;
  326. break;
  327. case ShapeDrawType.Interior:
  328. interiorMI.Checked = true;
  329. break;
  330. case ShapeDrawType.Both:
  331. bothMI.Checked = true;
  332. break;
  333. default:
  334. throw new InvalidEnumArgumentException();
  335. }
  336. _shapeButton.DropDownItems.AddRange(
  337. new ToolStripItem[]
  338. {
  339. outlineMI,
  340. interiorMI,
  341. bothMI
  342. });
  343. }
  344. private void ShapeMIClick(object sender, EventArgs e)
  345. {
  346. var sdt = (ShapeDrawType)((ToolStripMenuItem)sender).Tag;
  347. Tracing.LogFeature("ToolConfigStrip(" + sdt + ")");
  348. ShapeDrawType = sdt;
  349. }
  350. public ToolConfigStrip()
  351. {
  352. SuspendLayout();
  353. InitializeComponent();
  354. _solidBrushText = PdnResources.GetString("BrushConfigWidget.SolidBrush.Text"); // "Solid Brush"
  355. _brushStyleComboBox.Items.Add(_solidBrushText);
  356. string[] styleNames = _hatchStyleNames.GetLocalizedNames();
  357. Array.Sort(styleNames);
  358. foreach (string styleName in styleNames)
  359. {
  360. _brushStyleComboBox.Items.Add(styleName);
  361. }
  362. _brushStyleComboBox.SelectedIndex = 0;
  363. _brushStyleLabel.Text = PdnResources.GetString("BrushConfigWidget.FillStyleLabel.Text");
  364. _shapeDrawType = ShapeDrawType.Outline;
  365. _shapeButton.Image = _shapeOutlineImage.Reference;
  366. _penSizeLabel.Text = PdnResources.GetString("PenConfigWidget.BrushWidthLabel");
  367. _penSizeComboBox.ComboBox.SuspendLayout();
  368. for (int i = 0; i < _brushSizes.Length; ++i)
  369. {
  370. _penSizeComboBox.Items.Add(_brushSizes[i].ToString());
  371. }
  372. _penSizeComboBox.ComboBox.ResumeLayout(false);
  373. _penSizeComboBox.SelectedIndex = 1; // default to brush size of 2
  374. _penSizeDecButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenSizeDecButton.ToolTipText");
  375. _penSizeDecButton.Image = PdnResources.GetImageResource("Icons.MinusButtonIcon.png").Reference;
  376. _penSizeIncButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenSizeIncButton.ToolTipText");
  377. _penSizeIncButton.Image = PdnResources.GetImageResource("Icons.PlusButtonIcon.png").Reference;
  378. _penStyleLabel.Text = PdnResources.GetString("ToolConfigStrip.PenStyleLabel.Text");
  379. _penStartCapSplitButton.Tag = PenInfo.DefaultLineCap;
  380. _penStartCapSplitButton.Image = GetLineCapImage(PenInfo.DefaultLineCap, true).Reference;
  381. _penStartCapSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenStartCapSplitButton.ToolTipText");
  382. _penDashStyleSplitButton.Tag = PenInfo.DefaultDashStyle;
  383. _penDashStyleSplitButton.Image = GetDashStyleImage(PenInfo.DefaultDashStyle);
  384. _penDashStyleSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenDashStyleSplitButton.ToolTipText");
  385. _penEndCapSplitButton.Tag = PenInfo.DefaultLineCap;
  386. _penEndCapSplitButton.Image = GetLineCapImage(PenInfo.DefaultLineCap, false).Reference;
  387. _penEndCapSplitButton.ToolTipText = PdnResources.GetString("ToolConfigStrip.PenEndCapSplitButton.ToolTipText");
  388. _gradientLinearClampedButton.ToolTipText = _gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearClamped);
  389. _gradientLinearClampedButton.Image = PdnResources.GetImageResource("Icons.LinearClampedGradientIcon.png").Reference;
  390. _gradientLinearReflectedButton.ToolTipText = _gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearReflected);
  391. _gradientLinearReflectedButton.Image = PdnResources.GetImageResource("Icons.LinearReflectedGradientIcon.png").Reference;
  392. _gradientLinearDiamondButton.ToolTipText = _gradientTypeNames.EnumValueToLocalizedName(GradientType.LinearDiamond);
  393. _gradientLinearDiamondButton.Image = PdnResources.GetImageResource("Icons.LinearDiamondGradientIcon.png").Reference;
  394. _gradientRadialButton.ToolTipText = _gradientTypeNames.EnumValueToLocalizedName(GradientType.Radial);
  395. _gradientRadialButton.Image = PdnResources.GetImageResource("Icons.RadialGradientIcon.png").Reference;
  396. _gradientConicalButton.ToolTipText = _gradientTypeNames.EnumValueToLocalizedName(GradientType.Conical);
  397. _gradientConicalButton.Image = PdnResources.GetImageResource("Icons.ConicalGradientIcon.png").Reference;
  398. _gradientAllColorChannelsImage = PdnResources.GetImageResource("Icons.AllColorChannelsIcon.png");
  399. _gradientAlphaChannelOnlyImage = PdnResources.GetImageResource("Icons.AlphaChannelOnlyIcon.png");
  400. _gradientChannelsSplitButton.Image = _gradientAllColorChannelsImage.Reference;
  401. _antiAliasingEnabledImage = PdnResources.GetImageResource("Icons.AntiAliasingEnabledIcon.png");
  402. _antiAliasingDisabledImage = PdnResources.GetImageResource("Icons.AntiAliasingDisabledIcon.png");
  403. _antiAliasingSplitButton.Image = _antiAliasingEnabledImage.Reference;
  404. _alphaBlendingEnabledImage = PdnResources.GetImageResource("Icons.BlendingEnabledIcon.png");
  405. _alphaBlendingOverwriteImage = PdnResources.GetImageResource("Icons.BlendingOverwriteIcon.png");
  406. _alphaBlendingSplitButton.Image = _alphaBlendingEnabledImage.Reference;
  407. _penSizeComboBox.Size = new Size(UI.ScaleWidth(_penSizeComboBox.Width), _penSizeComboBox.Height);
  408. _brushStyleComboBox.Size = new Size(UI.ScaleWidth(_brushStyleComboBox.Width), _brushStyleComboBox.Height);
  409. _brushStyleComboBox.DropDownWidth = UI.ScaleWidth(_brushStyleComboBox.DropDownWidth);
  410. _brushStyleComboBox.DropDownHeight = UI.ScaleHeight(_brushStyleComboBox.DropDownHeight);
  411. _toleranceLabel.Text = PdnResources.GetString("ToleranceConfig.ToleranceLabel.Text");
  412. _toleranceSlider.Tolerance = 0.5f;
  413. if (_fontSizeComboBox.ComboBox != null) _fontSizeComboBox.ComboBox.SuspendLayout();
  414. for (int i = 0; i < _defaultFontSizes.Length; ++i)
  415. {
  416. _fontSizeComboBox.Items.Add(_defaultFontSizes[i].ToString());
  417. }
  418. if (_fontSizeComboBox.ComboBox != null) _fontSizeComboBox.ComboBox.ResumeLayout(false);
  419. _fontSmoothingComboBox.Items.AddRange(
  420. new object[]
  421. {
  422. _fontSmoothingLocalizer.EnumValueToLocalizedName(FontSmoothing.Smooth),
  423. _fontSmoothingLocalizer.EnumValueToLocalizedName(FontSmoothing.Sharp)
  424. });
  425. _fontSmoothingComboBox.SelectedIndex = 0;
  426. _fontLabel.Text = PdnResources.GetString("TextConfigWidget.FontLabel.Text");
  427. try
  428. {
  429. _arialFontFamily = new FontFamily(ArialName);
  430. }
  431. catch (Exception)
  432. {
  433. _arialFontFamily = new FontFamily(System.Drawing.Text.GenericFontFamilies.SansSerif);
  434. }
  435. try
  436. {
  437. _arialFontBase = new Font(_arialFontFamily, InitialFontSize, FontStyle.Regular);
  438. }
  439. catch (Exception)
  440. {
  441. _arialFontBase = new Font(FontFamily.GenericSansSerif, InitialFontSize, FontStyle.Regular);
  442. }
  443. _fontFamilyComboBox.ComboBox.DropDownHeight = 600;
  444. _alignment = TextAlignment.Left;
  445. _fontAlignLeftButton.Checked = true;
  446. _oldSizeValue = InitialFontSize;
  447. _highlightBrush = new SolidBrush(SystemColors.Highlight);
  448. _highlightTextBrush = new SolidBrush(SystemColors.HighlightText);
  449. _windowBrush = new SolidBrush(SystemColors.Window);
  450. _windowTextBrush = new SolidBrush(SystemColors.WindowText);
  451. // These buttons need a color key to maintain consistency with v2.5 language packs
  452. _fontBoldButton.ImageTransparentColor = Utility.TransparentKey;
  453. _fontItalicsButton.ImageTransparentColor = Utility.TransparentKey;
  454. _fontUnderlineButton.ImageTransparentColor = Utility.TransparentKey;
  455. _fontBoldButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontBoldIcon");
  456. _fontItalicsButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontItalicIcon");
  457. _fontUnderlineButton.Image = PdnResources.GetImageBmpOrPng("Icons.FontUnderlineIcon");
  458. _fontAlignLeftButton.Image = PdnResources.GetImageResource("Icons.TextAlignLeftIcon.png").Reference;
  459. _fontAlignCenterButton.Image = PdnResources.GetImageResource("Icons.TextAlignCenterIcon.png").Reference;
  460. _fontAlignRightButton.Image = PdnResources.GetImageResource("Icons.TextAlignRightIcon.png").Reference;
  461. _fontBoldButton.ToolTipText = PdnResources.GetString("TextConfigWidget.BoldButton.ToolTipText");
  462. _fontItalicsButton.ToolTipText = PdnResources.GetString("TextConfigWidget.ItalicButton.ToolTipText");
  463. _fontUnderlineButton.ToolTipText = PdnResources.GetString("TextConfigWidget.UnderlineButton.ToolTipText");
  464. _fontAlignLeftButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignLeftButton.ToolTipText");
  465. _fontAlignCenterButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignCenterButton.ToolTipText");
  466. _fontAlignRightButton.ToolTipText = PdnResources.GetString("TextConfigWidget.AlignRightButton.ToolTipText");
  467. _fontFamilyComboBox.Size = new Size(UI.ScaleWidth(_fontFamilyComboBox.Width), _fontFamilyComboBox.Height);
  468. _fontFamilyComboBox.DropDownWidth = UI.ScaleWidth(_fontFamilyComboBox.DropDownWidth);
  469. _fontSizeComboBox.Size = new Size(UI.ScaleWidth(_fontSizeComboBox.Width), _fontSizeComboBox.Height);
  470. _fontSmoothingComboBox.Size = new Size(UI.ScaleWidth(_fontSmoothingComboBox.Width), _fontSmoothingComboBox.Height);
  471. _fontSmoothingComboBox.DropDownWidth = UI.ScaleWidth(_fontSmoothingComboBox.DropDownWidth);
  472. _resamplingLabel.Text = PdnResources.GetString("ToolConfigStrip.ResamplingLabel.Text");
  473. _resamplingComboBox.BeginUpdate();
  474. _resamplingComboBox.Items.Add(_resamplingAlgorithmNames.EnumValueToLocalizedName(ResamplingAlgorithm.Bilinear));
  475. _resamplingComboBox.Items.Add(_resamplingAlgorithmNames.EnumValueToLocalizedName(ResamplingAlgorithm.NearestNeighbor));
  476. _resamplingComboBox.EndUpdate();
  477. _resamplingComboBox.SelectedIndex = 0; // bilinear
  478. _resamplingComboBox.Size = new Size(UI.ScaleWidth(_resamplingComboBox.Width), _resamplingComboBox.Height);
  479. _resamplingComboBox.DropDownWidth = UI.ScaleWidth(_resamplingComboBox.DropDownWidth);
  480. _colorPickerLabel.Text = PdnResources.GetString("ToolConfigStrip.ColorPickerLabel.Text");
  481. string[] colorPickerBehaviorNames = _colorPickerBehaviorNames.GetLocalizedNames();
  482. // Make sure these items are sorted to be in the order specified by the enumeration
  483. Array.Sort(
  484. colorPickerBehaviorNames,
  485. delegate(string lhs, string rhs)
  486. {
  487. var lhsE = (ColorPickerClickBehavior)_colorPickerBehaviorNames.LocalizedNameToEnumValue(lhs);
  488. var rhsE = (ColorPickerClickBehavior)_colorPickerBehaviorNames.LocalizedNameToEnumValue(rhs);
  489. if ((int)lhsE < (int)rhsE)
  490. {
  491. return -1;
  492. }
  493. return (int) lhsE > (int) rhsE ? +1 : 0;
  494. });
  495. _colorPickerComboBox.Items.AddRange(colorPickerBehaviorNames);
  496. _colorPickerComboBox.SelectedIndex = 0;
  497. _colorPickerComboBox.Size = new Size(UI.ScaleWidth(_colorPickerComboBox.Width), _colorPickerComboBox.Height);
  498. _colorPickerComboBox.DropDownWidth = UI.ScaleWidth(_colorPickerComboBox.DropDownWidth);
  499. _toleranceSlider.Size = UI.ScaleSize(_toleranceSlider.Size);
  500. _selectionCombineModeLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionCombineModeLabel.Text");
  501. _floodModeLabel.Text = PdnResources.GetString("ToolConfigStrip.FloodModeLabel.Text");
  502. _selectionDrawModeModeLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeLabel.Text");
  503. _selectionDrawModeWidthLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeWidthLabel.Text");
  504. _selectionDrawModeHeightLabel.Text = PdnResources.GetString("ToolConfigStrip.SelectionDrawModeHeightLabel.Text");
  505. _selectionDrawModeSwapButton.Image = PdnResources.GetImageResource("Icons.ToolConfigStrip.SelectionDrawModeSwapButton.png").Reference;
  506. _selectionDrawModeWidthTextBox.Size = new Size(UI.ScaleWidth(_selectionDrawModeWidthTextBox.Width), _selectionDrawModeWidthTextBox.Height);
  507. _selectionDrawModeHeightTextBox.Size = new Size(UI.ScaleWidth(_selectionDrawModeHeightTextBox.Width), _selectionDrawModeHeightTextBox.Height);
  508. _selectionDrawModeUnits.Size = new Size(UI.ScaleWidth(_selectionDrawModeUnits.Width), _selectionDrawModeUnits.Height);
  509. ToolBarConfigItems = ToolBarConfigItems.None;
  510. ResumeLayout(false);
  511. }
  512. private void AsyncInitFontNames()
  513. {
  514. if (!IsHandleCreated)
  515. {
  516. CreateControl();
  517. }
  518. if (_fontFamilyComboBox.ComboBox != null)
  519. if (!_fontFamilyComboBox.ComboBox.IsHandleCreated)
  520. {
  521. _fontFamilyComboBox.ComboBox.CreateControl();
  522. }
  523. if (_staticFontNames == null)
  524. {
  525. ThreadPool.QueueUserWorkItem(PopulateFontsBackgroundThread, null);
  526. }
  527. }
  528. protected override void OnHandleCreated(EventArgs e)
  529. {
  530. if ((_toolBarConfigItems & ToolBarConfigItems.Text) == ToolBarConfigItems.Text)
  531. {
  532. AsyncInitFontNames();
  533. }
  534. base.OnHandleCreated(e);
  535. }
  536. private void InitializeComponent()
  537. {
  538. _brushSeparator = new ToolStripSeparator();
  539. _brushStyleLabel = new ToolStripLabel();
  540. _brushStyleComboBox = new ToolStripComboBox();
  541. _shapeSeparator = new ToolStripSeparator();
  542. _shapeButton = new ToolStripSplitButton();
  543. _gradientSeparator1 = new ToolStripSeparator();
  544. _gradientLinearClampedButton = new ToolStripButton();
  545. _gradientLinearReflectedButton = new ToolStripButton();
  546. _gradientLinearDiamondButton = new ToolStripButton();
  547. _gradientRadialButton = new ToolStripButton();
  548. _gradientConicalButton = new ToolStripButton();
  549. _gradientSeparator2 = new ToolStripSeparator();
  550. _gradientChannelsSplitButton = new ToolStripSplitButton();
  551. _penSeparator = new ToolStripSeparator();
  552. _penSizeLabel = new ToolStripLabel();
  553. _penSizeDecButton = new ToolStripButton();
  554. _penSizeComboBox = new ToolStripComboBox();
  555. _penSizeIncButton = new ToolStripButton();
  556. _penStyleLabel = new ToolStripLabel();
  557. _penStartCapSplitButton = new ToolStripSplitButton();
  558. _penDashStyleSplitButton = new ToolStripSplitButton();
  559. _penEndCapSplitButton = new ToolStripSplitButton();
  560. _blendingSeparator = new ToolStripSeparator();
  561. _antiAliasingSplitButton = new ToolStripSplitButton();
  562. _alphaBlendingSplitButton = new ToolStripSplitButton();
  563. _toleranceSeparator = new ToolStripSeparator();
  564. _toleranceLabel = new ToolStripLabel();
  565. _toleranceSlider = new ToleranceSliderControl();
  566. _toleranceSliderStrip = new ToolStripControlHost(_toleranceSlider);
  567. _fontSeparator = new ToolStripSeparator();
  568. _fontLabel = new ToolStripLabel();
  569. _fontFamilyComboBox = new ToolStripComboBox();
  570. _fontSizeComboBox = new ToolStripComboBox();
  571. _fontSmoothingComboBox = new ToolStripComboBox();
  572. _fontStyleSeparator = new ToolStripSeparator();
  573. _fontBoldButton = new ToolStripButton();
  574. _fontItalicsButton = new ToolStripButton();
  575. _fontUnderlineButton = new ToolStripButton();
  576. _fontAlignSeparator = new ToolStripSeparator();
  577. _fontAlignLeftButton = new ToolStripButton();
  578. _fontAlignCenterButton = new ToolStripButton();
  579. _fontAlignRightButton = new ToolStripButton();
  580. _resamplingSeparator = new ToolStripSeparator();
  581. _resamplingLabel = new ToolStripLabel();
  582. _resamplingComboBox = new ToolStripComboBox();
  583. _colorPickerSeparator = new ToolStripSeparator();
  584. _colorPickerLabel = new ToolStripLabel();
  585. _colorPickerComboBox = new ToolStripComboBox();
  586. _selectionCombineModeSeparator = new ToolStripSeparator();
  587. _selectionCombineModeLabel = new ToolStripLabel();
  588. _selectionCombineModeSplitButton = new ToolStripSplitButton();
  589. _floodModeSeparator = new ToolStripSeparator();
  590. _floodModeLabel = new ToolStripLabel();
  591. _floodModeSplitButton = new ToolStripSplitButton();
  592. _selectionDrawModeSeparator = new ToolStripSeparator();
  593. _selectionDrawModeModeLabel = new ToolStripLabel();
  594. _selectionDrawModeSplitButton = new ToolStripSplitButton();
  595. _selectionDrawModeWidthLabel = new ToolStripLabel();
  596. _selectionDrawModeWidthTextBox = new ToolStripTextBox {TextBox = {Width = 50}};
  597. _selectionDrawModeSwapButton = new ToolStripButton();
  598. _selectionDrawModeHeightLabel = new ToolStripLabel();
  599. _selectionDrawModeHeightTextBox = new ToolStripTextBox {TextBox = {Width = 50}};
  600. _selectionDrawModeUnits = new UnitsComboBoxStrip();
  601. SuspendLayout();
  602. //
  603. // brushStyleLabel
  604. //
  605. _brushStyleLabel.Name = "fillStyleLabel";
  606. //
  607. // brushStyleComboBox
  608. //
  609. _brushStyleComboBox.Name = "styleComboBox";
  610. _brushStyleComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  611. _brushStyleComboBox.DropDownWidth = 234;
  612. _brushStyleComboBox.AutoSize = true;
  613. //
  614. // brushStyleComboBox.ComboBox
  615. //
  616. if (_brushStyleComboBox.ComboBox != null)
  617. {
  618. _brushStyleComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawVariable;
  619. _brushStyleComboBox.ComboBox.MeasureItem += ComboBoxStyleMeasureItem;
  620. _brushStyleComboBox.ComboBox.SelectedValueChanged += ComboBoxStyleSelectedValueChanged;
  621. _brushStyleComboBox.ComboBox.DrawItem += ComboBoxStyleDrawItem;
  622. }
  623. //
  624. // shapeButton
  625. //
  626. _shapeButton.Name = "shapeButton";
  627. _shapeButton.DropDownOpening += ShapeButtonDropDownOpening;
  628. _shapeButton.DropDownClosed +=
  629. (sender, e) => _shapeButton.DropDownItems.Clear();
  630. _shapeButton.ButtonClick +=
  631. delegate
  632. {
  633. Tracing.LogFeature("ToolConfigStrip(shapeButton)");
  634. switch (ShapeDrawType)
  635. {
  636. case ShapeDrawType.Outline:
  637. ShapeDrawType = ShapeDrawType.Interior;
  638. break;
  639. case ShapeDrawType.Interior:
  640. ShapeDrawType = ShapeDrawType.Both;
  641. break;
  642. case ShapeDrawType.Both:
  643. ShapeDrawType = ShapeDrawType.Outline;
  644. break;
  645. default:
  646. throw new InvalidEnumArgumentException();
  647. }
  648. };
  649. //
  650. // gradientSeparator
  651. //
  652. _gradientSeparator1.Name = "gradientSeparator";
  653. //
  654. // gradientLinearClampedButton
  655. //
  656. _gradientLinearClampedButton.Name = "gradientLinearClampedButton";
  657. _gradientLinearClampedButton.Click += GradientTypeButtonClicked;
  658. _gradientLinearClampedButton.Tag = GradientType.LinearClamped;
  659. //
  660. // gradientLinearReflectedButton
  661. //
  662. _gradientLinearReflectedButton.Name = "gradientLinearReflectedButton";
  663. _gradientLinearReflectedButton.Click += GradientTypeButtonClicked;
  664. _gradientLinearReflectedButton.Tag = GradientType.LinearReflected;
  665. //
  666. // gradientLinearDiamondButton
  667. //
  668. _gradientLinearDiamondButton.Name = "gradientLinearDiamondButton";
  669. _gradientLinearDiamondButton.Click += GradientTypeButtonClicked;
  670. _gradientLinearDiamondButton.Tag = GradientType.LinearDiamond;
  671. //
  672. // gradientRadialButton
  673. //
  674. _gradientRadialButton.Name = "gradientRadialButton";
  675. _gradientRadialButton.Click += GradientTypeButtonClicked;
  676. _gradientRadialButton.Tag = GradientType.Radial;
  677. //
  678. // gradientConicalButton
  679. //
  680. _gradientConicalButton.Name = "gradientConicalButton";
  681. _gradientConicalButton.Click += GradientTypeButtonClicked;
  682. _gradientConicalButton.Tag = GradientType.Conical;
  683. //
  684. // gradientSeparator2
  685. //
  686. _gradientSeparator2.Name = "gradientSeparator2";
  687. //
  688. // gradientChannelsSplitButton
  689. //
  690. _gradientChannelsSplitButton.Name = "gradientChannelsSplitButton";
  691. _gradientChannelsSplitButton.DropDownOpening += GradientChannelsSplitButtonDropDownOpening;
  692. _gradientChannelsSplitButton.DropDownClosed +=
  693. (sender, e) => _gradientChannelsSplitButton.DropDownItems.Clear();
  694. _gradientChannelsSplitButton.ButtonClick +=
  695. delegate
  696. {
  697. Tracing.LogFeature("ToolConfigStrip(gradientChannelsSplitButton)");
  698. GradientInfo = new GradientInfo(GradientInfo.GradientType, !GradientInfo.AlphaOnly);
  699. };
  700. //
  701. // penSeparator
  702. //
  703. _penSeparator.Name = "penSeparator";
  704. //
  705. // penSizeLabel
  706. //
  707. _penSizeLabel.Name = "brushSizeLabel";
  708. //
  709. // penSizeDecButton
  710. //
  711. _penSizeDecButton.Name = "penSizeDecButton";
  712. _penSizeDecButton.Click +=
  713. delegate
  714. {
  715. Tracing.LogFeature("ToolConfigStrip(penSizeDecButton)");
  716. float amount = -1.0f;
  717. if ((ModifierKeys & Keys.Control) != 0)
  718. {
  719. amount *= 5.0f;
  720. }
  721. AddToPenSize(amount);
  722. };
  723. //
  724. // penSizeComboBox
  725. //
  726. _penSizeComboBox.Name = "penSizeComboBox";
  727. _penSizeComboBox.Validating += BrushSizeComboBoxValidating;
  728. _penSizeComboBox.TextChanged += SizeComboBoxTextChanged;
  729. _penSizeComboBox.AutoSize = false;
  730. _penSizeComboBox.Width = 44;
  731. //
  732. // penSizeIncButton
  733. //
  734. _penSizeIncButton.Name = "penSizeIncButton";
  735. _penSizeIncButton.Click +=
  736. delegate
  737. {
  738. Tracing.LogFeature("ToolConfigStrip(penSizeIncButton)");
  739. float amount = 1.0f;
  740. if ((ModifierKeys & Keys.Control) != 0)
  741. {
  742. amount *= 5.0f;
  743. }
  744. AddToPenSize(amount);
  745. };
  746. //
  747. // penStartCapLabel
  748. //
  749. _penStyleLabel.Name = "penStartCapLabel";
  750. //
  751. // penStartCapSplitButton
  752. //
  753. _penStartCapSplitButton.Name = "penStartCapSplitButton";
  754. _penStartCapSplitButton.DropDownOpening += PenCapSplitButtonDropDownOpening;
  755. _penStartCapSplitButton.DropDownClosed +=
  756. (sender, e) => _penStartCapSplitButton.DropDownItems.Clear();
  757. _penStartCapSplitButton.ButtonClick +=
  758. delegate
  759. {
  760. Tracing.LogFeature("ToolConfigStrip(penStartCapSplitButton)");
  761. CyclePenStartCap();
  762. };
  763. //
  764. // penDashStyleSplitButton
  765. //
  766. _penDashStyleSplitButton.Name = "penDashStyleSplitButton";
  767. _penDashStyleSplitButton.ImageScaling = ToolStripItemImageScaling.None;
  768. _penDashStyleSplitButton.DropDownOpening += PenDashStyleButtonDropDownOpening;
  769. _penDashStyleSplitButton.DropDownClosed +=
  770. (sender, e) => _penDashStyleSplitButton.DropDownItems.Clear();
  771. _penDashStyleSplitButton.ButtonClick +=
  772. delegate
  773. {
  774. Tracing.LogFeature("ToolConfigStrip(penDashStyleSplitButton)");
  775. CyclePenDashStyle();
  776. };
  777. //
  778. // penEndCapSplitButton
  779. //
  780. _penEndCapSplitButton.Name = "penEndCapSplitButton";
  781. _penEndCapSplitButton.DropDownOpening += PenCapSplitButtonDropDownOpening;
  782. _penEndCapSplitButton.DropDownClosed +=
  783. (sender, e) => _penEndCapSplitButton.DropDownItems.Clear();
  784. _penEndCapSplitButton.ButtonClick +=
  785. delegate
  786. {
  787. Tracing.LogFeature("ToolConfigStrip(penEndCapSplitButton)");
  788. CyclePenEndCap();
  789. };
  790. //
  791. // antiAliasingSplitButton
  792. //
  793. _antiAliasingSplitButton.Name = "antiAliasingSplitButton";
  794. _antiAliasingSplitButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
  795. _antiAliasingSplitButton.DropDownOpening += AntiAliasingSplitButtonDropDownOpening;
  796. _antiAliasingSplitButton.DropDownClosed +=
  797. (sender, e) => _antiAliasingSplitButton.DropDownItems.Clear();
  798. _antiAliasingSplitButton.ButtonClick +=
  799. delegate
  800. {
  801. Tracing.LogFeature("ToolConfigStrip(antiAliasingSplitButton)");
  802. AntiAliasing = !AntiAliasing;
  803. };
  804. //
  805. // alphaBlendingSplitButton
  806. //
  807. _alphaBlendingSplitButton.Name = "alphaBlendingSplitButton";
  808. _alphaBlendingSplitButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
  809. _alphaBlendingSplitButton.DropDownOpening += AlphaBlendingSplitButtonDropDownOpening;
  810. _alphaBlendingSplitButton.DropDownClosed +=
  811. (sender, e) => _alphaBlendingSplitButton.DropDownItems.Clear();
  812. _alphaBlendingSplitButton.ButtonClick +=
  813. delegate
  814. {
  815. Tracing.LogFeature("ToolConfigStrip(alphaBlendingSplitButton)");
  816. AlphaBlending = !AlphaBlending;
  817. };
  818. //
  819. // toleranceLabel
  820. //
  821. _toleranceLabel.Name = "toleranceLabel";
  822. //
  823. // toleranceSlider
  824. //
  825. _toleranceSlider.Name = "_toleranceSlider";
  826. _toleranceSlider.ToleranceChanged += ToleranceSliderToleranceChanged;
  827. _toleranceSlider.Size = new Size(150, 16);
  828. //
  829. // toleranceSliderStrip
  830. //
  831. _toleranceSliderStrip.Name = "toleranceSliderStrip";
  832. _toleranceSliderStrip.AutoSize = false;
  833. //
  834. // fontLabel
  835. //
  836. _fontLabel.Name = "fontLabel";
  837. //
  838. // fontFamilyComboBox
  839. //
  840. _fontFamilyComboBox.Name = "fontComboBox";
  841. _fontFamilyComboBox.DropDownWidth = 240;
  842. _fontFamilyComboBox.MaxDropDownItems = 12;
  843. _fontFamilyComboBox.Sorted = true;
  844. _fontFamilyComboBox.GotFocus += FontFamilyComboBoxGotFocus;
  845. _fontFamilyComboBox.Items.Add(ArialName);
  846. _fontFamilyComboBox.SelectedItem = ArialName;
  847. _fontFamilyComboBox.SelectedIndexChanged += FontFamilyComboBoxSelectedIndexChanged;
  848. _fontFamilyComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  849. //
  850. // fontFamilyComboBox.ComboBox
  851. //
  852. if (_fontFamilyComboBox.ComboBox != null)
  853. {
  854. _fontFamilyComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawFixed;
  855. _fontFamilyComboBox.ComboBox.MeasureItem += FontFamilyComboBoxMeasureItem;
  856. _fontFamilyComboBox.ComboBox.DrawItem += FontFamilyComboBoxDrawItem;
  857. }
  858. //
  859. // fontSizeComboBox
  860. //
  861. _fontSizeComboBox.Name = "fontSizeComboBox";
  862. _fontSizeComboBox.AutoSize = false;
  863. _fontSizeComboBox.TextChanged += FontSizeComboBoxTextChanged;
  864. _fontSizeComboBox.Validating += FontSizeComboBoxValidating;
  865. _fontSizeComboBox.Text = InitialFontSize.ToString();
  866. _fontSizeComboBox.Width = 44;
  867. //
  868. // fontSmoothingComboBox
  869. //
  870. _fontSmoothingComboBox.Name = "smoothingComboBOx";
  871. _fontSmoothingComboBox.AutoSize = false;
  872. _fontSmoothingComboBox.Sorted = false;
  873. _fontSmoothingComboBox.Width = 70;
  874. _fontSmoothingComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  875. _fontSmoothingComboBox.SelectedIndexChanged += SmoothingComboBoxSelectedIndexChanged;
  876. //
  877. // fontBoldButton
  878. //
  879. _fontBoldButton.Name = "boldButton";
  880. //
  881. // fontItalicsButton
  882. //
  883. _fontItalicsButton.Name = "italicsButton";
  884. //
  885. // fontUnderlineButton
  886. //
  887. _fontUnderlineButton.Name = "underlineButton";
  888. //
  889. // fontAlignLeftButton
  890. //
  891. _fontAlignLeftButton.Name = "alignLeftButton";
  892. //
  893. // fontAlignCenterButton
  894. //
  895. _fontAlignCenterButton.Name = "alignCenterButton";
  896. //
  897. // fontAlignRightButton
  898. //
  899. _fontAlignRightButton.Name = "alignRightButton";
  900. //
  901. // resamplingSeparator
  902. //
  903. _resamplingSeparator.Name = "resamplingSeparator";
  904. //
  905. // resamplingLabel
  906. //
  907. _resamplingLabel.Name = "resamplingLabel";
  908. //
  909. // resamplingComboBox
  910. //
  911. _resamplingComboBox.Name = "resamplingComboBox";
  912. _resamplingComboBox.AutoSize = true;
  913. _resamplingComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  914. _resamplingComboBox.Sorted = false;
  915. _resamplingComboBox.Width = 100;
  916. _resamplingComboBox.DropDownWidth = 100;
  917. _resamplingComboBox.SelectedIndexChanged += ResamplingComboBoxSelectedIndexChanged;
  918. //
  919. // colorPickerSeparator
  920. //
  921. _colorPickerSeparator.Name = "colorPickerSeparator";
  922. //
  923. // colorPickerLabel
  924. //
  925. _colorPickerLabel.Name = "colorPickerLabel";
  926. //
  927. // colorPickerComboBox
  928. //
  929. _colorPickerComboBox.Name = "colorPickerComboBox";
  930. _colorPickerComboBox.AutoSize = true;
  931. _colorPickerComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  932. _colorPickerComboBox.Width = 200;
  933. _colorPickerComboBox.DropDownWidth = 200;
  934. _colorPickerComboBox.Sorted = false;
  935. _colorPickerComboBox.SelectedIndexChanged += ColorPickerComboBoxSelectedIndexChanged;
  936. //
  937. // selectionCombineModeSeparator
  938. //
  939. _selectionCombineModeSeparator.Name = "selectionCombineModeSeparator";
  940. //
  941. // selectionCombineModeLabel
  942. //
  943. _selectionCombineModeLabel.Name = "selectionCombineModeLabel";
  944. //
  945. // selectionCombineModeSplitButton
  946. //
  947. _selectionCombineModeSplitButton.Name = "selectionCombineModeSplitButton";
  948. _selectionCombineModeSplitButton.DisplayStyle = ToolStripItemDispla

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