MainForm.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //-----------------------------------------------------------------------------
  2. // MainForm.h
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. #pragma once
  8. #include "ReportDocument.h"
  9. namespace XnaGraphicsProfileChecker
  10. {
  11. using namespace System::Windows::Forms;
  12. public ref class MainForm : public System::Windows::Forms::Form
  13. {
  14. public:
  15. MainForm()
  16. {
  17. InitializeComponent();
  18. report = gcnew ReportDocument();
  19. webBrowser->DocumentText = report->ToHtml();
  20. }
  21. protected:
  22. ~MainForm()
  23. {
  24. if (components)
  25. {
  26. delete components;
  27. }
  28. }
  29. private:
  30. ReportDocument^ report;
  31. System::Windows::Forms::WebBrowser^ webBrowser;
  32. System::Windows::Forms::Button^ copyToClipboard;
  33. void CopyToClipboard_Click(System::Object^ sender, System::EventArgs^ e)
  34. {
  35. Clipboard::SetData(DataFormats::Text, report->ToText());
  36. }
  37. /// <summary>
  38. /// Required designer variable.
  39. /// </summary>
  40. System::ComponentModel::Container ^components;
  41. #pragma region Windows Form Designer generated code
  42. /// <summary>
  43. /// Required method for Designer support - do not modify
  44. /// the contents of this method with the code editor.
  45. /// </summary>
  46. void InitializeComponent(void)
  47. {
  48. this->webBrowser = (gcnew System::Windows::Forms::WebBrowser());
  49. this->copyToClipboard = (gcnew System::Windows::Forms::Button());
  50. this->SuspendLayout();
  51. //
  52. // webBrowser
  53. //
  54. this->webBrowser->AllowNavigation = false;
  55. this->webBrowser->AllowWebBrowserDrop = false;
  56. this->webBrowser->Dock = System::Windows::Forms::DockStyle::Fill;
  57. this->webBrowser->Location = System::Drawing::Point(0, 0);
  58. this->webBrowser->MinimumSize = System::Drawing::Size(20, 20);
  59. this->webBrowser->Name = L"webBrowser";
  60. this->webBrowser->Size = System::Drawing::Size(784, 562);
  61. this->webBrowser->TabIndex = 0;
  62. this->webBrowser->WebBrowserShortcutsEnabled = false;
  63. //
  64. // copyToClipboard
  65. //
  66. this->copyToClipboard->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
  67. this->copyToClipboard->Location = System::Drawing::Point(638, 12);
  68. this->copyToClipboard->Name = L"copyToClipboard";
  69. this->copyToClipboard->Size = System::Drawing::Size(120, 23);
  70. this->copyToClipboard->TabIndex = 1;
  71. this->copyToClipboard->Text = L"CopyTo Clipboard";
  72. this->copyToClipboard->UseVisualStyleBackColor = true;
  73. this->copyToClipboard->Click += gcnew System::EventHandler(this, &MainForm::CopyToClipboard_Click);
  74. //
  75. // MainForm
  76. //
  77. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  78. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  79. this->ClientSize = System::Drawing::Size(784, 562);
  80. this->Controls->Add(this->copyToClipboard);
  81. this->Controls->Add(this->webBrowser);
  82. this->Name = L"MainForm";
  83. this->Text = L"XNA Graphics Profile Checker";
  84. this->ResumeLayout(false);
  85. }
  86. #pragma endregion
  87. };
  88. }