⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.h

📁 This rar contains code from every chapter of Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008.Mar
💻 H
📖 第 1 页 / 共 3 页
字号:
      // searchToolStripMenuItem
      // 
      this->searchToolStripMenuItem->Name = L"searchToolStripMenuItem";
      this->searchToolStripMenuItem->Size = System::Drawing::Size(129, 22);
      this->searchToolStripMenuItem->Text = L"&Search";
      // 
      // toolStripSeparator5
      // 
      this->toolStripSeparator5->Name = L"toolStripSeparator5";
      this->toolStripSeparator5->Size = System::Drawing::Size(126, 6);
      // 
      // aboutToolStripMenuItem
      // 
      this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
      this->aboutToolStripMenuItem->Size = System::Drawing::Size(129, 22);
      this->aboutToolStripMenuItem->Text = L"&About...";
      // 
      // toolStrip1
      // 
      this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(15) {this->newToolStripButton, 
        this->openToolStripButton, this->saveToolStripButton, this->printToolStripButton, this->toolStripSeparator6, this->toolStripSeparator7, 
        this->toolStripLineButton, this->rectangleToolStripButton, this->circleToolStripButton, this->curveToolStripButton, this->toolStripSeparator8, 
        this->blackToolStripButton, this->redToolStripButton, this->greenToolStripButton, this->blueToolStripButton});
      this->toolStrip1->Location = System::Drawing::Point(0, 24);
      this->toolStrip1->Name = L"toolStrip1";
      this->toolStrip1->Size = System::Drawing::Size(355, 25);
      this->toolStrip1->TabIndex = 1;
      this->toolStrip1->Text = L"toolStrip1";
      // 
      // newToolStripButton
      // 
      this->newToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->newToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"newToolStripButton.Image")));
      this->newToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->newToolStripButton->Name = L"newToolStripButton";
      this->newToolStripButton->Size = System::Drawing::Size(23, 22);
      this->newToolStripButton->Text = L"&New";
      // 
      // openToolStripButton
      // 
      this->openToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->openToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"openToolStripButton.Image")));
      this->openToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->openToolStripButton->Name = L"openToolStripButton";
      this->openToolStripButton->Size = System::Drawing::Size(23, 22);
      this->openToolStripButton->Text = L"&Open";
      // 
      // saveToolStripButton
      // 
      this->saveToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->saveToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"saveToolStripButton.Image")));
      this->saveToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->saveToolStripButton->Name = L"saveToolStripButton";
      this->saveToolStripButton->Size = System::Drawing::Size(23, 22);
      this->saveToolStripButton->Text = L"&Save";
      // 
      // printToolStripButton
      // 
      this->printToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->printToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"printToolStripButton.Image")));
      this->printToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->printToolStripButton->Name = L"printToolStripButton";
      this->printToolStripButton->Size = System::Drawing::Size(23, 22);
      this->printToolStripButton->Text = L"&Print";
      // 
      // toolStripSeparator6
      // 
      this->toolStripSeparator6->Name = L"toolStripSeparator6";
      this->toolStripSeparator6->Size = System::Drawing::Size(6, 25);
      // 
      // toolStripSeparator7
      // 
      this->toolStripSeparator7->Name = L"toolStripSeparator7";
      this->toolStripSeparator7->Size = System::Drawing::Size(6, 25);
      // 
      // toolStripLineButton
      // 
      this->toolStripLineButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->toolStripLineButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripLineButton.Image")));
      this->toolStripLineButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->toolStripLineButton->Name = L"toolStripLineButton";
      this->toolStripLineButton->Size = System::Drawing::Size(23, 22);
      this->toolStripLineButton->Text = L"toolStripButton1";
      this->toolStripLineButton->ToolTipText = L"Draw lines";
      this->toolStripLineButton->Click += gcnew System::EventHandler(this, &Form1::lineToolStripMenuItem_Click);
      // 
      // rectangleToolStripButton
      // 
      this->rectangleToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->rectangleToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"rectangleToolStripButton.Image")));
      this->rectangleToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->rectangleToolStripButton->Name = L"rectangleToolStripButton";
      this->rectangleToolStripButton->Size = System::Drawing::Size(23, 22);
      this->rectangleToolStripButton->Text = L"toolStripButton1";
      this->rectangleToolStripButton->ToolTipText = L"Draw rectangles";
      this->rectangleToolStripButton->Click += gcnew System::EventHandler(this, &Form1::rectangleToolStripMenuItem_Click);
      // 
      // circleToolStripButton
      // 
      this->circleToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->circleToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"circleToolStripButton.Image")));
      this->circleToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->circleToolStripButton->Name = L"circleToolStripButton";
      this->circleToolStripButton->Size = System::Drawing::Size(23, 22);
      this->circleToolStripButton->Text = L"toolStripButton1";
      this->circleToolStripButton->ToolTipText = L"Draw circles";
      this->circleToolStripButton->Click += gcnew System::EventHandler(this, &Form1::circleToolStripMenuItem_Click);
      // 
      // curveToolStripButton
      // 
      this->curveToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->curveToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"curveToolStripButton.Image")));
      this->curveToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->curveToolStripButton->Name = L"curveToolStripButton";
      this->curveToolStripButton->Size = System::Drawing::Size(23, 22);
      this->curveToolStripButton->Text = L"toolStripButton1";
      this->curveToolStripButton->ToolTipText = L"Draw curves";
      this->curveToolStripButton->Click += gcnew System::EventHandler(this, &Form1::curveToolStripMenuItem_DoubleClick);
      // 
      // toolStripSeparator8
      // 
      this->toolStripSeparator8->Name = L"toolStripSeparator8";
      this->toolStripSeparator8->Size = System::Drawing::Size(6, 25);
      // 
      // blackToolStripButton
      // 
      this->blackToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->blackToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"blackToolStripButton.Image")));
      this->blackToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->blackToolStripButton->Name = L"blackToolStripButton";
      this->blackToolStripButton->Size = System::Drawing::Size(23, 22);
      this->blackToolStripButton->Text = L"toolStripButton1";
      this->blackToolStripButton->ToolTipText = L"Draw in black";
      this->blackToolStripButton->Click += gcnew System::EventHandler(this, &Form1::blackToolStripMenuItem_Click);
      // 
      // redToolStripButton
      // 
      this->redToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->redToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"redToolStripButton.Image")));
      this->redToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->redToolStripButton->Name = L"redToolStripButton";
      this->redToolStripButton->Size = System::Drawing::Size(23, 22);
      this->redToolStripButton->Text = L"toolStripButton1";
      this->redToolStripButton->ToolTipText = L"Draw in red";
      this->redToolStripButton->Click += gcnew System::EventHandler(this, &Form1::redToolStripMenuItem_Click);
      // 
      // greenToolStripButton
      // 
      this->greenToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->greenToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"greenToolStripButton.Image")));
      this->greenToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->greenToolStripButton->Name = L"greenToolStripButton";
      this->greenToolStripButton->Size = System::Drawing::Size(23, 22);
      this->greenToolStripButton->Text = L"toolStripButton1";
      this->greenToolStripButton->ToolTipText = L"Draw in green";
      this->greenToolStripButton->Click += gcnew System::EventHandler(this, &Form1::greenToolStripMenuItem_Click);
      // 
      // blueToolStripButton
      // 
      this->blueToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
      this->blueToolStripButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"blueToolStripButton.Image")));
      this->blueToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
      this->blueToolStripButton->Name = L"blueToolStripButton";
      this->blueToolStripButton->Size = System::Drawing::Size(23, 22);
      this->blueToolStripButton->Text = L"toolStripButton1";
      this->blueToolStripButton->ToolTipText = L"Draw in blue";
      this->blueToolStripButton->Click += gcnew System::EventHandler(this, &Form1::blueToolStripMenuItem_Click);
      // 
      // Form1
      // 
      this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
      this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
      this->ClientSize = System::Drawing::Size(355, 273);
      this->Controls->Add(this->toolStrip1);
      this->Controls->Add(this->menuStrip1);
      this->MainMenuStrip = this->menuStrip1;
      this->Name = L"Form1";
      this->Text = L"CLR Sketcher";
      this->menuStrip1->ResumeLayout(false);
      this->menuStrip1->PerformLayout();
      this->toolStrip1->ResumeLayout(false);
      this->toolStrip1->PerformLayout();
      this->ResumeLayout(false);
      this->PerformLayout();

    }
