#pragma once ///////////////////////////////////////////////////////////////////// // BrowseForm.h - declares browse form, used to send selected // // paths back to parent form // // // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2004 // ///////////////////////////////////////////////////////////////////// // Notes: // // This form hosts a .Net control, tvPlus, written in C#. // // Amazingly, you just pull the control from the toolbox // // (you have to add the control to the toolbox first) onto // // the form and use it! Everything just works due to the // // effective interoperability mechanisms built into .Net. // ///////////////////////////////////////////////////////////////////// using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace System::Threading; namespace demoWinForm { /// /// Summary for BrowseForm /// /// 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. /// public ref class BrowseForm : public System::Windows::Forms::Form { public: BrowseForm(void) : _first(true) { InitializeComponent(); } protected: ~BrowseForm() { if (components) { delete components; } } private: TreeViewPlus::TVPlus ^ tvPlus1; // private: System::ComponentModel::Container^ components; void InitializeComponent(void) { this->tvPlus1 = gcnew TreeViewPlus::TVPlus(); this->SuspendLayout(); // // tvPlus1 // this->tvPlus1->Anchor = (System::Windows::Forms::AnchorStyles)(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right); this->tvPlus1->Location = System::Drawing::Point(8, 8); this->tvPlus1->Name = "tvPlus1"; this->tvPlus1->showFiles = false; this->tvPlus1->Size = System::Drawing::Size(272, 464); this->tvPlus1->TabIndex = 0; this->tvPlus1->AfterSelect += gcnew System::Windows::Forms::TreeViewEventHandler(this, &BrowseForm::tvPlus1_AfterSelect); // // BrowseForm // this->AutoScaleBaseSize = System::Drawing::Size(5, 13); this->ClientSize = System::Drawing::Size(292, 490); this->Controls->Add(this->tvPlus1); this->Name = "BrowseForm"; this->Text = "BrowseForm"; this->Load += gcnew System::EventHandler(this, &demoWinForm::BrowseForm::BrowseForm_Load); this->ResumeLayout(false); } private: System::Void tvPlus1_AfterSelect( System::Object ^ sender, System::Windows::Forms::TreeViewEventArgs ^ e); System::Void BrowseForm_Load( System::Object ^ sender, System::EventArgs ^ e); Form^ _baseForm; bool _first; public: void setBaseForm(Form^ baseForm); delegate void setPathDelegate(String^ path); event setPathDelegate^ setPathEvent; }; }