ExcelRTC  0.5.0
 全て クラス ファイル 関数 変数
Form1.h
説明を見る。
1 // -*-C++-*-
6 #pragma once
7 
8 #include <vector>
9 #include <string>
10 #include <iostream>
11 #include "ExcelObject.h"
12 #include "SubFunction.h"
13 
14 
15 namespace ExcelRTC {
16 
17  using namespace System;
18  using namespace System::ComponentModel;
19  using namespace System::Collections;
20  using namespace System::Windows::Forms;
21  using namespace System::Data;
22  using namespace System::Drawing;
23 
33 
37  public ref class Form1 : public System::Windows::Forms::Form
38  {
39  public:
43  Form1(void)
44  {
45  InitializeComponent();
46  //
47  //TODO: ここにコンストラクタ コードを追加します
48  //
49 
50  currentDirectory = "c:\\";
51 
52  InitFunc();
53 
54 
55  }
56 
60  void SetTree();
61 
67  void AddTree(TreeObject *to, System::Windows::Forms::TreeNode^ tn);
68 
72  void InitFunc();
73 
77  void createPort();
78 
82  void DeletePort();
83 
87  void SetPortParam();
88 
92  void resetPort();
93 
97  void resetAllPort();
98 
102  void OpenFile();
103 
107  void UpdateInPortList();
108 
112  void UpdateAttachList();
113 
117  void AttachInPort();
118 
122  void DetachInPort();
123 
127  void UpdatePortList();
128 
137  void SetPortParamEx(std::string m_low, int m_col, std::string m_len, std::string m_sn, bool m_state);
138  private: System::String^ currentDirectory;
139  public:
140  System::Windows::Forms::TreeNode^ m_node;
141  private: System::Windows::Forms::ComboBox^ InPortcomboBox;
142  private: System::Windows::Forms::ComboBox^ AttachcomboBox;
143  public:
144 
145  public:
146 
147  private: System::Windows::Forms::Label^ InPortlabel;
148  private: System::Windows::Forms::Label^ Portlabel;
149  private: System::Windows::Forms::Button^ Attachbutton;
150  private: System::Windows::Forms::Button^ Detachbutton;
151  private: System::Windows::Forms::CheckBox^ LowcheckBox;
152  private: System::Windows::Forms::ComboBox^ PortListcomboBox;
153 
154 
155 
156 
157 
158 
159 
160  public: static ExcelRTC::Form1 ^m_form;
161 
162  protected:
166  ~Form1()
167  {
168  if (components)
169  {
170  delete components;
171  }
172  }
173  private: System::Windows::Forms::Button^ Resetbutton;
174  private: System::Windows::Forms::Button^ AllResetbutton;
175  protected:
176 
177  private: System::Windows::Forms::Button^ Addbutton;
178 
179  private: System::Windows::Forms::Button^ Deletebutton;
180 
181  private: System::Windows::Forms::Button^ NamingServerbutton;
182 
183  private: System::Windows::Forms::Button^ Closebutton;
184 
185  private: System::Windows::Forms::Button^ Loadbutton;
186  private: System::Windows::Forms::TextBox^ ColtextBox;
187  private: System::Windows::Forms::TextBox^ InfotextBox;
188 
189 
190 
191  private: System::Windows::Forms::TextBox^ NamingServertextBox;
192  private: System::Windows::Forms::TextBox^ LentextBox;
193 
194 
195  private: System::Windows::Forms::TextBox^ LawtextBox;
196  private: System::Windows::Forms::ComboBox^ SheetcomboBox;
197 
198 
199  private: System::Windows::Forms::TreeView^ RTCtreeView;
200 
201  private: System::Windows::Forms::OpenFileDialog^ openFileDialog1;
202  private: System::Windows::Forms::Label^ Collabel;
203 
204  private: System::Windows::Forms::Label^ Sheetlabel;
205 
206  private: System::Windows::Forms::Label^ Lawlabel;
207 
208 
209  private: System::Windows::Forms::Label^ ManeServerlabel;
210 
211  protected:
212 
213  private:
217  System::ComponentModel::Container ^components;
218 
219 #pragma region Windows Form Designer generated code
220 
221 
222 
223 
224  void InitializeComponent(void)
225  {
226  this->Resetbutton = (gcnew System::Windows::Forms::Button());
227  this->AllResetbutton = (gcnew System::Windows::Forms::Button());
228  this->Addbutton = (gcnew System::Windows::Forms::Button());
229  this->Deletebutton = (gcnew System::Windows::Forms::Button());
230  this->NamingServerbutton = (gcnew System::Windows::Forms::Button());
231  this->Closebutton = (gcnew System::Windows::Forms::Button());
232  this->Loadbutton = (gcnew System::Windows::Forms::Button());
233  this->ColtextBox = (gcnew System::Windows::Forms::TextBox());
234  this->InfotextBox = (gcnew System::Windows::Forms::TextBox());
235  this->NamingServertextBox = (gcnew System::Windows::Forms::TextBox());
236  this->LentextBox = (gcnew System::Windows::Forms::TextBox());
237  this->LawtextBox = (gcnew System::Windows::Forms::TextBox());
238  this->SheetcomboBox = (gcnew System::Windows::Forms::ComboBox());
239  this->RTCtreeView = (gcnew System::Windows::Forms::TreeView());
240  this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
241  this->Collabel = (gcnew System::Windows::Forms::Label());
242  this->Sheetlabel = (gcnew System::Windows::Forms::Label());
243  this->Lawlabel = (gcnew System::Windows::Forms::Label());
244  this->ManeServerlabel = (gcnew System::Windows::Forms::Label());
245  this->InPortcomboBox = (gcnew System::Windows::Forms::ComboBox());
246  this->AttachcomboBox = (gcnew System::Windows::Forms::ComboBox());
247  this->InPortlabel = (gcnew System::Windows::Forms::Label());
248  this->Portlabel = (gcnew System::Windows::Forms::Label());
249  this->Attachbutton = (gcnew System::Windows::Forms::Button());
250  this->Detachbutton = (gcnew System::Windows::Forms::Button());
251  this->LowcheckBox = (gcnew System::Windows::Forms::CheckBox());
252  this->PortListcomboBox = (gcnew System::Windows::Forms::ComboBox());
253  this->SuspendLayout();
254  //
255  // Resetbutton
256  //
257  this->Resetbutton->Location = System::Drawing::Point(273, 211);
258  this->Resetbutton->Name = L"Resetbutton";
259  this->Resetbutton->Size = System::Drawing::Size(138, 23);
260  this->Resetbutton->TabIndex = 0;
261  this->Resetbutton->Text = L"列番号初期化";
262  this->Resetbutton->UseVisualStyleBackColor = true;
263  this->Resetbutton->Click += gcnew System::EventHandler(this, &Form1::Resetbutton_Click);
264  //
265  // AllResetbutton
266  //
267  this->AllResetbutton->Location = System::Drawing::Point(273, 240);
268  this->AllResetbutton->Name = L"AllResetbutton";
269  this->AllResetbutton->Size = System::Drawing::Size(138, 23);
270  this->AllResetbutton->TabIndex = 1;
271  this->AllResetbutton->Text = L"全ての列番号を初期化";
272  this->AllResetbutton->UseVisualStyleBackColor = true;
273  this->AllResetbutton->Click += gcnew System::EventHandler(this, &Form1::AllResetbutton_Click);
274  //
275  // Addbutton
276  //
277  this->Addbutton->Location = System::Drawing::Point(21, 298);
278  this->Addbutton->Name = L"Addbutton";
279  this->Addbutton->Size = System::Drawing::Size(97, 23);
280  this->Addbutton->TabIndex = 2;
281  this->Addbutton->Text = L"作成";
282  this->Addbutton->UseVisualStyleBackColor = true;
283  this->Addbutton->Click += gcnew System::EventHandler(this, &Form1::Addbutton_Click);
284  //
285  // Deletebutton
286  //
287  this->Deletebutton->Location = System::Drawing::Point(124, 298);
288  this->Deletebutton->Name = L"Deletebutton";
289  this->Deletebutton->Size = System::Drawing::Size(102, 23);
290  this->Deletebutton->TabIndex = 3;
291  this->Deletebutton->Text = L"削除";
292  this->Deletebutton->UseVisualStyleBackColor = true;
293  this->Deletebutton->Click += gcnew System::EventHandler(this, &Form1::Deletebutton_Click);
294  //
295  // NamingServerbutton
296  //
297  this->NamingServerbutton->Location = System::Drawing::Point(273, 182);
298  this->NamingServerbutton->Name = L"NamingServerbutton";
299  this->NamingServerbutton->Size = System::Drawing::Size(138, 23);
300  this->NamingServerbutton->TabIndex = 4;
301  this->NamingServerbutton->Text = L"ツリー表示";
302  this->NamingServerbutton->UseVisualStyleBackColor = true;
303  this->NamingServerbutton->Click += gcnew System::EventHandler(this, &Form1::NamingServerbutton_Click);
304  //
305  // Closebutton
306  //
307  this->Closebutton->Location = System::Drawing::Point(273, 298);
308  this->Closebutton->Name = L"Closebutton";
309  this->Closebutton->Size = System::Drawing::Size(138, 23);
310  this->Closebutton->TabIndex = 5;
311  this->Closebutton->Text = L"閉じる";
312  this->Closebutton->UseVisualStyleBackColor = true;
313  this->Closebutton->Click += gcnew System::EventHandler(this, &Form1::Closebutton_Click);
314  //
315  // Loadbutton
316  //
317  this->Loadbutton->Location = System::Drawing::Point(273, 269);
318  this->Loadbutton->Name = L"Loadbutton";
319  this->Loadbutton->Size = System::Drawing::Size(138, 23);
320  this->Loadbutton->TabIndex = 6;
321  this->Loadbutton->Text = L"ファイル読み込み";
322  this->Loadbutton->UseVisualStyleBackColor = true;
323  this->Loadbutton->Click += gcnew System::EventHandler(this, &Form1::Loadbutton_Click);
324  //
325  // ColtextBox
326  //
327  this->ColtextBox->Location = System::Drawing::Point(273, 45);
328  this->ColtextBox->Name = L"ColtextBox";
329  this->ColtextBox->Size = System::Drawing::Size(138, 19);
330  this->ColtextBox->TabIndex = 7;
331  this->ColtextBox->TextChanged += gcnew System::EventHandler(this, &Form1::ColtextBox_TextChanged);
332  //
333  // InfotextBox
334  //
335  this->InfotextBox->Location = System::Drawing::Point(273, 7);
336  this->InfotextBox->Name = L"InfotextBox";
337  this->InfotextBox->Size = System::Drawing::Size(138, 19);
338  this->InfotextBox->TabIndex = 8;
339  this->InfotextBox->TextChanged += gcnew System::EventHandler(this, &Form1::InfotextBox_TextChanged);
340  //
341  // NamingServertextBox
342  //
343  this->NamingServertextBox->Location = System::Drawing::Point(273, 156);
344  this->NamingServertextBox->Name = L"NamingServertextBox";
345  this->NamingServertextBox->Size = System::Drawing::Size(138, 19);
346  this->NamingServertextBox->TabIndex = 9;
347  this->NamingServertextBox->TextChanged += gcnew System::EventHandler(this, &Form1::NamingServertextBox_TextChanged);
348  //
349  // LentextBox
350  //
351  this->LentextBox->Location = System::Drawing::Point(352, 81);
352  this->LentextBox->Name = L"LentextBox";
353  this->LentextBox->Size = System::Drawing::Size(59, 19);
354  this->LentextBox->TabIndex = 10;
355  //
356  // LawtextBox
357  //
358  this->LawtextBox->Location = System::Drawing::Point(273, 81);
359  this->LawtextBox->Name = L"LawtextBox";
360  this->LawtextBox->Size = System::Drawing::Size(64, 19);
361  this->LawtextBox->TabIndex = 11;
362  this->LawtextBox->TextChanged += gcnew System::EventHandler(this, &Form1::LawtextBox_TextChanged);
363  //
364  // SheetcomboBox
365  //
366  this->SheetcomboBox->FormattingEnabled = true;
367  this->SheetcomboBox->Location = System::Drawing::Point(273, 118);
368  this->SheetcomboBox->Name = L"SheetcomboBox";
369  this->SheetcomboBox->Size = System::Drawing::Size(138, 20);
370  this->SheetcomboBox->TabIndex = 12;
371  this->SheetcomboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::SheetcomboBox_SelectedIndexChanged);
372  //
373  // RTCtreeView
374  //
375  this->RTCtreeView->Location = System::Drawing::Point(12, 3);
376  this->RTCtreeView->Name = L"RTCtreeView";
377  this->RTCtreeView->Size = System::Drawing::Size(255, 260);
378  this->RTCtreeView->TabIndex = 13;
379  this->RTCtreeView->AfterSelect += gcnew System::Windows::Forms::TreeViewEventHandler(this, &Form1::RTCtreeView_AfterSelect);
380  //
381  // openFileDialog1
382  //
383  this->openFileDialog1->FileName = L"openFileDialog1";
384  //
385  // Collabel
386  //
387  this->Collabel->AutoSize = true;
388  this->Collabel->Location = System::Drawing::Point(319, 67);
389  this->Collabel->Name = L"Collabel";
390  this->Collabel->Size = System::Drawing::Size(41, 12);
391  this->Collabel->TabIndex = 14;
392  this->Collabel->Text = L"行番号";
393  //
394  // Sheetlabel
395  //
396  this->Sheetlabel->AutoSize = true;
397  this->Sheetlabel->Location = System::Drawing::Point(319, 103);
398  this->Sheetlabel->Name = L"Sheetlabel";
399  this->Sheetlabel->Size = System::Drawing::Size(45, 12);
400  this->Sheetlabel->TabIndex = 15;
401  this->Sheetlabel->Text = L"シート名";
402  //
403  // Lawlabel
404  //
405  this->Lawlabel->AutoSize = true;
406  this->Lawlabel->Location = System::Drawing::Point(319, 30);
407  this->Lawlabel->Name = L"Lawlabel";
408  this->Lawlabel->Size = System::Drawing::Size(41, 12);
409  this->Lawlabel->TabIndex = 16;
410  this->Lawlabel->Text = L"列番号";
411  this->Lawlabel->Click += gcnew System::EventHandler(this, &Form1::Lawlabel_Click);
412  //
413  // ManeServerlabel
414  //
415  this->ManeServerlabel->AutoSize = true;
416  this->ManeServerlabel->Location = System::Drawing::Point(281, 141);
417  this->ManeServerlabel->Name = L"ManeServerlabel";
418  this->ManeServerlabel->Size = System::Drawing::Size(121, 12);
419  this->ManeServerlabel->TabIndex = 17;
420  this->ManeServerlabel->Text = L"ネームサーバーのアドレス";
421  //
422  // InPortcomboBox
423  //
424  this->InPortcomboBox->FormattingEnabled = true;
425  this->InPortcomboBox->Location = System::Drawing::Point(446, 24);
426  this->InPortcomboBox->Name = L"InPortcomboBox";
427  this->InPortcomboBox->Size = System::Drawing::Size(121, 20);
428  this->InPortcomboBox->TabIndex = 18;
429  this->InPortcomboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox1_SelectedIndexChanged);
430  //
431  // AttachcomboBox
432  //
433  this->AttachcomboBox->FormattingEnabled = true;
434  this->AttachcomboBox->Location = System::Drawing::Point(446, 67);
435  this->AttachcomboBox->Name = L"AttachcomboBox";
436  this->AttachcomboBox->Size = System::Drawing::Size(121, 20);
437  this->AttachcomboBox->TabIndex = 19;
438  this->AttachcomboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox2_SelectedIndexChanged);
439  //
440  // InPortlabel
441  //
442  this->InPortlabel->AutoSize = true;
443  this->InPortlabel->Location = System::Drawing::Point(478, 8);
444  this->InPortlabel->Name = L"InPortlabel";
445  this->InPortlabel->Size = System::Drawing::Size(51, 12);
446  this->InPortlabel->TabIndex = 20;
447  this->InPortlabel->Text = L"インポート";
448  //
449  // Portlabel
450  //
451  this->Portlabel->AutoSize = true;
452  this->Portlabel->Location = System::Drawing::Point(460, 52);
453  this->Portlabel->Name = L"Portlabel";
454  this->Portlabel->Size = System::Drawing::Size(99, 12);
455  this->Portlabel->TabIndex = 21;
456  this->Portlabel->Text = L"関連付けしたInPort";
457  //
458  // Attachbutton
459  //
460  this->Attachbutton->Location = System::Drawing::Point(459, 103);
461  this->Attachbutton->Name = L"Attachbutton";
462  this->Attachbutton->Size = System::Drawing::Size(96, 23);
463  this->Attachbutton->TabIndex = 22;
464  this->Attachbutton->Text = L"関連付け";
465  this->Attachbutton->UseVisualStyleBackColor = true;
466  this->Attachbutton->Click += gcnew System::EventHandler(this, &Form1::Attachbutton_Click);
467  //
468  // Detachbutton
469  //
470  this->Detachbutton->Location = System::Drawing::Point(461, 133);
471  this->Detachbutton->Name = L"Detachbutton";
472  this->Detachbutton->Size = System::Drawing::Size(94, 23);
473  this->Detachbutton->TabIndex = 23;
474  this->Detachbutton->Text = L"関連付け解除";
475  this->Detachbutton->UseVisualStyleBackColor = true;
476  this->Detachbutton->Click += gcnew System::EventHandler(this, &Form1::Detachbutton_Click);
477  //
478  // LowcheckBox
479  //
480  this->LowcheckBox->AutoSize = true;
481  this->LowcheckBox->Location = System::Drawing::Point(453, 182);
482  this->LowcheckBox->Name = L"LowcheckBox";
483  this->LowcheckBox->Size = System::Drawing::Size(106, 16);
484  this->LowcheckBox->TabIndex = 24;
485  this->LowcheckBox->Text = L"列を移動させるか";
486  this->LowcheckBox->UseVisualStyleBackColor = true;
487  this->LowcheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::LowcheckBox_CheckedChanged);
488  //
489  // PortListcomboBox
490  //
491  this->PortListcomboBox->FormattingEnabled = true;
492  this->PortListcomboBox->Location = System::Drawing::Point(12, 269);
493  this->PortListcomboBox->Name = L"PortListcomboBox";
494  this->PortListcomboBox->Size = System::Drawing::Size(255, 20);
495  this->PortListcomboBox->TabIndex = 25;
496  this->PortListcomboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::PortListcomboBox_SelectedIndexChanged);
497  //
498  // Form1
499  //
500  this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
501  this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
502  this->ClientSize = System::Drawing::Size(591, 333);
503  this->Controls->Add(this->PortListcomboBox);
504  this->Controls->Add(this->LowcheckBox);
505  this->Controls->Add(this->Detachbutton);
506  this->Controls->Add(this->Attachbutton);
507  this->Controls->Add(this->Portlabel);
508  this->Controls->Add(this->InPortlabel);
509  this->Controls->Add(this->AttachcomboBox);
510  this->Controls->Add(this->InPortcomboBox);
511  this->Controls->Add(this->ManeServerlabel);
512  this->Controls->Add(this->Lawlabel);
513  this->Controls->Add(this->Sheetlabel);
514  this->Controls->Add(this->Collabel);
515  this->Controls->Add(this->RTCtreeView);
516  this->Controls->Add(this->SheetcomboBox);
517  this->Controls->Add(this->LawtextBox);
518  this->Controls->Add(this->LentextBox);
519  this->Controls->Add(this->NamingServertextBox);
520  this->Controls->Add(this->InfotextBox);
521  this->Controls->Add(this->ColtextBox);
522  this->Controls->Add(this->Loadbutton);
523  this->Controls->Add(this->Closebutton);
524  this->Controls->Add(this->NamingServerbutton);
525  this->Controls->Add(this->Deletebutton);
526  this->Controls->Add(this->Addbutton);
527  this->Controls->Add(this->AllResetbutton);
528  this->Controls->Add(this->Resetbutton);
529  this->Name = L"Form1";
530  this->Text = L"ExcelRTC";
531  this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
532  this->ResumeLayout(false);
533  this->PerformLayout();
534 
535  }
536 #pragma endregion
537  private: System::Void NamingServerbutton_Click(System::Object^ sender, System::EventArgs^ e) {
538  SetTree();
539  }
540 private: System::Void AllResetbutton_Click(System::Object^ sender, System::EventArgs^ e) {
541  resetAllPort();
542  }
543 private: System::Void Loadbutton_Click(System::Object^ sender, System::EventArgs^ e) {
544  OpenFile();
545  }
546 private: System::Void Deletebutton_Click(System::Object^ sender, System::EventArgs^ e) {
547  DeletePort();
548  }
549 private: System::Void Addbutton_Click(System::Object^ sender, System::EventArgs^ e) {
550  createPort();
551  }
552 private: System::Void Closebutton_Click(System::Object^ sender, System::EventArgs^ e) {
554  }
555 private: System::Void Resetbutton_Click(System::Object^ sender, System::EventArgs^ e) {
556  resetPort();
557  }
558 private: System::Void InfotextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
559  }
560 private: System::Void Lawlabel_Click(System::Object^ sender, System::EventArgs^ e) {
561  }
562 private: System::Void ColtextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
563  }
564 private: System::Void SheetcomboBox_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
565  }
566 private: System::Void NamingServertextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
567  }
568 private: System::Void LawtextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
569  }
570 private: System::Void RTCtreeView_AfterSelect(System::Object^ sender, System::Windows::Forms::TreeViewEventArgs^ e) {
571  SetPortParam();
572  PortListcomboBox->Text = "";
573  }
574 private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
575  }
576 private: System::Void comboBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
577  }
578 private: System::Void comboBox2_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
579  }
580 private: System::Void Attachbutton_Click(System::Object^ sender, System::EventArgs^ e) {
581  AttachInPort();
582  }
583 private: System::Void Detachbutton_Click(System::Object^ sender, System::EventArgs^ e) {
584  DetachInPort();
585  }
586 private: System::Void LowcheckBox_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
587 
588  }
589 private: System::Void PortListcomboBox_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
590  SetPortParam();
591  }
592 };
593 }
594