#pragma endregion
  private: System::Void lineToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
   elementType = ElementType::LINE;          }
private: System::Void rectangleToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
    elementType = ElementType::RECTANGLE;       }
private: System::Void circleToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
   elementType = ElementType::CIRCLE;        }
private: System::Void curveToolStripMenuItem_DoubleClick(System::Object^  sender, System::EventArgs^  e) {
   elementType = ElementType::CURVE;        }
private: System::Void blackToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
            color = Color::Black;        }
private: System::Void redToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
            color = Color::Red;        }
private: System::Void greenToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
            color = Color::Green;        }
private: System::Void blueToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
            color = Color::Blue;        }
private: System::Void colorToolStripMenuItem_DropDownOpening(System::Object^  sender, System::EventArgs^  e) {
  blackToolStripMenuItem->Checked = color == Color::Black;
  redToolStripMenuItem->Checked = color == Color::Red;
  greenToolStripMenuItem->Checked = color == Color::Green;
  blueToolStripMenuItem->Checked = color == Color::Blue;
         }
private: System::Void elementToolStripMenuItem_DropDownOpening(System::Object^  sender, System::EventArgs^  e) {
  lineToolStripMenuItem->Checked = elementType == ElementType::LINE;
  rectangleToolStripMenuItem->Checked = elementType == ElementType::RECTANGLE;
  circleToolStripMenuItem->Checked = elementType == ElementType::CIRCLE;
  curveToolStripMenuItem->Checked = elementType == ElementType::CURVE;
        }
         // Current element type
         ElementType elementType;
         // Current drawing color
         Color color;
};
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -