comparison FrmMain.cs @ 207:ac5f87626abd xml-basic

Basic XML translations
author Dan.Kulinski@dank-laptop.Global.Local
date Sun, 14 Aug 2011 14:38:06 -0600
parents 10ba2c5340b2
children 256f2f2f6e8c
comparison
equal deleted inserted replaced
205:77043c3e0d94 207:ac5f87626abd
98 private IBBToolStripSplitButton bttnRedo; 98 private IBBToolStripSplitButton bttnRedo;
99 private ToolStrip catToolStrip; 99 private ToolStrip catToolStrip;
100 private ToolStripPanel toolStripPanel; 100 private ToolStripPanel toolStripPanel;
101 private ToolStripSeparator toolStripSeparator4; 101 private ToolStripSeparator toolStripSeparator4;
102 private IBBToolStripMenuItem miPreferences; 102 private IBBToolStripMenuItem miPreferences;
103 private ToolStripMenuItem miExportArmyAsBasicXml;
103 private IBBToolStripMenuItem miAbout; 104 private IBBToolStripMenuItem miAbout;
104 105
105 106
106 /// <summary> 107 /// <summary>
107 /// The main entry point for the application. 108 /// The main entry point for the application.
289 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); 290 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar();
290 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 291 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
291 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 292 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
292 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 293 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
293 this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); 294 this.toolStripPanel = new System.Windows.Forms.ToolStripPanel();
295 this.miExportArmyAsBasicXml = new System.Windows.Forms.ToolStripMenuItem();
294 this.menuStrip.SuspendLayout(); 296 this.menuStrip.SuspendLayout();
295 this.mainToolStrip.SuspendLayout(); 297 this.mainToolStrip.SuspendLayout();
296 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); 298 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit();
297 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); 299 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit();
298 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); 300 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit();
326 this.toolStripSeparator1, 328 this.toolStripSeparator1,
327 this.miReloadFiles, 329 this.miReloadFiles,
328 this.toolStripSeparator2, 330 this.toolStripSeparator2,
329 this.miExit}); 331 this.miExit});
330 this.menuFile.Name = "menuFile"; 332 this.menuFile.Name = "menuFile";
331 this.menuFile.Size = new System.Drawing.Size(33, 20); 333 this.menuFile.Size = new System.Drawing.Size(35, 20);
332 this.menuFile.Text = "&file"; 334 this.menuFile.Text = "&file";
333 // 335 //
334 // miNewArmy 336 // miNewArmy
335 // 337 //
336 this.miNewArmy.Name = "miNewArmy"; 338 this.miNewArmy.Name = "miNewArmy";
337 this.miNewArmy.Size = new System.Drawing.Size(164, 22); 339 this.miNewArmy.Size = new System.Drawing.Size(160, 22);
338 this.miNewArmy.Text = "&new army"; 340 this.miNewArmy.Text = "&new army";
339 this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); 341 this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click);
340 // 342 //
341 // miOpenArmy 343 // miOpenArmy
342 // 344 //
343 this.miOpenArmy.Name = "miOpenArmy"; 345 this.miOpenArmy.Name = "miOpenArmy";
344 this.miOpenArmy.Size = new System.Drawing.Size(164, 22); 346 this.miOpenArmy.Size = new System.Drawing.Size(160, 22);
345 this.miOpenArmy.Text = "&open army"; 347 this.miOpenArmy.Text = "&open army";
346 this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); 348 this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click);
347 // 349 //
348 // miSaveArmy 350 // miSaveArmy
349 // 351 //
350 this.miSaveArmy.Enabled = false; 352 this.miSaveArmy.Enabled = false;
351 this.miSaveArmy.Name = "miSaveArmy"; 353 this.miSaveArmy.Name = "miSaveArmy";
352 this.miSaveArmy.Size = new System.Drawing.Size(164, 22); 354 this.miSaveArmy.Size = new System.Drawing.Size(160, 22);
353 this.miSaveArmy.Text = "&save army"; 355 this.miSaveArmy.Text = "&save army";
354 this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); 356 this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click);
355 // 357 //
356 // miSaveArmyAs 358 // miSaveArmyAs
357 // 359 //
358 this.miSaveArmyAs.Enabled = false; 360 this.miSaveArmyAs.Enabled = false;
359 this.miSaveArmyAs.Name = "miSaveArmyAs"; 361 this.miSaveArmyAs.Name = "miSaveArmyAs";
360 this.miSaveArmyAs.Size = new System.Drawing.Size(164, 22); 362 this.miSaveArmyAs.Size = new System.Drawing.Size(160, 22);
361 this.miSaveArmyAs.Text = "save army &as..."; 363 this.miSaveArmyAs.Text = "save army &as...";
362 this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click); 364 this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click);
363 // 365 //
364 // miExportArmyAs 366 // miExportArmyAs
365 // 367 //
366 this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 368 this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
367 this.miExportArmyAsBasicHTML}); 369 this.miExportArmyAsBasicHTML,
370 this.miExportArmyAsBasicXml});
368 this.miExportArmyAs.Enabled = false; 371 this.miExportArmyAs.Enabled = false;
369 this.miExportArmyAs.Name = "miExportArmyAs"; 372 this.miExportArmyAs.Name = "miExportArmyAs";
370 this.miExportArmyAs.Size = new System.Drawing.Size(164, 22); 373 this.miExportArmyAs.Size = new System.Drawing.Size(160, 22);
371 this.miExportArmyAs.Text = "export army as..."; 374 this.miExportArmyAs.Text = "export army as...";
372 // 375 //
373 // miExportArmyAsBasicHTML 376 // miExportArmyAsBasicHTML
374 // 377 //
375 this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; 378 this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML";
376 this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(130, 22); 379 this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(152, 22);
377 this.miExportArmyAsBasicHTML.Text = "&basic html"; 380 this.miExportArmyAsBasicHTML.Text = "&basic html";
378 this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); 381 this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click);
379 // 382 //
380 // miCloseArmy 383 // miCloseArmy
381 // 384 //
382 this.miCloseArmy.Enabled = false; 385 this.miCloseArmy.Enabled = false;
383 this.miCloseArmy.Name = "miCloseArmy"; 386 this.miCloseArmy.Name = "miCloseArmy";
384 this.miCloseArmy.Size = new System.Drawing.Size(164, 22); 387 this.miCloseArmy.Size = new System.Drawing.Size(160, 22);
385 this.miCloseArmy.Text = "&close army"; 388 this.miCloseArmy.Text = "&close army";
386 this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); 389 this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click);
387 // 390 //
388 // toolStripSeparator1 391 // toolStripSeparator1
389 // 392 //
390 this.toolStripSeparator1.Name = "toolStripSeparator1"; 393 this.toolStripSeparator1.Name = "toolStripSeparator1";
391 this.toolStripSeparator1.Size = new System.Drawing.Size(161, 6); 394 this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
392 // 395 //
393 // miReloadFiles 396 // miReloadFiles
394 // 397 //
395 this.miReloadFiles.Name = "miReloadFiles"; 398 this.miReloadFiles.Name = "miReloadFiles";
396 this.miReloadFiles.Size = new System.Drawing.Size(164, 22); 399 this.miReloadFiles.Size = new System.Drawing.Size(160, 22);
397 this.miReloadFiles.Text = "&reload files"; 400 this.miReloadFiles.Text = "&reload files";
398 this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); 401 this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click);
399 // 402 //
400 // toolStripSeparator2 403 // toolStripSeparator2
401 // 404 //
402 this.toolStripSeparator2.Name = "toolStripSeparator2"; 405 this.toolStripSeparator2.Name = "toolStripSeparator2";
403 this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6); 406 this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6);
404 // 407 //
405 // miExit 408 // miExit
406 // 409 //
407 this.miExit.Name = "miExit"; 410 this.miExit.Name = "miExit";
408 this.miExit.Size = new System.Drawing.Size(164, 22); 411 this.miExit.Size = new System.Drawing.Size(160, 22);
409 this.miExit.Text = "e&xit"; 412 this.miExit.Text = "e&xit";
410 this.miExit.Click += new System.EventHandler(this.miExit_Click); 413 this.miExit.Click += new System.EventHandler(this.miExit_Click);
411 // 414 //
412 // menuEdit 415 // menuEdit
413 // 416 //
415 this.miUndo, 418 this.miUndo,
416 this.miRedo, 419 this.miRedo,
417 this.toolStripSeparator4, 420 this.toolStripSeparator4,
418 this.miPreferences}); 421 this.miPreferences});
419 this.menuEdit.Name = "menuEdit"; 422 this.menuEdit.Name = "menuEdit";
420 this.menuEdit.Size = new System.Drawing.Size(36, 20); 423 this.menuEdit.Size = new System.Drawing.Size(39, 20);
421 this.menuEdit.Text = "&edit"; 424 this.menuEdit.Text = "&edit";
422 // 425 //
423 // miUndo 426 // miUndo
424 // 427 //
425 this.miUndo.Enabled = false; 428 this.miUndo.Enabled = false;
426 this.miUndo.Name = "miUndo"; 429 this.miUndo.Name = "miUndo";
427 this.miUndo.Size = new System.Drawing.Size(142, 22); 430 this.miUndo.Size = new System.Drawing.Size(135, 22);
428 this.miUndo.Text = "&undo"; 431 this.miUndo.Text = "&undo";
429 this.miUndo.Click += new System.EventHandler(this.miUndo_Click); 432 this.miUndo.Click += new System.EventHandler(this.miUndo_Click);
430 // 433 //
431 // miRedo 434 // miRedo
432 // 435 //
433 this.miRedo.Enabled = false; 436 this.miRedo.Enabled = false;
434 this.miRedo.Name = "miRedo"; 437 this.miRedo.Name = "miRedo";
435 this.miRedo.Size = new System.Drawing.Size(142, 22); 438 this.miRedo.Size = new System.Drawing.Size(135, 22);
436 this.miRedo.Text = "&redo"; 439 this.miRedo.Text = "&redo";
437 this.miRedo.Click += new System.EventHandler(this.miRedo_Click); 440 this.miRedo.Click += new System.EventHandler(this.miRedo_Click);
438 // 441 //
439 // toolStripSeparator4 442 // toolStripSeparator4
440 // 443 //
441 this.toolStripSeparator4.Name = "toolStripSeparator4"; 444 this.toolStripSeparator4.Name = "toolStripSeparator4";
442 this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6); 445 this.toolStripSeparator4.Size = new System.Drawing.Size(132, 6);
443 // 446 //
444 // miPreferences 447 // miPreferences
445 // 448 //
446 this.miPreferences.Name = "miPreferences"; 449 this.miPreferences.Name = "miPreferences";
447 this.miPreferences.Size = new System.Drawing.Size(142, 22); 450 this.miPreferences.Size = new System.Drawing.Size(135, 22);
448 this.miPreferences.Text = "&preferences"; 451 this.miPreferences.Text = "&preferences";
449 this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click); 452 this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click);
450 // 453 //
451 // menuHelp 454 // menuHelp
452 // 455 //
453 this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 456 this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
454 this.miAbout}); 457 this.miAbout});
455 this.menuHelp.Name = "menuHelp"; 458 this.menuHelp.Name = "menuHelp";
456 this.menuHelp.Size = new System.Drawing.Size(39, 20); 459 this.menuHelp.Size = new System.Drawing.Size(42, 20);
457 this.menuHelp.Text = "&help"; 460 this.menuHelp.Text = "&help";
458 // 461 //
459 // miAbout 462 // miAbout
460 // 463 //
461 this.miAbout.Name = "miAbout"; 464 this.miAbout.Name = "miAbout";
462 this.miAbout.Size = new System.Drawing.Size(109, 22); 465 this.miAbout.Size = new System.Drawing.Size(105, 22);
463 this.miAbout.Text = "&about"; 466 this.miAbout.Text = "&about";
464 this.miAbout.Click += new System.EventHandler(this.miAbout_Click); 467 this.miAbout.Click += new System.EventHandler(this.miAbout_Click);
465 // 468 //
466 // mainToolStrip 469 // mainToolStrip
467 // 470 //
473 this.toolStripSeparator3, 476 this.toolStripSeparator3,
474 this.bttnUndo, 477 this.bttnUndo,
475 this.bttnRedo}); 478 this.bttnRedo});
476 this.mainToolStrip.Location = new System.Drawing.Point(0, 24); 479 this.mainToolStrip.Location = new System.Drawing.Point(0, 24);
477 this.mainToolStrip.Name = "mainToolStrip"; 480 this.mainToolStrip.Name = "mainToolStrip";
478 this.mainToolStrip.Size = new System.Drawing.Size(182, 25); 481 this.mainToolStrip.Size = new System.Drawing.Size(151, 25);
479 this.mainToolStrip.TabIndex = 8; 482 this.mainToolStrip.TabIndex = 8;
480 // 483 //
481 // bttnNewArmy 484 // bttnNewArmy
482 // 485 //
483 this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 486 this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
554 this.sbErrorPanel, 557 this.sbErrorPanel,
555 this.sbPointsPanel}); 558 this.sbPointsPanel});
556 this.statusBar.ShowPanels = true; 559 this.statusBar.ShowPanels = true;
557 this.statusBar.Size = new System.Drawing.Size(790, 22); 560 this.statusBar.Size = new System.Drawing.Size(790, 22);
558 this.statusBar.TabIndex = 1; 561 this.statusBar.TabIndex = 1;
562 this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem);
559 this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); 563 this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick);
560 this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem);
561 // 564 //
562 // sbMainPanel 565 // sbMainPanel
563 // 566 //
564 this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; 567 this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
565 this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText; 568 this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText;
588 this.toolStripPanel.Location = new System.Drawing.Point(0, 24); 591 this.toolStripPanel.Location = new System.Drawing.Point(0, 24);
589 this.toolStripPanel.Name = "toolStripPanel"; 592 this.toolStripPanel.Name = "toolStripPanel";
590 this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; 593 this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
591 this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0); 594 this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
592 this.toolStripPanel.Size = new System.Drawing.Size(790, 0); 595 this.toolStripPanel.Size = new System.Drawing.Size(790, 0);
596 //
597 // miExportArmyAsBasicXml
598 //
599 this.miExportArmyAsBasicXml.Name = "miExportArmyAsBasicXml";
600 this.miExportArmyAsBasicXml.Size = new System.Drawing.Size(152, 22);
601 this.miExportArmyAsBasicXml.Text = "basic xm&l";
602 this.miExportArmyAsBasicXml.Click += new System.EventHandler(this.miExportArmyAsBasicXml_Click);
593 // 603 //
594 // FrmMain 604 // FrmMain
595 // 605 //
596 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 606 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
597 this.ClientSize = new System.Drawing.Size(790, 608); 607 this.ClientSize = new System.Drawing.Size(790, 608);
1419 private void miPreferences_Click(object sender, EventArgs e) 1429 private void miPreferences_Click(object sender, EventArgs e)
1420 { 1430 {
1421 FrmPreferences prefsForm = new FrmPreferences(Preferences); 1431 FrmPreferences prefsForm = new FrmPreferences(Preferences);
1422 prefsForm.Show(this); 1432 prefsForm.Show(this);
1423 } 1433 }
1434
1435 private void miExportArmyAsBasicXml_Click(object sender, EventArgs e)
1436 {
1437 SaveFileDialog dialog = new SaveFileDialog();
1438 dialog.Filter = Translation.GetTranslation("armyExportBasicXmlFilter", "XML pages") + "|*.xml";
1439 dialog.Title = Translation.GetTranslation("exportArmyDialog", "Export army");
1440
1441 DialogResult dr = dialog.ShowDialog(this);
1442
1443 if (dr == DialogResult.OK)
1444 {
1445 Army army = CurrentArmy;
1446 string filePath = dialog.FileName;
1447 log.DebugFormat("Exporting {0} to {1} as basic XML", army.Name, filePath);
1448 WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(army, filePath);
1449 }
1450 }
1424 } 1451 }
1425 } 1452 }