ReportPageOptions.cs 24 KB

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