I'm trying to write a program which will generate templates in html..
I try to make a menu in visual c++, rest of code was written in c++ (console).
so I have 2 problems...
1st PROBLEM
I designed nice clean menu with drop-down menu containing 3 options
AVAILABILITY
DEGRADATION
UNAVAILABILITY
Now, I need to clean whole window,close that form and open another form in a place of first - just to start a sub program..It should vork like void command in console c++..you choose option and from menu, and you can write what that option should do.
I need to do that, because each option will have diffrent components at window, and will do diffrent things.
2nd PROBLEM
Is it hard to add normal C++ (non-windows/console) code to my form based program?..My windows/form based menu is used only to gather informations as a variables in a more frendly way...Working on these variables should be done in console (can be invisble)..This i mainly work on strings and files...Program will replace words in html file with the ones provided by user in Form/windows part of the program.
THX!
my code is:
#pragma once
#include "resource.h"
namespace Templater2 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
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^ availabilityToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ availabilityToolStripMenuItem1;
private: System::Windows::Forms::ToolStripMenuItem^ degradationToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ unavailabilityToolStripMenuItem;
protected:
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable.
/// </summary>
#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)
{
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->availabilityToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->availabilityToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->degradationToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->unavailabilityToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->menuStrip1->SuspendLayout();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->availabilityToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(630, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// availabilityToolStripMenuItem
//
this->availabilityToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->availabilityToolStripMenuItem1,
this->degradationToolStripMenuItem, this->unavailabilityToolStripMenuItem});
this->availabilityToolStripMenuItem->Name = L"availabilityToolStripMenuItem";
this->availabilityToolStripMenuItem->Size = System::Drawing::Size(56, 20);
this->availabilityToolStripMenuItem->Text = L"Impact";
//
// availabilityToolStripMenuItem1
//
this->availabilityToolStripMenuItem1->Name = L"availabilityToolStripMenuItem1";
this->availabilityToolStripMenuItem1->Size = System::Drawing::Size(152, 22);
this->availabilityToolStripMenuItem1->Text = L"Availability";
this->availabilityToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::availabilityToolStripMenuItem1_Click);
//
// degradationToolStripMenuItem
//
this->degradationToolStripMenuItem->Name = L"degradationToolStripMenuItem";
this->degradationToolStripMenuItem->Size = System::Drawing::Size(152, 22);
this->degradationToolStripMenuItem->Text = L"Degradation";
//
// unavailabilityToolStripMenuItem
//
this->unavailabilityToolStripMenuItem->Name = L"unavailabilityToolStripMenuItem";
this->unavailabilityToolStripMenuItem->Size = System::Drawing::Size(152, 22);
this->unavailabilityToolStripMenuItem->Text = L"Unavailability";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(630, 409);
this->Controls->Add(this->menuStrip1);
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->Text = L"Templater 1.0";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { }
private: System::Void availabilityToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {
}
};
}