ChangeViewDialog.cs 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. using PaintDotNet.Annotation;
  2. using PaintDotNet.Annotation.Enum;
  3. using PaintDotNet.Annotation.FieldView;
  4. using PaintDotNet.DbOpreate.DbBll;
  5. using PaintDotNet.DbOpreate.DbModel;
  6. using System;
  7. using System.Drawing;
  8. using System.Windows.Forms;
  9. namespace PaintDotNet.FieldView
  10. {
  11. /// <summary>
  12. /// 修改视场
  13. /// </summary>
  14. internal class ChangeViewDialog : FloatingToolForm//PdnBaseForm
  15. {
  16. #region 控件
  17. private GroupBox groupBox2;
  18. private Label label1;
  19. private GroupBox groupBox3;
  20. private GroupBox groupBox4;
  21. private GroupBox groupBox5;
  22. private GroupBox groupBox6;
  23. private Label label2;
  24. private Label label3;
  25. private Label label4;
  26. private Label label5;
  27. private Label label6;
  28. private Label label7;
  29. private Label label8;
  30. private NumericUpDown nudActualHeightR;
  31. private NumericUpDown nudActualWidthR;
  32. private NumericUpDown nudCenterX;
  33. private NumericUpDown nudCenterY;
  34. private NumericUpDown nudActualHeightC;
  35. private NumericUpDown nudActualWidthC;
  36. private RadioButton rbtHeight;
  37. private RadioButton rbtWidth;
  38. private Label lblPixelWidth;
  39. private Label lblPixelHeight;
  40. #endregion
  41. /// <summary>
  42. /// 主工作控件
  43. /// </summary>
  44. private AppWorkspace appWorkspace;
  45. /// <summary>
  46. /// 当前选中的视场
  47. /// </summary>
  48. private DrawObject selectedObject;
  49. /// <summary>
  50. /// 旧中心点X坐标值
  51. /// </summary>
  52. private int numericUpDown3Old;
  53. /// <summary>
  54. /// 旧中心点Y坐标值
  55. /// </summary>
  56. private int numericUpDown4Old;
  57. /// <summary>
  58. /// 初始化标记
  59. /// 1、用于第一次打开窗口时
  60. /// 2、用于切换视场事件被触发时
  61. /// </summary>
  62. private bool init = true;
  63. /// <summary>
  64. /// 单位
  65. /// </summary>
  66. private string unit = "";
  67. /// <summary>
  68. /// 放大倍数
  69. /// </summary>
  70. private decimal m_scale = 1;
  71. public ChangeViewDialog(AppWorkspace appWorkspace)
  72. {
  73. this.appWorkspace = appWorkspace;
  74. this.unit = PdnResources.GetString("Menu.Micron.text");
  75. /*if (Startup.instance.configModel.RulerId > 0)
  76. {
  77. this.unit = appWorkspace.GetPxPerUnit()[1];
  78. }
  79. else
  80. {
  81. this.unit = PdnResources.GetString("Menu.Micron.text");
  82. }*/
  83. InitializeComponent();
  84. InitializeLanguageText();
  85. InitializeUnitText();
  86. //this.appWorkspace.ActiveDocumentWorkspaceChanged
  87. this.selectedObject = this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectDrawObject;
  88. this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectChanged += this.graphicsList_SelectChanged;
  89. InitControl();
  90. InitEvent();
  91. }
  92. /// <summary>
  93. /// 初始化控件及其值
  94. /// </summary>
  95. private void InitControl()
  96. {
  97. if (init && selectedObject != null)
  98. {
  99. m_scale = 1;
  100. if (this.appWorkspace.ActiveDocumentWorkspace.xmlSaveModel != null)
  101. {
  102. this.label2.Text = PdnResources.GetString("Menu.LabelAction.DrawGainNumber.Text") + ":" + this.appWorkspace.ActiveDocumentWorkspace.xmlSaveModel.gain_multiple;
  103. m_scale = this.appWorkspace.ActiveDocumentWorkspace.xmlSaveModel.gain_multiple;
  104. //mic_rulers rules = mic_rulers_BLL.FindDefault(Startup.instance.configModel.RulerId);
  105. //if (rules != null)
  106. //{
  107. //this.label2.Text = PdnResources.GetString("Menu.LabelAction.DrawGainNumber.Text") + ":" + rules.gain_multiple;
  108. //}
  109. }
  110. else
  111. {
  112. this.label2.Text = PdnResources.GetString("Menu.ationrulcurrentlydefaultvalueis.Text");
  113. }
  114. //this.unit = appWorkspace.GetPxPerUnit()[1];
  115. InitializeUnitText();
  116. DrawToolType type = selectedObject.drawToolType;
  117. this.rbtHeight.Checked = false;
  118. this.rbtWidth.Checked = false;
  119. this.nudActualHeightC.Enabled = false;
  120. this.nudActualWidthC.Enabled = false;
  121. switch (type)
  122. {
  123. case DrawToolType.ViewOval:
  124. hideCricleOrSquare();
  125. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.OvalView.Text");
  126. this.label3.Text = PdnResources.GetString("Menu.verticalaxis.Text") + "(" + this.unit + ")";
  127. this.label4.Text = PdnResources.GetString("Menu.horizontalaxis.Text") + "(" + this.unit + ")";
  128. this.nudActualHeightR.Value = Convert.ToDecimal(selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  129. this.nudActualWidthR.Value = Convert.ToDecimal(selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  130. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Height).ToString("F2");
  131. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  132. break;
  133. case DrawToolType.ViewCircle:
  134. showCricleOrSquare();
  135. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RoundView.Text");
  136. this.rbtHeight.Visible = true;
  137. this.rbtWidth.Visible = true;
  138. this.nudActualHeightC.Visible = true;
  139. this.nudActualWidthC.Visible = true;
  140. if (this.rbtHeight.Checked)
  141. this.nudActualHeightC.Enabled = true;
  142. if (this.rbtWidth.Checked)
  143. this.nudActualWidthC.Enabled = true;
  144. this.rbtHeight.Text = PdnResources.GetString("Menu.diameter.text") + "(" + this.unit + ")";
  145. var width = Convert.ToDecimal(selectedObject.Rectangle.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  146. this.nudActualHeightC.Value = width;
  147. this.nudActualWidthC.Value = Math.Round((decimal)Math.PI * width * width / 4, 2);
  148. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Rectangle.Width).ToString("F2");
  149. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Rectangle.Width).ToString("F2");
  150. break;
  151. case DrawToolType.ViewRectangleEx:
  152. hideCricleOrSquare();
  153. this.nudActualHeightR.Enabled = false;
  154. this.nudActualWidthR.Enabled = false;
  155. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RectangleExView.Text");
  156. this.nudActualHeightR.Value = Convert.ToDecimal(selectedObject.Rectangle.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  157. this.nudActualWidthR.Value = Convert.ToDecimal(selectedObject.Rectangle.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  158. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Rectangle.Width).ToString("F2");
  159. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Rectangle.Height).ToString("F2");
  160. break;
  161. case DrawToolType.ViewRectangle:
  162. hideCricleOrSquare();
  163. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RectangleView.Text");
  164. this.nudActualHeightR.Value = Convert.ToDecimal(selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  165. this.nudActualWidthR.Value = Convert.ToDecimal(selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  166. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Height).ToString("F2");
  167. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  168. break;
  169. case DrawToolType.ViewTriangle:
  170. hideCricleOrSquare();
  171. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.TriangleView.Text");
  172. this.label3.Text = PdnResources.GetString("Menu.Verticalsidelength.Text") + "(" + this.unit + ")";
  173. this.label4.Text = PdnResources.GetString("Menu.Horizontalsidelength.Text") + "(" + this.unit + ")";
  174. this.nudActualHeightR.Value = Convert.ToDecimal(selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  175. this.nudActualWidthR.Value = Convert.ToDecimal(selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  176. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Height).ToString("F2");
  177. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  178. break;
  179. case DrawToolType.ViewSquare:
  180. showCricleOrSquare();
  181. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.SquareView.Text");
  182. this.rbtHeight.Visible = true;
  183. this.rbtWidth.Visible = true;
  184. this.nudActualHeightC.Visible = true;
  185. this.nudActualWidthC.Visible = true;
  186. if (this.rbtHeight.Checked)
  187. this.nudActualHeightC.Enabled = true;
  188. if (this.rbtWidth.Checked)
  189. this.nudActualWidthC.Enabled = true;
  190. this.rbtHeight.Text = PdnResources.GetString("Menu.Generalanalysis.Processmparison.Sidelength.text") + "(" + this.unit + ")";
  191. this.nudActualHeightC.Value = Convert.ToDecimal(selectedObject.Rectangle.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]));
  192. this.nudActualWidthC.Value = Math.Round(Convert.ToDecimal(selectedObject.Rectangle.Height * selectedObject.Rectangle.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(appWorkspace.GetPxPerUnit()[4])), 2);
  193. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Rectangle.Height).ToString("F2");
  194. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Rectangle.Width).ToString("F2");
  195. break;
  196. case DrawToolType.ViewPolygon:
  197. hideCricleOrSquare();
  198. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.PolygonView.Text");
  199. this.nudActualHeightR.Enabled = false;
  200. this.nudActualWidthR.Enabled = false;
  201. this.lblPixelHeight.Text = "";
  202. this.lblPixelWidth.Text = "";
  203. break;
  204. case DrawToolType.ViewTriangleEx:
  205. hideCricleOrSquare();
  206. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.TriangleExView.Text");
  207. this.nudActualHeightR.Enabled = false;
  208. this.nudActualWidthR.Enabled = false;
  209. this.lblPixelHeight.Text = "";
  210. this.lblPixelWidth.Text = "";
  211. break;
  212. }
  213. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  214. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  215. int centerX = (int)(selectedObject.Rectangle.X + Math.Abs(selectedObject.Rectangle.Width / 2));
  216. int centerY = (int)(selectedObject.Rectangle.Y + Math.Abs(selectedObject.Rectangle.Height / 2));
  217. this.nudCenterX.Value = Math.Abs(centerX);
  218. this.nudCenterY.Value = Math.Abs(centerY);
  219. this.numericUpDown3Old = Math.Abs(centerX);
  220. this.numericUpDown4Old = Math.Abs(centerY);
  221. //this.numericUpDown3.ValueChanged += this.numericUpDown3_ValueChange);
  222. //this.numericUpDown4.ValueChanged += this.numericUpDown4_ValueChange);
  223. init = false;
  224. }
  225. }
  226. private double ScalePxPerUnit(double value)
  227. {
  228. return Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * value * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 10);
  229. }
  230. private void showCricleOrSquare()
  231. {
  232. this.rbtHeight.Visible = true;
  233. this.rbtWidth.Visible = true;
  234. this.nudActualHeightC.Visible = true;
  235. this.nudActualWidthC.Visible = true;
  236. this.nudActualHeightR.Visible = false;
  237. this.nudActualWidthR.Visible = false;
  238. }
  239. private void hideCricleOrSquare()
  240. {
  241. this.rbtHeight.Visible = false;
  242. this.rbtWidth.Visible = false;
  243. this.nudActualHeightC.Visible = false;
  244. this.nudActualWidthC.Visible = false;
  245. this.nudActualHeightR.Visible = true;
  246. this.nudActualWidthR.Visible = true;
  247. }
  248. private void disabledControl()
  249. {
  250. this.nudActualHeightR.Enabled = false;
  251. this.nudActualWidthR.Enabled = false;
  252. this.nudCenterX.Enabled = false;
  253. this.nudCenterY.Enabled = false;
  254. this.nudActualHeightC.Enabled = false;
  255. this.nudActualWidthC.Enabled = false;
  256. this.rbtHeight.Enabled = false;
  257. this.rbtWidth.Enabled = false;
  258. }
  259. private void enabledControl(DrawToolType drawToolType)
  260. {
  261. //如果是多边形或者任意三角形,没有边长什么的,所以不允许编辑
  262. if (drawToolType != DrawToolType.ViewPolygon && drawToolType != DrawToolType.ViewTriangleEx)
  263. {
  264. this.nudActualHeightR.Enabled = true;
  265. this.nudActualWidthR.Enabled = true;
  266. }
  267. this.nudCenterX.Enabled = true;
  268. this.nudCenterY.Enabled = true;
  269. this.nudActualHeightC.Enabled = true;
  270. this.nudActualWidthC.Enabled = true;
  271. this.rbtHeight.Enabled = true;
  272. this.rbtWidth.Enabled = true;
  273. }
  274. /// <summary>
  275. /// 初始化事件
  276. /// </summary>
  277. private void InitEvent()
  278. {
  279. this.selectedObject.PropertyChanged += this.selectedObject_PropertyChanged;
  280. this.nudActualHeightR.ValueChanged += this.numericUpDown1_ValueChange;
  281. this.nudActualWidthR.ValueChanged += this.numericUpDown2_ValueChange;
  282. this.nudCenterX.ValueChanged += this.numericUpDown3_ValueChange;
  283. this.nudCenterY.ValueChanged += this.numericUpDown4_ValueChange;
  284. this.nudActualHeightC.ValueChanged += this.numericUpDown5_ValueChange;
  285. this.nudActualWidthC.ValueChanged += this.numericUpDown6_ValueChange;
  286. this.nudCenterX.KeyUp += new KeyEventHandler(this.numericUpDown3_ValueChange);
  287. this.nudCenterY.KeyUp += new KeyEventHandler(this.numericUpDown4_ValueChange);
  288. }
  289. /// <summary>
  290. /// 注销事件
  291. /// </summary>
  292. private void UnInitEvent()
  293. {
  294. this.selectedObject.PropertyChanged -= this.selectedObject_PropertyChanged;
  295. this.nudActualHeightR.ValueChanged -= this.numericUpDown1_ValueChange;
  296. this.nudActualWidthR.ValueChanged -= this.numericUpDown2_ValueChange;
  297. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  298. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  299. this.nudActualHeightC.ValueChanged -= this.numericUpDown5_ValueChange;
  300. this.nudActualWidthC.ValueChanged -= this.numericUpDown6_ValueChange;
  301. this.nudCenterX.KeyUp -= new KeyEventHandler(this.numericUpDown3_ValueChange);
  302. this.nudCenterY.KeyUp -= new KeyEventHandler(this.numericUpDown4_ValueChange);
  303. }
  304. /// <summary>
  305. /// 视场对象改变事件
  306. /// </summary>
  307. /// <param name="sender"></param>
  308. /// <param name="e"></param>
  309. private void graphicsList_SelectChanged(object sender, EventArgs e)
  310. {
  311. this.selectedObject = this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectDrawObject;
  312. if (selectedObject != null)
  313. {
  314. DrawClass drawClass = selectedObject.objectType;
  315. if (drawClass == DrawClass.View)
  316. {
  317. enabledControl(selectedObject.drawToolType);
  318. init = true;
  319. UnInitEvent();
  320. InitControl();
  321. InitEvent();
  322. }
  323. else
  324. {
  325. disabledControl();
  326. }
  327. }
  328. else
  329. {
  330. disabledControl();
  331. }
  332. }
  333. /// <summary>
  334. /// 选中的视场的属性改变事件
  335. /// </summary>
  336. /// <param name="sender"></param>
  337. /// <param name="e"></param>
  338. private void selectedObject_PropertyChanged(object sender, EventArgs e)
  339. {
  340. //UnInitEvent();
  341. InitControl();
  342. //InitEvent();
  343. }
  344. /// <summary>
  345. /// 椭圆:垂直轴
  346. /// 矩形:高度
  347. /// 三角形:垂直边长
  348. /// 多边形:不可调整
  349. /// </summary>
  350. /// <param name="sender"></param>
  351. /// <param name="e"></param>
  352. private void numericUpDown1_ValueChange(object sender, EventArgs e)
  353. {
  354. if (this.selectedObject != null && !this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  355. {
  356. this.nudActualWidthR.ValueChanged -= this.numericUpDown2_ValueChange;
  357. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  358. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  359. DrawToolType type = selectedObject.drawToolType;
  360. switch (type)
  361. {
  362. case DrawToolType.ViewOval:
  363. selectedObject.Height = (float)(this.nudActualHeightR.Value / decimal.Parse(appWorkspace.GetPxPerUnit()[4]));
  364. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  365. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  366. break;
  367. case DrawToolType.ViewRectangle:
  368. selectedObject.Height = (float)(this.nudActualHeightR.Value / decimal.Parse(appWorkspace.GetPxPerUnit()[4]));
  369. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Rectangle.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  370. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Rectangle.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  371. break;
  372. case DrawToolType.ViewTriangle:
  373. selectedObject.Height = double.Parse(this.nudActualHeightR.Value.ToString()) / double.Parse(appWorkspace.GetPxPerUnit()[4]);
  374. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  375. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  376. break;
  377. }
  378. this.selectedObject.Normalize();
  379. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  380. int centerX = (int)(selectedObject.Rectangle.X + Math.Abs(selectedObject.Rectangle.Width / 2));
  381. int centerY = (int)(selectedObject.Rectangle.Y + Math.Abs(selectedObject.Rectangle.Height / 2));
  382. this.nudCenterX.Value = Math.Abs(centerX);
  383. this.nudCenterY.Value = Math.Abs(centerY);
  384. this.numericUpDown3Old = Math.Abs(centerX);
  385. this.numericUpDown4Old = Math.Abs(centerY);
  386. this.nudActualWidthR.ValueChanged += this.numericUpDown2_ValueChange;
  387. this.nudCenterX.ValueChanged += this.numericUpDown3_ValueChange;
  388. this.nudCenterY.ValueChanged += this.numericUpDown4_ValueChange;
  389. }
  390. }
  391. /// <summary>
  392. /// 椭圆:水平轴
  393. /// 矩形:宽度
  394. /// 三角形:水平边长
  395. /// 多边形:不可调整
  396. /// </summary>
  397. /// <param name="sender"></param>
  398. /// <param name="e"></param>
  399. private void numericUpDown2_ValueChange(object sender, EventArgs e)
  400. {
  401. var value = (sender as NumericUpDown).Value;
  402. if (this.selectedObject != null && !this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  403. {
  404. this.nudActualHeightR.ValueChanged -= this.numericUpDown1_ValueChange;
  405. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  406. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  407. DrawToolType type = selectedObject.drawToolType;
  408. switch (type)
  409. {
  410. case DrawToolType.ViewOval:
  411. selectedObject.Width = (float)(value / decimal.Parse(appWorkspace.GetPxPerUnit()[4]));
  412. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  413. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  414. break;
  415. case DrawToolType.ViewRectangle:
  416. selectedObject.Width = (float)(double.Parse(this.nudActualWidthR.Value.ToString()) / double.Parse(appWorkspace.GetPxPerUnit()[4]));
  417. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Rectangle.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  418. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Rectangle.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  419. break;
  420. case DrawToolType.ViewTriangle:
  421. selectedObject.Width = double.Parse(this.nudActualWidthR.Value.ToString()) / double.Parse(appWorkspace.GetPxPerUnit()[4]);
  422. this.lblPixelHeight.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Height * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  423. this.lblPixelWidth.Text = "" + Math.Round(this.appWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio * selectedObject.Width * double.Parse(appWorkspace.GetPxPerUnit()[4]) * double.Parse(m_scale.ToString()), 2);
  424. break;
  425. }
  426. this.selectedObject.Normalize();
  427. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  428. int centerX = (int)(selectedObject.Rectangle.X + Math.Abs(selectedObject.Rectangle.Width / 2));
  429. int centerY = (int)(selectedObject.Rectangle.Y + Math.Abs(selectedObject.Rectangle.Height / 2));
  430. this.nudCenterX.Value = Math.Abs(centerX);
  431. this.nudCenterY.Value = Math.Abs(centerY);
  432. this.numericUpDown3Old = Math.Abs(centerX);
  433. this.numericUpDown4Old = Math.Abs(centerY);
  434. this.nudActualHeightR.ValueChanged += this.numericUpDown1_ValueChange;
  435. this.nudCenterX.ValueChanged += this.numericUpDown3_ValueChange;
  436. this.nudCenterY.ValueChanged += this.numericUpDown4_ValueChange;
  437. }
  438. }
  439. /// <summary>
  440. /// 修改中心点x坐标的事件
  441. /// </summary>
  442. /// <param name="sender"></param>
  443. /// <param name="e"></param>
  444. private void numericUpDown3_ValueChange(object sender, EventArgs e)
  445. {
  446. if (this.selectedObject != null && !this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  447. {
  448. if (this.numericUpDown3Old != (int)this.nudCenterX.Value)
  449. {
  450. int deltaX = (int)this.nudCenterX.Value - this.numericUpDown3Old;
  451. this.selectedObject.Move(deltaX, 0);
  452. /**
  453. Rectangle rectangle = this.selectedObject.Rectangle;
  454. rectangle.X = (int)this.numericUpDown3.Value;
  455. this.selectedObject.Rectangle = rectangle;
  456. **/
  457. this.selectedObject.Normalize();
  458. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  459. this.numericUpDown3Old = (int)this.nudCenterX.Value;
  460. }
  461. }
  462. }
  463. /// <summary>
  464. /// 修改中心点y坐标的事件
  465. /// </summary>
  466. /// <param name="sender"></param>
  467. /// <param name="e"></param>
  468. private void numericUpDown4_ValueChange(object sender, EventArgs e)
  469. {
  470. if (this.selectedObject != null && !this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  471. {
  472. if (this.numericUpDown4Old != (int)this.nudCenterY.Value)
  473. {
  474. int deltaY = (int)this.nudCenterY.Value - this.numericUpDown4Old;
  475. this.selectedObject.Move(0, deltaY);
  476. /**
  477. Rectangle rectangle = this.selectedObject.Rectangle;
  478. rectangle.Y = (int)this.numericUpDown4.Value;
  479. this.selectedObject.Rectangle = rectangle;
  480. **/
  481. this.selectedObject.Normalize();
  482. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  483. this.numericUpDown4Old = (int)this.nudCenterY.Value;
  484. }
  485. }
  486. }
  487. /// <summary>
  488. /// 圆形:直径
  489. /// 正方形:边长
  490. /// </summary>
  491. /// <param name="sender"></param>
  492. /// <param name="e"></param>
  493. private void numericUpDown5_ValueChange(object sender, EventArgs e)
  494. {
  495. if (!rbtHeight.Checked)
  496. return;
  497. if (this.selectedObject == null || this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  498. return;
  499. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  500. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  501. DrawToolType type = selectedObject.drawToolType;
  502. switch (type)
  503. {
  504. case DrawToolType.ViewCircle:
  505. if (!this.rbtHeight.Checked) break;
  506. var circle = selectedObject as ViewCircle;
  507. float radius = (float)(nudActualHeightC.Value / decimal.Parse(appWorkspace.GetPxPerUnit()[4]));
  508. circle.Width = radius;
  509. this.nudActualWidthC.Value = (int)(Math.PI * (radius / 2) * (radius / 2));
  510. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  511. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  512. break;
  513. case DrawToolType.ViewSquare:
  514. if (!this.rbtHeight.Checked) break;
  515. selectedObject.Width = (double)(this.nudActualHeightC.Value / decimal.Parse(appWorkspace.GetPxPerUnit()[4]));
  516. this.nudActualWidthC.Value = Convert.ToDecimal(Math.Round(selectedObject.Width * selectedObject.Width, 2));
  517. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  518. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  519. break;
  520. }
  521. this.selectedObject.Normalize();
  522. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  523. int centerX = (int)(selectedObject.Rectangle.X + Math.Abs(selectedObject.Rectangle.Width / 2));
  524. int centerY = (int)(selectedObject.Rectangle.Y + Math.Abs(selectedObject.Rectangle.Height / 2));
  525. this.nudCenterX.Value = Math.Abs(centerX);
  526. this.nudCenterY.Value = Math.Abs(centerY);
  527. this.numericUpDown3Old = Math.Abs(centerX);
  528. this.numericUpDown4Old = Math.Abs(centerY);
  529. this.nudCenterX.ValueChanged += this.numericUpDown3_ValueChange;
  530. this.nudCenterY.ValueChanged += this.numericUpDown4_ValueChange;
  531. }
  532. /// <summary>
  533. /// 圆形:面积
  534. /// 正方形:面积
  535. /// </summary>
  536. /// <param name="sender"></param>
  537. /// <param name="e"></param>
  538. private void numericUpDown6_ValueChange(object sender, EventArgs e)
  539. {
  540. if (!rbtWidth.Checked)
  541. return;
  542. if (this.selectedObject == null || this.appWorkspace.ActiveDocumentWorkspace.mouseStatus)
  543. return;
  544. this.nudCenterX.ValueChanged -= this.numericUpDown3_ValueChange;
  545. this.nudCenterY.ValueChanged -= this.numericUpDown4_ValueChange;
  546. DrawToolType type = selectedObject.drawToolType;
  547. switch (type)
  548. {
  549. case DrawToolType.ViewCircle:
  550. if (!this.rbtWidth.Checked) break;
  551. double radius = Math.Sqrt((double)this.nudActualWidthC.Value / Math.PI);
  552. this.nudActualHeightC.Value = (decimal)(radius * 2);
  553. selectedObject.Width = (float)((radius / double.Parse(appWorkspace.GetPxPerUnit()[4])) * 2);
  554. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  555. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  556. break;
  557. case DrawToolType.ViewSquare:
  558. if (!this.rbtWidth.Checked) break;
  559. double sidelength = Math.Sqrt((double)this.nudActualWidthC.Value);
  560. this.nudActualHeightC.Value = (decimal)(sidelength / double.Parse(appWorkspace.GetPxPerUnit()[4]));
  561. selectedObject.Width = (float)(sidelength / double.Parse(appWorkspace.GetPxPerUnit()[4]));
  562. this.lblPixelHeight.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  563. this.lblPixelWidth.Text = ScalePxPerUnit(selectedObject.Width).ToString("F2");
  564. break;
  565. }
  566. this.selectedObject.Normalize();
  567. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  568. int centerX = (int)(selectedObject.Rectangle.X + Math.Abs(selectedObject.Rectangle.Width / 2));
  569. int centerY = (int)(selectedObject.Rectangle.Y + Math.Abs(selectedObject.Rectangle.Height / 2));
  570. this.nudCenterX.Value = Math.Abs(centerX);
  571. this.nudCenterY.Value = Math.Abs(centerY);
  572. this.numericUpDown3Old = Math.Abs(centerX);
  573. this.numericUpDown4Old = Math.Abs(centerY);
  574. this.nudCenterX.ValueChanged += this.numericUpDown3_ValueChange;
  575. this.nudCenterY.ValueChanged += this.numericUpDown4_ValueChange;
  576. }
  577. private void InitializeLanguageText()
  578. {
  579. this.groupBox2.Text = PdnResources.GetString("Menu.view.text");
  580. this.groupBox3.Text = PdnResources.GetString("Menu.Ruler.text");
  581. this.groupBox4.Text = PdnResources.GetString("Menu.Edit.ActualSize.Text");
  582. this.rbtWidth.Text = PdnResources.GetString("Menu.area.text");
  583. this.groupBox5.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Visualsize.text");
  584. this.groupBox6.Text = PdnResources.GetString("Menu.position.text");
  585. this.label5.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "Y";
  586. this.Text = PdnResources.GetString("Menu.ViewSetting.ModifyFieldOfView.Text");
  587. this.rbtHeight.Text = PdnResources.GetString("Menu.diameter.text");
  588. this.label6.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "X";
  589. }
  590. private void InitializeComponent()
  591. {
  592. this.groupBox2 = new System.Windows.Forms.GroupBox();
  593. this.label1 = new System.Windows.Forms.Label();
  594. this.groupBox3 = new System.Windows.Forms.GroupBox();
  595. this.label2 = new System.Windows.Forms.Label();
  596. this.groupBox4 = new System.Windows.Forms.GroupBox();
  597. this.nudActualWidthC = new System.Windows.Forms.NumericUpDown();
  598. this.nudActualHeightC = new System.Windows.Forms.NumericUpDown();
  599. this.rbtWidth = new System.Windows.Forms.RadioButton();
  600. this.rbtHeight = new System.Windows.Forms.RadioButton();
  601. this.nudActualWidthR = new System.Windows.Forms.NumericUpDown();
  602. this.nudActualHeightR = new System.Windows.Forms.NumericUpDown();
  603. this.label4 = new System.Windows.Forms.Label();
  604. this.label3 = new System.Windows.Forms.Label();
  605. this.groupBox5 = new System.Windows.Forms.GroupBox();
  606. this.lblPixelWidth = new System.Windows.Forms.Label();
  607. this.lblPixelHeight = new System.Windows.Forms.Label();
  608. this.label7 = new System.Windows.Forms.Label();
  609. this.label8 = new System.Windows.Forms.Label();
  610. this.groupBox6 = new System.Windows.Forms.GroupBox();
  611. this.nudCenterY = new System.Windows.Forms.NumericUpDown();
  612. this.nudCenterX = new System.Windows.Forms.NumericUpDown();
  613. this.label5 = new System.Windows.Forms.Label();
  614. this.label6 = new System.Windows.Forms.Label();
  615. this.groupBox2.SuspendLayout();
  616. this.groupBox3.SuspendLayout();
  617. this.groupBox4.SuspendLayout();
  618. ((System.ComponentModel.ISupportInitialize)(this.nudActualWidthC)).BeginInit();
  619. ((System.ComponentModel.ISupportInitialize)(this.nudActualHeightC)).BeginInit();
  620. ((System.ComponentModel.ISupportInitialize)(this.nudActualWidthR)).BeginInit();
  621. ((System.ComponentModel.ISupportInitialize)(this.nudActualHeightR)).BeginInit();
  622. this.groupBox5.SuspendLayout();
  623. this.groupBox6.SuspendLayout();
  624. ((System.ComponentModel.ISupportInitialize)(this.nudCenterY)).BeginInit();
  625. ((System.ComponentModel.ISupportInitialize)(this.nudCenterX)).BeginInit();
  626. this.SuspendLayout();
  627. //
  628. // groupBox2
  629. //
  630. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  631. | System.Windows.Forms.AnchorStyles.Right)));
  632. this.groupBox2.Controls.Add(this.label1);
  633. this.groupBox2.Location = new System.Drawing.Point(13, 12);
  634. this.groupBox2.Name = "groupBox2";
  635. this.groupBox2.Size = new System.Drawing.Size(452, 47);
  636. this.groupBox2.TabIndex = 2;
  637. this.groupBox2.TabStop = false;
  638. this.groupBox2.Text = "视场";
  639. //
  640. // label1
  641. //
  642. this.label1.AutoSize = true;
  643. this.label1.Location = new System.Drawing.Point(7, 22);
  644. this.label1.Name = "label1";
  645. this.label1.Size = new System.Drawing.Size(41, 12);
  646. this.label1.TabIndex = 0;
  647. this.label1.Text = "label1";
  648. //
  649. // groupBox3
  650. //
  651. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  652. | System.Windows.Forms.AnchorStyles.Right)));
  653. this.groupBox3.Controls.Add(this.label2);
  654. this.groupBox3.Location = new System.Drawing.Point(13, 66);
  655. this.groupBox3.Name = "groupBox3";
  656. this.groupBox3.Size = new System.Drawing.Size(452, 47);
  657. this.groupBox3.TabIndex = 3;
  658. this.groupBox3.TabStop = false;
  659. this.groupBox3.Text = "标尺";
  660. //
  661. // label2
  662. //
  663. this.label2.AutoSize = true;
  664. this.label2.Location = new System.Drawing.Point(9, 21);
  665. this.label2.Name = "label2";
  666. this.label2.Size = new System.Drawing.Size(41, 12);
  667. this.label2.TabIndex = 0;
  668. this.label2.Text = "label2";
  669. //
  670. // groupBox4
  671. //
  672. this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  673. | System.Windows.Forms.AnchorStyles.Right)));
  674. this.groupBox4.Controls.Add(this.nudActualWidthC);
  675. this.groupBox4.Controls.Add(this.nudActualHeightC);
  676. this.groupBox4.Controls.Add(this.rbtWidth);
  677. this.groupBox4.Controls.Add(this.rbtHeight);
  678. this.groupBox4.Controls.Add(this.nudActualWidthR);
  679. this.groupBox4.Controls.Add(this.nudActualHeightR);
  680. this.groupBox4.Controls.Add(this.label4);
  681. this.groupBox4.Controls.Add(this.label3);
  682. this.groupBox4.Location = new System.Drawing.Point(13, 120);
  683. this.groupBox4.Name = "groupBox4";
  684. this.groupBox4.Size = new System.Drawing.Size(452, 47);
  685. this.groupBox4.TabIndex = 4;
  686. this.groupBox4.TabStop = false;
  687. this.groupBox4.Text = "实际大小";
  688. //
  689. // numericUpDown6
  690. //
  691. this.nudActualWidthC.DecimalPlaces = 2;
  692. this.nudActualWidthC.Location = new System.Drawing.Point(335, 18);
  693. this.nudActualWidthC.Maximum = new decimal(new int[] {
  694. 214748364,
  695. 0,
  696. 0,
  697. 0});
  698. this.nudActualWidthC.Minimum = new decimal(new int[] {
  699. 214748364,
  700. 0,
  701. 0,
  702. -2147483648});
  703. this.nudActualWidthC.Name = "numericUpDown6";
  704. this.nudActualWidthC.Size = new System.Drawing.Size(111, 21);
  705. this.nudActualWidthC.TabIndex = 14;
  706. //
  707. // numericUpDown5
  708. //
  709. this.nudActualHeightC.DecimalPlaces = 2;
  710. this.nudActualHeightC.Location = new System.Drawing.Point(112, 18);
  711. this.nudActualHeightC.Maximum = new decimal(new int[] {
  712. 214748364,
  713. 0,
  714. 0,
  715. 0});
  716. this.nudActualHeightC.Minimum = new decimal(new int[] {
  717. 214748364,
  718. 0,
  719. 0,
  720. -2147483648});
  721. this.nudActualHeightC.Name = "numericUpDown5";
  722. this.nudActualHeightC.Size = new System.Drawing.Size(111, 21);
  723. this.nudActualHeightC.TabIndex = 13;
  724. //
  725. // radioButton2
  726. //
  727. this.rbtWidth.AutoSize = true;
  728. this.rbtWidth.Location = new System.Drawing.Point(236, 20);
  729. this.rbtWidth.Name = "radioButton2";
  730. this.rbtWidth.Size = new System.Drawing.Size(14, 13);
  731. this.rbtWidth.TabIndex = 12;
  732. this.rbtWidth.TabStop = true;
  733. this.rbtWidth.UseVisualStyleBackColor = true;
  734. this.rbtWidth.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged_1);
  735. //
  736. // radioButton1
  737. //
  738. this.rbtHeight.AutoSize = true;
  739. this.rbtHeight.Location = new System.Drawing.Point(11, 20);
  740. this.rbtHeight.Name = "radioButton1";
  741. this.rbtHeight.Size = new System.Drawing.Size(14, 13);
  742. this.rbtHeight.TabIndex = 11;
  743. this.rbtHeight.TabStop = true;
  744. this.rbtHeight.UseVisualStyleBackColor = true;
  745. this.rbtHeight.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged_1);
  746. //
  747. // numericUpDown2
  748. //
  749. this.nudActualWidthR.DecimalPlaces = 2;
  750. this.nudActualWidthR.Location = new System.Drawing.Point(335, 18);
  751. this.nudActualWidthR.Maximum = new decimal(new int[] {
  752. 214748364,
  753. 0,
  754. 0,
  755. 0});
  756. this.nudActualWidthR.Minimum = new decimal(new int[] {
  757. 214748364,
  758. 0,
  759. 0,
  760. -2147483648});
  761. this.nudActualWidthR.Name = "numericUpDown2";
  762. this.nudActualWidthR.Size = new System.Drawing.Size(111, 21);
  763. this.nudActualWidthR.TabIndex = 10;
  764. //
  765. // numericUpDown1
  766. //
  767. this.nudActualHeightR.DecimalPlaces = 2;
  768. this.nudActualHeightR.Location = new System.Drawing.Point(112, 18);
  769. this.nudActualHeightR.Maximum = new decimal(new int[] {
  770. 214748364,
  771. 0,
  772. 0,
  773. 0});
  774. this.nudActualHeightR.Minimum = new decimal(new int[] {
  775. 214748364,
  776. 0,
  777. 0,
  778. -2147483648});
  779. this.nudActualHeightR.Name = "numericUpDown1";
  780. this.nudActualHeightR.Size = new System.Drawing.Size(111, 21);
  781. this.nudActualHeightR.TabIndex = 9;
  782. //
  783. // label4
  784. //
  785. this.label4.AutoSize = true;
  786. this.label4.Location = new System.Drawing.Point(236, 22);
  787. this.label4.Name = "label4";
  788. this.label4.Size = new System.Drawing.Size(0, 12);
  789. this.label4.TabIndex = 7;
  790. //
  791. // label3
  792. //
  793. this.label3.AutoSize = true;
  794. this.label3.Location = new System.Drawing.Point(11, 22);
  795. this.label3.Name = "label3";
  796. this.label3.Size = new System.Drawing.Size(0, 12);
  797. this.label3.TabIndex = 0;
  798. //
  799. // groupBox5
  800. //
  801. this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  802. | System.Windows.Forms.AnchorStyles.Right)));
  803. this.groupBox5.Controls.Add(this.lblPixelWidth);
  804. this.groupBox5.Controls.Add(this.lblPixelHeight);
  805. this.groupBox5.Controls.Add(this.label7);
  806. this.groupBox5.Controls.Add(this.label8);
  807. this.groupBox5.Location = new System.Drawing.Point(13, 173);
  808. this.groupBox5.Name = "groupBox5";
  809. this.groupBox5.Size = new System.Drawing.Size(452, 47);
  810. this.groupBox5.TabIndex = 5;
  811. this.groupBox5.TabStop = false;
  812. this.groupBox5.Text = "视觉大小";
  813. //
  814. // label10
  815. //
  816. this.lblPixelWidth.AutoSize = true;
  817. this.lblPixelWidth.Location = new System.Drawing.Point(335, 22);
  818. this.lblPixelWidth.Name = "label10";
  819. this.lblPixelWidth.Size = new System.Drawing.Size(47, 12);
  820. this.lblPixelWidth.TabIndex = 13;
  821. this.lblPixelWidth.Text = "label10";
  822. //
  823. // label9
  824. //
  825. this.lblPixelHeight.AutoSize = true;
  826. this.lblPixelHeight.Location = new System.Drawing.Point(110, 22);
  827. this.lblPixelHeight.Name = "label9";
  828. this.lblPixelHeight.Size = new System.Drawing.Size(113, 12);
  829. this.lblPixelHeight.TabIndex = 12;
  830. this.lblPixelHeight.Text = "2225885.8888999988";
  831. //
  832. // label7
  833. //
  834. this.label7.AutoSize = true;
  835. this.label7.Location = new System.Drawing.Point(236, 22);
  836. this.label7.Name = "label7";
  837. this.label7.Size = new System.Drawing.Size(47, 12);
  838. this.label7.TabIndex = 11;
  839. this.label7.Text = "liangge";
  840. //
  841. // label8
  842. //
  843. this.label8.AutoSize = true;
  844. this.label8.Location = new System.Drawing.Point(11, 22);
  845. this.label8.Name = "label8";
  846. this.label8.Size = new System.Drawing.Size(29, 12);
  847. this.label8.TabIndex = 9;
  848. this.label8.Text = "yige";
  849. //
  850. // groupBox6
  851. //
  852. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  853. | System.Windows.Forms.AnchorStyles.Right)));
  854. this.groupBox6.Controls.Add(this.nudCenterY);
  855. this.groupBox6.Controls.Add(this.nudCenterX);
  856. this.groupBox6.Controls.Add(this.label5);
  857. this.groupBox6.Controls.Add(this.label6);
  858. this.groupBox6.Location = new System.Drawing.Point(13, 227);
  859. this.groupBox6.Name = "groupBox6";
  860. this.groupBox6.Size = new System.Drawing.Size(452, 47);
  861. this.groupBox6.TabIndex = 6;
  862. this.groupBox6.TabStop = false;
  863. this.groupBox6.Text = "位置";
  864. //
  865. // numericUpDown4
  866. //
  867. this.nudCenterY.Location = new System.Drawing.Point(335, 17);
  868. this.nudCenterY.Maximum = new decimal(new int[] {
  869. 2147483646,
  870. 0,
  871. 0,
  872. 0});
  873. this.nudCenterY.Name = "numericUpDown4";
  874. this.nudCenterY.Size = new System.Drawing.Size(111, 21);
  875. this.nudCenterY.TabIndex = 12;
  876. //
  877. // numericUpDown3
  878. //
  879. this.nudCenterX.Location = new System.Drawing.Point(112, 17);
  880. this.nudCenterX.Maximum = new decimal(new int[] {
  881. 2147483646,
  882. 0,
  883. 0,
  884. 0});
  885. this.nudCenterX.Name = "numericUpDown3";
  886. this.nudCenterX.Size = new System.Drawing.Size(111, 21);
  887. this.nudCenterX.TabIndex = 11;
  888. //
  889. // label5
  890. //
  891. this.label5.AutoSize = true;
  892. this.label5.Location = new System.Drawing.Point(236, 21);
  893. this.label5.Name = "label5";
  894. this.label5.Size = new System.Drawing.Size(0, 12);
  895. this.label5.TabIndex = 11;
  896. //
  897. // label6
  898. //
  899. this.label6.AutoSize = true;
  900. this.label6.Location = new System.Drawing.Point(11, 21);
  901. this.label6.Name = "label6";
  902. this.label6.Size = new System.Drawing.Size(0, 12);
  903. this.label6.TabIndex = 9;
  904. //
  905. // ChangeViewDialog
  906. //
  907. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  908. this.ClientSize = new System.Drawing.Size(477, 288);
  909. this.Controls.Add(this.groupBox6);
  910. this.Controls.Add(this.groupBox5);
  911. this.Controls.Add(this.groupBox4);
  912. this.Controls.Add(this.groupBox3);
  913. this.Controls.Add(this.groupBox2);
  914. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  915. this.MaximizeBox = false;
  916. this.Name = "ChangeViewDialog";
  917. this.ShowInTaskbar = false;
  918. this.Text = "修改视场";
  919. //this.TopMost = true;
  920. this.Controls.SetChildIndex(this.groupBox2, 0);
  921. this.Controls.SetChildIndex(this.groupBox3, 0);
  922. this.Controls.SetChildIndex(this.groupBox4, 0);
  923. this.Controls.SetChildIndex(this.groupBox5, 0);
  924. this.Controls.SetChildIndex(this.groupBox6, 0);
  925. this.groupBox2.ResumeLayout(false);
  926. this.groupBox2.PerformLayout();
  927. this.groupBox3.ResumeLayout(false);
  928. this.groupBox3.PerformLayout();
  929. this.groupBox4.ResumeLayout(false);
  930. this.groupBox4.PerformLayout();
  931. ((System.ComponentModel.ISupportInitialize)(this.nudActualWidthC)).EndInit();
  932. ((System.ComponentModel.ISupportInitialize)(this.nudActualHeightC)).EndInit();
  933. ((System.ComponentModel.ISupportInitialize)(this.nudActualWidthR)).EndInit();
  934. ((System.ComponentModel.ISupportInitialize)(this.nudActualHeightR)).EndInit();
  935. this.groupBox5.ResumeLayout(false);
  936. this.groupBox5.PerformLayout();
  937. this.groupBox6.ResumeLayout(false);
  938. this.groupBox6.PerformLayout();
  939. ((System.ComponentModel.ISupportInitialize)(this.nudCenterY)).EndInit();
  940. ((System.ComponentModel.ISupportInitialize)(this.nudCenterX)).EndInit();
  941. this.ResumeLayout(false);
  942. }
  943. private void InitializeUnitText()
  944. {
  945. this.rbtWidth.Text = PdnResources.GetString("Menu.area.text") + "(" + this.unit + ")";
  946. this.rbtHeight.Text = PdnResources.GetString("Menu.height.text") + "(" + this.unit + ")";
  947. this.label4.Text = PdnResources.GetString("Menu.width.text") + "(" + this.unit + ")";
  948. this.label3.Text = PdnResources.GetString("Menu.height.text") + "(" + this.unit + ")";
  949. this.label7.Text = PdnResources.GetString("Menu.width.text") + "(" + this.unit + ")";
  950. this.label8.Text = PdnResources.GetString("Menu.height.text") + "(" + this.unit + ")";
  951. }
  952. private void radioButton1_CheckedChanged_1(object sender, EventArgs e)
  953. {
  954. this.nudActualHeightC.Enabled = rbtHeight.Checked;
  955. }
  956. private void radioButton2_CheckedChanged_1(object sender, EventArgs e)
  957. {
  958. this.nudActualWidthC.Enabled = this.rbtWidth.Checked;
  959. }
  960. }
  961. }