ReportPageOptions.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. using System;
  2. using System.IO;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Windows.Forms;
  6. using System.Drawing;
  7. using System.ComponentModel;
  8. using FastReport.Utils;
  9. using FastReport.Design;
  10. using FastReport.Design.PageDesigners.Page;
  11. using System.Globalization;
  12. using FastReport.Controls;
  13. namespace FastReport.Forms
  14. {
  15. internal class ReportPageOptions : DesignerOptionsPage
  16. {
  17. private CheckBox cbSnapToGrid;
  18. private CheckBox cbShowGrid;
  19. private TextBox tbSize;
  20. private Label lblSnapSize;
  21. private RadioButton rbCorners;
  22. private RadioButton rbRectangle;
  23. private RadioButton rbHundrethsOfInch;
  24. private RadioButton rbInches;
  25. private RadioButton rbCentimeters;
  26. private RadioButton rbMillimeters;
  27. private CheckBox cbDottedGrid;
  28. private RadioButton rbClassic;
  29. private RadioButton rbStructure;
  30. private CheckBox cbEditAfterInsert;
  31. private GroupBox gbPageUnits;
  32. private GroupBox gbBandView;
  33. private GroupBox gbMarkers;
  34. private GroupBox gbGrid;
  35. private TabPage tab2;
  36. private CheckBox cbEventObjectIndicator;
  37. private CheckBox cbEventBandIndicator;
  38. private CheckBox cbEnableBacklight;
  39. private CheckBox cbSimplifyDBFields;
  40. private CheckBox cbEnableBacklightIntersectingObjects;
  41. private ColorComboBox ccbBacklightColor;
  42. private ReportPageDesigner pageDesigner;
  43. private CheckBox cbxDisableLastFormatting;
  44. private void InitializeComponent()
  45. {
  46. this.cbDottedGrid = new System.Windows.Forms.CheckBox();
  47. this.tbSize = new System.Windows.Forms.TextBox();
  48. this.cbSnapToGrid = new System.Windows.Forms.CheckBox();
  49. this.cbShowGrid = new System.Windows.Forms.CheckBox();
  50. this.lblSnapSize = new System.Windows.Forms.Label();
  51. this.rbCorners = new System.Windows.Forms.RadioButton();
  52. this.rbRectangle = new System.Windows.Forms.RadioButton();
  53. this.rbHundrethsOfInch = new System.Windows.Forms.RadioButton();
  54. this.rbInches = new System.Windows.Forms.RadioButton();
  55. this.rbCentimeters = new System.Windows.Forms.RadioButton();
  56. this.rbMillimeters = new System.Windows.Forms.RadioButton();
  57. this.rbClassic = new System.Windows.Forms.RadioButton();
  58. this.rbStructure = new System.Windows.Forms.RadioButton();
  59. this.cbEditAfterInsert = new System.Windows.Forms.CheckBox();
  60. this.gbPageUnits = new System.Windows.Forms.GroupBox();
  61. this.gbGrid = new System.Windows.Forms.GroupBox();
  62. this.gbMarkers = new System.Windows.Forms.GroupBox();
  63. this.gbBandView = new System.Windows.Forms.GroupBox();
  64. this.tab2 = new System.Windows.Forms.TabPage();
  65. this.cbSimplifyDBFields = new System.Windows.Forms.CheckBox();
  66. this.cbEnableBacklight = new System.Windows.Forms.CheckBox();
  67. this.cbEventBandIndicator = new System.Windows.Forms.CheckBox();
  68. this.cbEventObjectIndicator = new System.Windows.Forms.CheckBox();
  69. this.cbEnableBacklightIntersectingObjects = new System.Windows.Forms.CheckBox();
  70. this.ccbBacklightColor = new FastReport.Controls.ColorComboBox();
  71. this.cbxDisableLastFormatting = new System.Windows.Forms.CheckBox();
  72. this.tc1.SuspendLayout();
  73. this.tab1.SuspendLayout();
  74. this.gbPageUnits.SuspendLayout();
  75. this.gbGrid.SuspendLayout();
  76. this.gbMarkers.SuspendLayout();
  77. this.gbBandView.SuspendLayout();
  78. this.tab2.SuspendLayout();
  79. this.SuspendLayout();
  80. //
  81. // tc1
  82. //
  83. this.tc1.Controls.Add(this.tab2);
  84. this.tc1.Margin = new System.Windows.Forms.Padding(4);
  85. this.tc1.Size = new System.Drawing.Size(376, 280);
  86. this.tc1.Controls.SetChildIndex(this.tab2, 0);
  87. this.tc1.Controls.SetChildIndex(this.tab1, 0);
  88. //
  89. // tab1
  90. //
  91. this.tab1.Controls.Add(this.gbBandView);
  92. this.tab1.Controls.Add(this.gbMarkers);
  93. this.tab1.Controls.Add(this.gbGrid);
  94. this.tab1.Controls.Add(this.gbPageUnits);
  95. this.tab1.Controls.Add(this.cbEditAfterInsert);
  96. this.tab1.Margin = new System.Windows.Forms.Padding(4);
  97. this.tab1.Padding = new System.Windows.Forms.Padding(4);
  98. this.tab1.Size = new System.Drawing.Size(368, 254);
  99. //
  100. // cbDottedGrid
  101. //
  102. this.cbDottedGrid.AutoSize = true;
  103. this.cbDottedGrid.Location = new System.Drawing.Point(12, 66);
  104. this.cbDottedGrid.Name = "cbDottedGrid";
  105. this.cbDottedGrid.Size = new System.Drawing.Size(80, 17);
  106. this.cbDottedGrid.TabIndex = 8;
  107. this.cbDottedGrid.Text = "Dotted grid";
  108. this.cbDottedGrid.UseVisualStyleBackColor = true;
  109. //
  110. // tbSize
  111. //
  112. this.tbSize.Location = new System.Drawing.Point(92, 88);
  113. this.tbSize.Name = "tbSize";
  114. this.tbSize.Size = new System.Drawing.Size(59, 21);
  115. this.tbSize.TabIndex = 7;
  116. //
  117. // cbSnapToGrid
  118. //
  119. this.cbSnapToGrid.AutoSize = true;
  120. this.cbSnapToGrid.Location = new System.Drawing.Point(12, 43);
  121. this.cbSnapToGrid.Name = "cbSnapToGrid";
  122. this.cbSnapToGrid.Size = new System.Drawing.Size(84, 17);
  123. this.cbSnapToGrid.TabIndex = 4;
  124. this.cbSnapToGrid.Text = "Snap to grid";
  125. this.cbSnapToGrid.UseVisualStyleBackColor = true;
  126. //
  127. // cbShowGrid
  128. //
  129. this.cbShowGrid.AutoSize = true;
  130. this.cbShowGrid.Location = new System.Drawing.Point(12, 20);
  131. this.cbShowGrid.Name = "cbShowGrid";
  132. this.cbShowGrid.Size = new System.Drawing.Size(73, 17);
  133. this.cbShowGrid.TabIndex = 3;
  134. this.cbShowGrid.Text = "Show grid";
  135. this.cbShowGrid.UseVisualStyleBackColor = true;
  136. //
  137. // lblSnapSize
  138. //
  139. this.lblSnapSize.AutoSize = true;
  140. this.lblSnapSize.Location = new System.Drawing.Point(12, 92);
  141. this.lblSnapSize.Name = "lblSnapSize";
  142. this.lblSnapSize.Size = new System.Drawing.Size(56, 13);
  143. this.lblSnapSize.TabIndex = 6;
  144. this.lblSnapSize.Text = "Snap size:";
  145. //
  146. // rbCorners
  147. //
  148. this.rbCorners.AutoSize = true;
  149. this.rbCorners.Location = new System.Drawing.Point(12, 43);
  150. this.rbCorners.Name = "rbCorners";
  151. this.rbCorners.Size = new System.Drawing.Size(63, 17);
  152. this.rbCorners.TabIndex = 1;
  153. this.rbCorners.TabStop = true;
  154. this.rbCorners.Text = "Corners";
  155. this.rbCorners.UseVisualStyleBackColor = true;
  156. //
  157. // rbRectangle
  158. //
  159. this.rbRectangle.AutoSize = true;
  160. this.rbRectangle.Location = new System.Drawing.Point(12, 20);
  161. this.rbRectangle.Name = "rbRectangle";
  162. this.rbRectangle.Size = new System.Drawing.Size(73, 17);
  163. this.rbRectangle.TabIndex = 0;
  164. this.rbRectangle.TabStop = true;
  165. this.rbRectangle.Text = "Rectangle";
  166. this.rbRectangle.UseVisualStyleBackColor = true;
  167. //
  168. // rbHundrethsOfInch
  169. //
  170. this.rbHundrethsOfInch.AutoSize = true;
  171. this.rbHundrethsOfInch.Location = new System.Drawing.Point(12, 89);
  172. this.rbHundrethsOfInch.Name = "rbHundrethsOfInch";
  173. this.rbHundrethsOfInch.Size = new System.Drawing.Size(110, 17);
  174. this.rbHundrethsOfInch.TabIndex = 3;
  175. this.rbHundrethsOfInch.TabStop = true;
  176. this.rbHundrethsOfInch.Text = "Hundreths of inch";
  177. this.rbHundrethsOfInch.UseVisualStyleBackColor = true;
  178. this.rbHundrethsOfInch.CheckedChanged += new System.EventHandler(this.rbMillimeters_CheckedChanged);
  179. //
  180. // rbInches
  181. //
  182. this.rbInches.AutoSize = true;
  183. this.rbInches.Location = new System.Drawing.Point(12, 66);
  184. this.rbInches.Name = "rbInches";
  185. this.rbInches.Size = new System.Drawing.Size(57, 17);
  186. this.rbInches.TabIndex = 2;
  187. this.rbInches.TabStop = true;
  188. this.rbInches.Text = "Inches";
  189. this.rbInches.UseVisualStyleBackColor = true;
  190. this.rbInches.CheckedChanged += new System.EventHandler(this.rbMillimeters_CheckedChanged);
  191. //
  192. // rbCentimeters
  193. //
  194. this.rbCentimeters.AutoSize = true;
  195. this.rbCentimeters.Location = new System.Drawing.Point(12, 43);
  196. this.rbCentimeters.Name = "rbCentimeters";
  197. this.rbCentimeters.Size = new System.Drawing.Size(83, 17);
  198. this.rbCentimeters.TabIndex = 1;
  199. this.rbCentimeters.TabStop = true;
  200. this.rbCentimeters.Text = "Centimeters";
  201. this.rbCentimeters.UseVisualStyleBackColor = true;
  202. this.rbCentimeters.CheckedChanged += new System.EventHandler(this.rbMillimeters_CheckedChanged);
  203. //
  204. // rbMillimeters
  205. //
  206. this.rbMillimeters.AutoSize = true;
  207. this.rbMillimeters.Location = new System.Drawing.Point(12, 20);
  208. this.rbMillimeters.Name = "rbMillimeters";
  209. this.rbMillimeters.Size = new System.Drawing.Size(74, 17);
  210. this.rbMillimeters.TabIndex = 0;
  211. this.rbMillimeters.TabStop = true;
  212. this.rbMillimeters.Text = "Millimeters";
  213. this.rbMillimeters.UseVisualStyleBackColor = true;
  214. this.rbMillimeters.CheckedChanged += new System.EventHandler(this.rbMillimeters_CheckedChanged);
  215. //
  216. // rbClassic
  217. //
  218. this.rbClassic.AutoSize = true;
  219. this.rbClassic.Location = new System.Drawing.Point(12, 44);
  220. this.rbClassic.Name = "rbClassic";
  221. this.rbClassic.Size = new System.Drawing.Size(57, 17);
  222. this.rbClassic.TabIndex = 0;
  223. this.rbClassic.TabStop = true;
  224. this.rbClassic.Text = "Classic";
  225. this.rbClassic.UseVisualStyleBackColor = true;
  226. //
  227. // rbStructure
  228. //
  229. this.rbStructure.AutoSize = true;
  230. this.rbStructure.Location = new System.Drawing.Point(12, 20);
  231. this.rbStructure.Name = "rbStructure";
  232. this.rbStructure.Size = new System.Drawing.Size(70, 17);
  233. this.rbStructure.TabIndex = 0;
  234. this.rbStructure.TabStop = true;
  235. this.rbStructure.Text = "Structure";
  236. this.rbStructure.UseVisualStyleBackColor = true;
  237. //
  238. // cbEditAfterInsert
  239. //
  240. this.cbEditAfterInsert.AutoSize = true;
  241. this.cbEditAfterInsert.Location = new System.Drawing.Point(16, 220);
  242. this.cbEditAfterInsert.Name = "cbEditAfterInsert";
  243. this.cbEditAfterInsert.Size = new System.Drawing.Size(101, 17);
  244. this.cbEditAfterInsert.TabIndex = 4;
  245. this.cbEditAfterInsert.Text = "Edit after insert";
  246. this.cbEditAfterInsert.UseVisualStyleBackColor = true;
  247. //
  248. // gbPageUnits
  249. //
  250. this.gbPageUnits.Controls.Add(this.rbHundrethsOfInch);
  251. this.gbPageUnits.Controls.Add(this.rbMillimeters);
  252. this.gbPageUnits.Controls.Add(this.rbCentimeters);
  253. this.gbPageUnits.Controls.Add(this.rbInches);
  254. this.gbPageUnits.Location = new System.Drawing.Point(16, 12);
  255. this.gbPageUnits.Name = "gbPageUnits";
  256. this.gbPageUnits.Size = new System.Drawing.Size(164, 120);
  257. this.gbPageUnits.TabIndex = 9;
  258. this.gbPageUnits.TabStop = false;
  259. this.gbPageUnits.Text = "Page units";
  260. //
  261. // gbGrid
  262. //
  263. this.gbGrid.Controls.Add(this.cbDottedGrid);
  264. this.gbGrid.Controls.Add(this.cbShowGrid);
  265. this.gbGrid.Controls.Add(this.tbSize);
  266. this.gbGrid.Controls.Add(this.lblSnapSize);
  267. this.gbGrid.Controls.Add(this.cbSnapToGrid);
  268. this.gbGrid.Location = new System.Drawing.Point(188, 12);
  269. this.gbGrid.Name = "gbGrid";
  270. this.gbGrid.Size = new System.Drawing.Size(164, 120);
  271. this.gbGrid.TabIndex = 10;
  272. this.gbGrid.TabStop = false;
  273. this.gbGrid.Text = "Grid";
  274. //
  275. // gbMarkers
  276. //
  277. this.gbMarkers.Controls.Add(this.rbCorners);
  278. this.gbMarkers.Controls.Add(this.rbRectangle);
  279. this.gbMarkers.Location = new System.Drawing.Point(16, 136);
  280. this.gbMarkers.Name = "gbMarkers";
  281. this.gbMarkers.Size = new System.Drawing.Size(164, 72);
  282. this.gbMarkers.TabIndex = 11;
  283. this.gbMarkers.TabStop = false;
  284. this.gbMarkers.Text = "Markers";
  285. //
  286. // gbBandView
  287. //
  288. this.gbBandView.Controls.Add(this.rbClassic);
  289. this.gbBandView.Controls.Add(this.rbStructure);
  290. this.gbBandView.Location = new System.Drawing.Point(188, 136);
  291. this.gbBandView.Name = "gbBandView";
  292. this.gbBandView.Size = new System.Drawing.Size(164, 72);
  293. this.gbBandView.TabIndex = 12;
  294. this.gbBandView.TabStop = false;
  295. this.gbBandView.Text = "Band view";
  296. //
  297. // tab2
  298. //
  299. this.tab2.Controls.Add(this.cbSimplifyDBFields);
  300. this.tab2.Controls.Add(this.cbEnableBacklight);
  301. this.tab2.Controls.Add(this.cbEventBandIndicator);
  302. this.tab2.Controls.Add(this.cbEventObjectIndicator);
  303. this.tab2.Controls.Add(this.cbEnableBacklightIntersectingObjects);
  304. this.tab2.Controls.Add(this.ccbBacklightColor);
  305. this.tab2.Controls.Add(this.cbxDisableLastFormatting);
  306. this.tab2.Location = new System.Drawing.Point(4, 22);
  307. this.tab2.Margin = new System.Windows.Forms.Padding(2);
  308. this.tab2.Name = "tab2";
  309. this.tab2.Padding = new System.Windows.Forms.Padding(2);
  310. this.tab2.Size = new System.Drawing.Size(368, 254);
  311. this.tab2.TabIndex = 1;
  312. this.tab2.Text = "tabPage2";
  313. this.tab2.UseVisualStyleBackColor = true;
  314. //
  315. // cbEnableBacklightIntersectingObjects
  316. //
  317. this.cbEnableBacklightIntersectingObjects.AutoSize = true;
  318. this.cbEnableBacklightIntersectingObjects.Location = new System.Drawing.Point(16, 109);
  319. this.cbEnableBacklightIntersectingObjects.Name = "cbEnableBacklightIntersectingObjects";
  320. this.cbEnableBacklightIntersectingObjects.Size = new System.Drawing.Size(163, 17);
  321. this.cbEnableBacklightIntersectingObjects.TabIndex = 9;
  322. this.cbEnableBacklightIntersectingObjects.Text = "Backlight intersecting objects";
  323. this.cbEnableBacklightIntersectingObjects.UseVisualStyleBackColor = true;
  324. this.cbEnableBacklightIntersectingObjects.CheckedChanged += new System.EventHandler(this.cbEnableBacklightIntersectingObjects_CheckedChanged);
  325. //
  326. // ccbBacklightColor
  327. //
  328. this.ccbBacklightColor.Location = new System.Drawing.Point(284, 106);
  329. this.ccbBacklightColor.Name = "ccbBacklightColor";
  330. this.ccbBacklightColor.Size = new System.Drawing.Size(70, 21);
  331. this.ccbBacklightColor.TabIndex = 10;
  332. this.ccbBacklightColor.Color = Color.IndianRed;
  333. this.ccbBacklightColor.ColorSelected += CcbBacklightColor_ColorSelected;
  334. //
  335. // cbSimplifyDBFields
  336. //
  337. this.cbSimplifyDBFields.AutoSize = true;
  338. this.cbSimplifyDBFields.Location = new System.Drawing.Point(16, 86);
  339. this.cbSimplifyDBFields.Name = "cbSimplifyDBFields";
  340. this.cbSimplifyDBFields.Size = new System.Drawing.Size(163, 17);
  341. this.cbSimplifyDBFields.TabIndex = 8;
  342. this.cbSimplifyDBFields.Text = "Simplified display of DB fields";
  343. this.cbSimplifyDBFields.UseVisualStyleBackColor = true;
  344. //
  345. // cbEnableBacklight
  346. //
  347. this.cbEnableBacklight.AutoSize = true;
  348. this.cbEnableBacklight.Location = new System.Drawing.Point(16, 63);
  349. this.cbEnableBacklight.Name = "cbEnableBacklight";
  350. this.cbEnableBacklight.Size = new System.Drawing.Size(130, 17);
  351. this.cbEnableBacklight.TabIndex = 7;
  352. this.cbEnableBacklight.Text = "Enable band backlight";
  353. this.cbEnableBacklight.UseVisualStyleBackColor = true;
  354. //
  355. // cbxDisableLastFormatting
  356. //
  357. this.cbxDisableLastFormatting.AutoSize = true;
  358. this.cbxDisableLastFormatting.Location = new System.Drawing.Point(16, 132);
  359. this.cbxDisableLastFormatting.Name = "cbxDisableLastFormatting";
  360. this.cbxDisableLastFormatting.Size = new System.Drawing.Size(130, 17);
  361. this.cbxDisableLastFormatting.TabIndex = 13;
  362. this.cbxDisableLastFormatting.Text = "Disable last formatting.";
  363. this.cbxDisableLastFormatting.UseVisualStyleBackColor = true;
  364. //
  365. // cbEventBandIndicator
  366. //
  367. this.cbEventBandIndicator.AutoSize = true;
  368. this.cbEventBandIndicator.Location = new System.Drawing.Point(16, 17);
  369. this.cbEventBandIndicator.Name = "cbEventBandIndicator";
  370. this.cbEventBandIndicator.Size = new System.Drawing.Size(202, 17);
  371. this.cbEventBandIndicator.TabIndex = 6;
  372. this.cbEventBandIndicator.Text = "Show indicator on bands with events";
  373. this.cbEventBandIndicator.UseVisualStyleBackColor = true;
  374. //
  375. // cbEventObjectIndicator
  376. //
  377. this.cbEventObjectIndicator.AutoSize = true;
  378. this.cbEventObjectIndicator.Location = new System.Drawing.Point(16, 40);
  379. this.cbEventObjectIndicator.Name = "cbEventObjectIndicator";
  380. this.cbEventObjectIndicator.Size = new System.Drawing.Size(208, 17);
  381. this.cbEventObjectIndicator.TabIndex = 5;
  382. this.cbEventObjectIndicator.Text = "Show indicator on objects with events";
  383. this.cbEventObjectIndicator.UseVisualStyleBackColor = true;
  384. //
  385. // ReportPageOptions
  386. //
  387. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  388. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
  389. this.ClientSize = new System.Drawing.Size(420, 336);
  390. this.Margin = new System.Windows.Forms.Padding(4);
  391. this.Name = "ReportPageOptions";
  392. this.tc1.ResumeLayout(false);
  393. this.tab1.ResumeLayout(false);
  394. this.tab1.PerformLayout();
  395. this.gbPageUnits.ResumeLayout(false);
  396. this.gbPageUnits.PerformLayout();
  397. this.gbGrid.ResumeLayout(false);
  398. this.gbGrid.PerformLayout();
  399. this.gbMarkers.ResumeLayout(false);
  400. this.gbMarkers.PerformLayout();
  401. this.gbBandView.ResumeLayout(false);
  402. this.gbBandView.PerformLayout();
  403. this.tab2.ResumeLayout(false);
  404. this.tab2.PerformLayout();
  405. this.ResumeLayout(false);
  406. this.PerformLayout();
  407. }
  408. private void CcbBacklightColor_ColorSelected(object sender, EventArgs e)
  409. {
  410. Config.BacklightColor = ccbBacklightColor.Color;
  411. }
  412. private void rbMillimeters_CheckedChanged(object sender, EventArgs e)
  413. {
  414. string units = "";
  415. float size = 0;
  416. if (rbMillimeters.Checked)
  417. {
  418. units = "Misc,ShortUnitsMm";
  419. size = ReportWorkspace.Grid.SnapSizeMillimeters;
  420. }
  421. else if (rbCentimeters.Checked)
  422. {
  423. units = "Misc,ShortUnitsCm";
  424. size = ReportWorkspace.Grid.SnapSizeCentimeters;
  425. }
  426. else if (rbInches.Checked)
  427. {
  428. units = "Misc,ShortUnitsIn";
  429. size = ReportWorkspace.Grid.SnapSizeInches;
  430. }
  431. else if (rbHundrethsOfInch.Checked)
  432. {
  433. units = "Misc,ShortUnitsHi";
  434. size = ReportWorkspace.Grid.SnapSizeHundrethsOfInch;
  435. }
  436. tbSize.Text = size.ToString() + " " + Res.Get(units);
  437. }
  438. private void Localize()
  439. {
  440. MyRes res = new MyRes("Forms,ReportPageOptions");
  441. tab1.Text = res.Get("");
  442. tab2.Text = res.Get("ObjectsAppearance");
  443. gbPageUnits.Text = res.Get("Units");
  444. rbMillimeters.Text = res.Get("Millimeters");
  445. rbCentimeters.Text = res.Get("Centimeters");
  446. rbInches.Text = res.Get("Inches");
  447. rbHundrethsOfInch.Text = res.Get("HundrethsOfInch");
  448. gbGrid.Text = res.Get("Grid");
  449. cbShowGrid.Text = res.Get("ShowGrid");
  450. cbSnapToGrid.Text = res.Get("SnapToGrid");
  451. cbDottedGrid.Text = res.Get("DottedGrid");
  452. lblSnapSize.Text = res.Get("Size");
  453. gbMarkers.Text = res.Get("Markers");
  454. rbRectangle.Text = res.Get("Rectangle");
  455. rbCorners.Text = res.Get("Corners");
  456. gbBandView.Text = res.Get("BandView");
  457. rbStructure.Text = res.Get("Structure");
  458. rbClassic.Text = res.Get("Classic");
  459. cbEditAfterInsert.Text = res.Get("EditAfterInsert");
  460. cbEventBandIndicator.Text = res.Get("EventBandIndicator");
  461. cbEventObjectIndicator.Text = res.Get("EventObjectIndicator");
  462. cbEnableBacklight.Text = res.Get("EnableBacklight");
  463. cbSimplifyDBFields.Text = res.Get("SimplifyDBFields");
  464. cbEnableBacklightIntersectingObjects.Text = res.Get("EnableBacklightIntersectingObjects");
  465. cbxDisableLastFormatting.Text = res.Get("DisableLastFormatting");
  466. }
  467. public override void Init()
  468. {
  469. switch (ReportWorkspace.Grid.GridUnits)
  470. {
  471. case PageUnits.Millimeters:
  472. rbMillimeters.Checked = true;
  473. break;
  474. case PageUnits.Centimeters:
  475. rbCentimeters.Checked = true;
  476. break;
  477. case PageUnits.Inches:
  478. rbInches.Checked = true;
  479. break;
  480. case PageUnits.HundrethsOfInch:
  481. rbHundrethsOfInch.Checked = true;
  482. break;
  483. }
  484. rbMillimeters_CheckedChanged(null, null);
  485. cbShowGrid.Checked = ReportWorkspace.ShowGrid;
  486. cbSnapToGrid.Checked = ReportWorkspace.SnapToGrid;
  487. cbDottedGrid.Checked = ReportWorkspace.Grid.Dotted;
  488. rbRectangle.Checked = ReportWorkspace.MarkerStyle == MarkerStyle.Rectangle;
  489. rbCorners.Checked = ReportWorkspace.MarkerStyle == MarkerStyle.Corners;
  490. rbStructure.Checked = !ReportWorkspace.ClassicView;
  491. rbClassic.Checked = ReportWorkspace.ClassicView;
  492. cbEditAfterInsert.Checked = ReportWorkspace.EditAfterInsert;
  493. cbEventObjectIndicator.Checked = ReportWorkspace.EventObjectIndicator;
  494. cbEventBandIndicator.Checked = ReportWorkspace.EventBandIndicator;
  495. cbEnableBacklight.Checked = ReportWorkspace.EnableBacklight;
  496. cbSimplifyDBFields.Checked = ReportWorkspace.SimplifyDBFields;
  497. cbEnableBacklightIntersectingObjects.Checked = ReportWorkspace.EnableBacklightIntersectingObjects;
  498. ccbBacklightColor.Color = Config.BacklightColor;
  499. ccbBacklightColor.Enabled = ReportWorkspace.EnableBacklightIntersectingObjects;
  500. cbxDisableLastFormatting.Checked = Config.DisableLastFormatting;
  501. }
  502. public override void Done(DialogResult result)
  503. {
  504. if (result == DialogResult.OK)
  505. {
  506. if (rbMillimeters.Checked)
  507. ReportWorkspace.Grid.GridUnits = PageUnits.Millimeters;
  508. else if (rbCentimeters.Checked)
  509. ReportWorkspace.Grid.GridUnits = PageUnits.Centimeters;
  510. else if (rbInches.Checked)
  511. ReportWorkspace.Grid.GridUnits = PageUnits.Inches;
  512. else if (rbHundrethsOfInch.Checked)
  513. ReportWorkspace.Grid.GridUnits = PageUnits.HundrethsOfInch;
  514. ReportWorkspace.ShowGrid = cbShowGrid.Checked;
  515. ReportWorkspace.SnapToGrid = cbSnapToGrid.Checked;
  516. ReportWorkspace.Grid.Dotted = cbDottedGrid.Checked;
  517. ReportWorkspace.Grid.SnapSize = Converter.StringToFloat(tbSize.Text, true);
  518. ReportWorkspace.MarkerStyle = rbRectangle.Checked ? MarkerStyle.Rectangle : MarkerStyle.Corners;
  519. ReportWorkspace.ClassicView = rbClassic.Checked;
  520. ReportWorkspace.EditAfterInsert = cbEditAfterInsert.Checked;
  521. ReportWorkspace.EventObjectIndicator = cbEventObjectIndicator.Checked;
  522. ReportWorkspace.EventBandIndicator = cbEventBandIndicator.Checked;
  523. ReportWorkspace.EnableBacklight = cbEnableBacklight.Checked;
  524. ReportWorkspace.SimplifyDBFields = cbSimplifyDBFields.Checked;
  525. ReportWorkspace.EnableBacklightIntersectingObjects = cbEnableBacklightIntersectingObjects.Checked;
  526. Config.BacklightColor = ccbBacklightColor.Color;
  527. Config.DisableLastFormatting = cbxDisableLastFormatting.Checked;
  528. }
  529. }
  530. public ReportPageOptions(ReportPageDesigner pd) : base()
  531. {
  532. pageDesigner = pd;
  533. InitializeComponent();
  534. Localize();
  535. }
  536. private void cbEnableBacklightIntersectingObjects_CheckedChanged(object sender, EventArgs e)
  537. {
  538. ccbBacklightColor.Enabled = cbEnableBacklightIntersectingObjects.Checked;
  539. }
  540. }
  541. }