📄 form1.h
字号:
#pragma once
namespace CLRSketcher {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
enum class ElementType {LINE, RECTANGLE, CIRCLE, CURVE};
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void): elementType(ElementType::LINE), color(Color::Black)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::MenuStrip^ menuStrip1;
protected:
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ newToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ openToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator;
private: System::Windows::Forms::ToolStripMenuItem^ saveToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ saveAsToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator1;
private: System::Windows::Forms::ToolStripMenuItem^ printToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ printPreviewToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator2;
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ editToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ undoToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ redoToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator3;
private: System::Windows::Forms::ToolStripMenuItem^ cutToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ copyToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ pasteToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator4;
private: System::Windows::Forms::ToolStripMenuItem^ selectAllToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ toolsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ customizeToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ optionsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ elementToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ lineToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ rectangleToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ circleToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ curveToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ helpToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ contentsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ indexToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ searchToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator5;
private: System::Windows::Forms::ToolStripMenuItem^ aboutToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ colorToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ redToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ greenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ blueToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ blackToolStripMenuItem;
private: System::Windows::Forms::ToolStrip^ toolStrip1;
private: System::Windows::Forms::ToolStripButton^ newToolStripButton;
private: System::Windows::Forms::ToolStripButton^ openToolStripButton;
private: System::Windows::Forms::ToolStripButton^ saveToolStripButton;
private: System::Windows::Forms::ToolStripButton^ printToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator6;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator7;
private: System::Windows::Forms::ToolStripButton^ toolStripLineButton;
private: System::Windows::Forms::ToolStripButton^ rectangleToolStripButton;
private: System::Windows::Forms::ToolStripButton^ circleToolStripButton;
private: System::Windows::Forms::ToolStripButton^ curveToolStripButton;
private: System::Windows::Forms::ToolStripButton^ blackToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator8;
private: System::Windows::Forms::ToolStripButton^ redToolStripButton;
private: System::Windows::Forms::ToolStripButton^ greenToolStripButton;
private: System::Windows::Forms::ToolStripButton^ blueToolStripButton;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator = (gcnew System::Windows::Forms::ToolStripSeparator());
this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->printToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->printPreviewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->editToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->undoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->redoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->cutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->copyToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->pasteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->selectAllToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->customizeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->optionsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->elementToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->lineToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->rectangleToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->circleToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->curveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->colorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->blackToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->redToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->greenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->blueToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->contentsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->indexToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->searchToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
this->newToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->openToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->saveToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->printToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->toolStripLineButton = (gcnew System::Windows::Forms::ToolStripButton());
this->rectangleToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->circleToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->curveToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator8 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->blackToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->redToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->greenToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->blueToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->menuStrip1->SuspendLayout();
this->toolStrip1->SuspendLayout();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(6) {this->fileToolStripMenuItem,
this->editToolStripMenuItem, this->toolsToolStripMenuItem, this->elementToolStripMenuItem, this->colorToolStripMenuItem, this->helpToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(355, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// fileToolStripMenuItem
//
this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->newToolStripMenuItem,
this->openToolStripMenuItem, this->toolStripSeparator, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, this->toolStripSeparator1,
this->printToolStripMenuItem, this->printPreviewToolStripMenuItem, this->toolStripSeparator2, this->exitToolStripMenuItem});
this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
this->fileToolStripMenuItem->Size = System::Drawing::Size(35, 20);
this->fileToolStripMenuItem->Text = L"&File";
//
// newToolStripMenuItem
//
this->newToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"newToolStripMenuItem.Image")));
this->newToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
this->newToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::N));
this->newToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->newToolStripMenuItem->Text = L"&New";
//
// openToolStripMenuItem
//
this->openToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"openToolStripMenuItem.Image")));
this->openToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
this->openToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::O));
this->openToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->openToolStripMenuItem->Text = L"&Open";
//
// toolStripSeparator
//
this->toolStripSeparator->Name = L"toolStripSeparator";
this->toolStripSeparator->Size = System::Drawing::Size(148, 6);
//
// saveToolStripMenuItem
//
this->saveToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"saveToolStripMenuItem.Image")));
this->saveToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
this->saveToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::S));
this->saveToolStripMenuItem->Size = System::Drawing::Size(151, 22);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -