• R/O
  • SSH
  • HTTPS

nodoka4: Commit


Commit MetaInfo

Revision228 (tree)
Time2014-11-30 13:38:45
Authorapplet

Log Message

1.03

Change Summary

Incremental Difference

--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSplash.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSplash.Designer.cs (revision 228)
@@ -0,0 +1,161 @@
1+namespace nodokaGuiEdit
2+{
3+ partial class FormSplash
4+ {
5+ /// <summary>
6+ /// 必要なデザイナー変数です。
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// 使用中のリソースをすべてクリーンアップします。
12+ /// </summary>
13+ protected override void Dispose(bool disposing)
14+ {
15+ if (disposing && (components != null))
16+ {
17+ components.Dispose();
18+ }
19+ base.Dispose(disposing);
20+ }
21+
22+ #region Windows フォーム デザイナーで生成されたコード
23+
24+ /// <summary>
25+ /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
26+ /// コード エディターで変更しないでください。
27+ /// </summary>
28+ private void InitializeComponent()
29+ {
30+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSplash));
31+ this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
32+ this.logoPictureBox = new System.Windows.Forms.PictureBox();
33+ this.labelProductName = new System.Windows.Forms.Label();
34+ this.labelVersion = new System.Windows.Forms.Label();
35+ this.labelCopyright = new System.Windows.Forms.Label();
36+ this.labelCompanyName = new System.Windows.Forms.Label();
37+ this.tableLayoutPanel.SuspendLayout();
38+ ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
39+ this.SuspendLayout();
40+ //
41+ // tableLayoutPanel
42+ //
43+ this.tableLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
44+ this.tableLayoutPanel.ColumnCount = 2;
45+ this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 24.65986F));
46+ this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75.34013F));
47+ this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
48+ this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
49+ this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
50+ this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
51+ this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
52+ this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
53+ this.tableLayoutPanel.Location = new System.Drawing.Point(12, 10);
54+ this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
55+ this.tableLayoutPanel.Name = "tableLayoutPanel";
56+ this.tableLayoutPanel.RowCount = 6;
57+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.41791F));
58+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.52402F));
59+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 23.1441F));
60+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.51282F));
61+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8.547009F));
62+ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
63+ this.tableLayoutPanel.Size = new System.Drawing.Size(495, 118);
64+ this.tableLayoutPanel.TabIndex = 0;
65+ this.tableLayoutPanel.UseWaitCursor = true;
66+ //
67+ // logoPictureBox
68+ //
69+ this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
70+ this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
71+ this.logoPictureBox.Location = new System.Drawing.Point(4, 2);
72+ this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
73+ this.logoPictureBox.Name = "logoPictureBox";
74+ this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
75+ this.logoPictureBox.Size = new System.Drawing.Size(114, 114);
76+ this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
77+ this.logoPictureBox.TabIndex = 12;
78+ this.logoPictureBox.TabStop = false;
79+ this.logoPictureBox.UseWaitCursor = true;
80+ //
81+ // labelProductName
82+ //
83+ this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
84+ this.labelProductName.Location = new System.Drawing.Point(130, 0);
85+ this.labelProductName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
86+ this.labelProductName.MaximumSize = new System.Drawing.Size(0, 20);
87+ this.labelProductName.Name = "labelProductName";
88+ this.labelProductName.Size = new System.Drawing.Size(361, 19);
89+ this.labelProductName.TabIndex = 19;
90+ this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
91+ this.labelProductName.UseWaitCursor = true;
92+ //
93+ // labelVersion
94+ //
95+ this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
96+ this.labelVersion.Location = new System.Drawing.Point(130, 19);
97+ this.labelVersion.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
98+ this.labelVersion.MaximumSize = new System.Drawing.Size(0, 20);
99+ this.labelVersion.Name = "labelVersion";
100+ this.labelVersion.Size = new System.Drawing.Size(361, 20);
101+ this.labelVersion.TabIndex = 0;
102+ this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
103+ this.labelVersion.UseWaitCursor = true;
104+ //
105+ // labelCopyright
106+ //
107+ this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
108+ this.labelCopyright.Location = new System.Drawing.Point(130, 43);
109+ this.labelCopyright.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
110+ this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 20);
111+ this.labelCopyright.Name = "labelCopyright";
112+ this.labelCopyright.Size = new System.Drawing.Size(361, 20);
113+ this.labelCopyright.TabIndex = 21;
114+ this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
115+ this.labelCopyright.UseWaitCursor = true;
116+ //
117+ // labelCompanyName
118+ //
119+ this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
120+ this.labelCompanyName.Location = new System.Drawing.Point(130, 70);
121+ this.labelCompanyName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
122+ this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 20);
123+ this.labelCompanyName.Name = "labelCompanyName";
124+ this.labelCompanyName.Size = new System.Drawing.Size(361, 20);
125+ this.labelCompanyName.TabIndex = 22;
126+ this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
127+ this.labelCompanyName.UseWaitCursor = true;
128+ //
129+ // FormSplash
130+ //
131+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
132+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
133+ this.BackColor = System.Drawing.SystemColors.ControlLight;
134+ this.ClientSize = new System.Drawing.Size(519, 138);
135+ this.Controls.Add(this.tableLayoutPanel);
136+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
137+ this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
138+ this.MaximizeBox = false;
139+ this.MinimizeBox = false;
140+ this.Name = "FormSplash";
141+ this.Padding = new System.Windows.Forms.Padding(12, 10, 12, 10);
142+ this.ShowIcon = false;
143+ this.ShowInTaskbar = false;
144+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
145+ this.UseWaitCursor = true;
146+ this.tableLayoutPanel.ResumeLayout(false);
147+ ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
148+ this.ResumeLayout(false);
149+
150+ }
151+
152+ #endregion
153+
154+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
155+ private System.Windows.Forms.PictureBox logoPictureBox;
156+ private System.Windows.Forms.Label labelProductName;
157+ private System.Windows.Forms.Label labelVersion;
158+ private System.Windows.Forms.Label labelCopyright;
159+ private System.Windows.Forms.Label labelCompanyName;
160+ }
161+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/AssemblyInfo.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/AssemblyInfo.cs (revision 228)
@@ -0,0 +1,36 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+using System.Runtime.InteropServices;
4+
5+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+// アセンブリに関連付けられている情報を変更するには、
7+// これらの属性値を変更してください。
8+[assembly: AssemblyTitle("のどかGuiEdit")]
9+[assembly: AssemblyDescription("")]
10+[assembly: AssemblyConfiguration("")]
11+[assembly: AssemblyCompany("G.K.Applet")]
12+[assembly: AssemblyProduct("nodokaGuiEdit")]
13+[assembly: AssemblyCopyright("Copyright (c) 2013,2014 G.K.Applet All Rights Reserved.")]
14+[assembly: AssemblyTrademark("")]
15+[assembly: AssemblyCulture("")]
16+
17+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
18+// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
19+// その型の ComVisible 属性を true に設定してください。
20+[assembly: ComVisible(false)]
21+
22+// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
23+[assembly: Guid("c1078d27-0ed2-49d6-ac03-50cbb5045eda")]
24+
25+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
26+//
27+// Major Version
28+// Minor Version
29+// Build Number
30+// Revision
31+//
32+// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
33+// 既定値にすることができます:
34+// [assembly: AssemblyVersion("1.0.*")]
35+[assembly: AssemblyVersion("1.0.3.0")]
36+[assembly: AssemblyFileVersion("1.0.3.0")]
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/Settings.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/Settings.Designer.cs (revision 228)
@@ -0,0 +1,30 @@
1+//------------------------------------------------------------------------------
2+// <auto-generated>
3+// This code was generated by a tool.
4+// Runtime Version:4.0.30319.17379
5+//
6+// Changes to this file may cause incorrect behavior and will be lost if
7+// the code is regenerated.
8+// </auto-generated>
9+//------------------------------------------------------------------------------
10+
11+namespace nodokaGuiEdit.Properties
12+{
13+
14+
15+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
17+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18+ {
19+
20+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21+
22+ public static Settings Default
23+ {
24+ get
25+ {
26+ return defaultInstance;
27+ }
28+ }
29+ }
30+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/Resources.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Properties/Resources.Designer.cs (revision 228)
@@ -0,0 +1,71 @@
1+//------------------------------------------------------------------------------
2+// <auto-generated>
3+// このコードはツールによって生成されました。
4+// ランタイム バージョン:4.0.30319.17379
5+//
6+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
7+// コードが再生成されるときに損失したりします
8+// </auto-generated>
9+//------------------------------------------------------------------------------
10+
11+namespace nodokaGuiEdit.Properties
12+{
13+
14+
15+ /// <summary>
16+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
17+ /// </summary>
18+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
19+ // または Visual Studio のようなツールを使用して自動生成されました。
20+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
21+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
22+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25+ internal class Resources
26+ {
27+
28+ private static global::System.Resources.ResourceManager resourceMan;
29+
30+ private static global::System.Globalization.CultureInfo resourceCulture;
31+
32+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33+ internal Resources()
34+ {
35+ }
36+
37+ /// <summary>
38+ /// このクラスに使用される、キャッシュされた ResourceManager のインスタンスを返します。
39+ /// </summary>
40+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41+ internal static global::System.Resources.ResourceManager ResourceManager
42+ {
43+ get
44+ {
45+ if ((resourceMan == null))
46+ {
47+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("nodokaGuiEdit.Properties.Resources", typeof(Resources).Assembly);
48+ resourceMan = temp;
49+ }
50+ return resourceMan;
51+ }
52+ }
53+
54+ /// <summary>
55+ /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
56+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
57+ /// </summary>
58+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59+ internal static global::System.Globalization.CultureInfo Culture
60+ {
61+ get
62+ {
63+ return resourceCulture;
64+ }
65+ set
66+ {
67+ resourceCulture = value;
68+ }
69+ }
70+ }
71+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormMain.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormMain.cs (revision 228)
@@ -0,0 +1,2701 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Windows.Forms;
9+using System.IO; // for StreamReader
10+using System.Diagnostics;
11+using Microsoft.Win32; // for Debug.WriteLine
12+using System.Text.RegularExpressions; // for Regex
13+//using Microsoft.WindowsAPICodePack.Dialogs; // Custom Common Control
14+//using Microsoft.WindowsAPICodePack.Dialogs.Controls; // Custom Common Control
15+//using Microsoft.WindowsAPICodePack.Shell; // AddPlace
16+
17+namespace nodokaGuiEdit
18+{
19+ public partial class FormMain : Form
20+ {
21+ //private KeyPressEventHandler dataGridViewTextBox_KeyPress;
22+ //private KeyPressEventHandler dataGridViewTextBox_myKeyPress;
23+
24+ Encoding[] encodes = { Encoding.GetEncoding(0), // system default
25+ null,
26+ Encoding.GetEncoding(932), // SHIFT-JIS
27+ Encoding.ASCII, // US-ASCII
28+ Encoding.UTF8, // UTF8 LE
29+ Encoding.Unicode, // UTF16 LE
30+ Encoding.BigEndianUnicode // UTF16 BE
31+ };
32+
33+ public FormMain()
34+ {
35+ // Form1が表示された時の初期化コード
36+ InitializeComponent();
37+
38+ // 設定ダイアログで設定された情報の取得
39+ GetSettingReg();
40+ Global_Val.i_current_fontsize = Global_Val.i_fontsize; // 初期値を入れておく。
41+
42+ // 表示位置の設定
43+ if (Global_Val.b_position)
44+ {
45+ this.StartPosition = FormStartPosition.Manual;
46+ this.DesktopLocation = new Point(Global_Val.i_position_x, Global_Val.i_position_y);
47+ }
48+ else
49+ {
50+ this.StartPosition = FormStartPosition.WindowsDefaultLocation;
51+ }
52+
53+ // サイズの設定
54+ if (Global_Val.b_windowsize)
55+ {
56+ if (Global_Val.i_windowsize_width < 150)
57+ {
58+ Global_Val.i_windowsize_width = 635;
59+ }
60+ if (Global_Val.i_windowsize_height < 50)
61+ {
62+ Global_Val.i_windowsize_height = 398;
63+ }
64+ this.Size = new Size(Global_Val.i_windowsize_width, Global_Val.i_windowsize_height);
65+ }
66+
67+ // 列幅を幅いっぱいにする。
68+ dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
69+
70+ if (Global_Val.b_column)
71+ {
72+ dataGridView1.Columns[0].FillWeight = Global_Val.i_column_0_fillwidth; // 有効
73+ dataGridView1.Columns[1].FillWeight = Global_Val.i_column_1_fillwidth; // 説明
74+ dataGridView1.Columns[2].FillWeight = Global_Val.i_column_2_fillwidth; // 左辺
75+ dataGridView1.Columns[3].FillWeight = Global_Val.i_column_3_fillwidth; // 右辺
76+ }
77+
78+ this.dataGridView1.RowPostPaint += new DataGridViewRowPostPaintEventHandler(putLineNumber);
79+ this.dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("MS UI Gothic", 9);
80+ this.dataGridView1.RowHeadersDefaultCellStyle.Font = new Font("MS UI Gothic", 9);
81+
82+ // フォント名、フォントサイズ、フォントスタイルを反映
83+ SetFont();
84+
85+ // 色の設定
86+ SetColor();
87+
88+ // コンテキストメニューの配置
89+ this.dataGridView1.ContextMenuStrip = this.contextMenuStrip1;
90+
91+ // 行選択を可能にする
92+ dataGridView1.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
93+
94+ // 列の分割線の幅調整をする
95+ //dataGridView1.Columns[0].DividerWidth = 3; // 行番号の右側の線を太くする。
96+
97+ //列の入れ替えを可能にしない
98+ dataGridView1.AllowUserToOrderColumns = false;
99+
100+
101+ //セルの一部分をクリックした際のコールバックルーチンを定義
102+ dataGridView1.CellClick += OnCellContentClick;
103+ dataGridView1.CellContentClick += OnCellContentClick;
104+
105+ // 設定ファイル名を引数から取得する。
106+ string file_name = get_arg();
107+
108+ if (file_name != string.Empty)
109+ {
110+ Global_Val.bAutoSave = true;
111+ }
112+ else
113+ {
114+ Global_Val.bAutoSave = readRegbUserAutoSave(); // レジストリからユーザが以前設定した値を取り出す。
115+ }
116+
117+ // Combo_encodeの設定、デフォルト選択
118+ string[] encode_names = { "システムデフォルト", "自動認識", "シフトJIS", "ASCII", "UTF-8 LE", "UTF-16 LE", "UTF-16 BE" };
119+
120+ foreach (var item in encode_names)
121+ {
122+ combo_encode.Items.Add(item);
123+ }
124+
125+ if (Global_Val.b_selectencode)
126+ {
127+ combo_encode.SelectedIndex = Global_Val.i_selectencode;
128+ }
129+ else
130+ {
131+ combo_encode.SelectedIndex = 0;
132+ Global_Val.i_selectencode = 0;
133+ }
134+
135+ // GDVにデータ読み込み(行単位)
136+ // dataGridView1.Rows.Add(コメント, "Caption", " key A", "B", "#00");
137+ Global_Val.bSaved = true; // 初期値 保存済にする。
138+ setFileSaveStatus();
139+
140+ read_dotnodoka(file_name, encodes[Global_Val.i_selectencode], false);
141+ dataGridView1[1, 0].Selected = true;
142+ dataGridView1.CurrentCell = dataGridView1[1, 0];
143+ }
144+
145+ private void SetColor()
146+ {
147+ // 偶数行の色設定
148+ this.dataGridView1.DefaultCellStyle.ForeColor = Color.FromArgb((int)(Global_Val.i_color));
149+ this.dataGridView1.DefaultCellStyle.BackColor = Color.FromArgb((int)(Global_Val.i_backcolor));
150+ this.dataGridView1.DefaultCellStyle.SelectionForeColor = Color.FromArgb((int)(Global_Val.i_selectcolor));
151+ this.dataGridView1.DefaultCellStyle.SelectionBackColor = Color.FromArgb((int)(Global_Val.i_selectbackcolor));
152+
153+
154+ // 奇数行の色設定
155+ DataGridViewCellStyle tcs = new DataGridViewCellStyle();
156+ tcs.BackColor = Color.FromArgb((int)(Global_Val.i_backcolorAlt));
157+ this.dataGridView1.AlternatingRowsDefaultCellStyle = tcs;
158+ }
159+
160+ // フォント関係の値をレジストリから取りだし DataGridViewに反映させる。
161+ private void SetFont()
162+ {
163+
164+ FontStyle tmpFS = FontStyle.Regular;
165+
166+ if (Global_Val.s_fontstyle.IndexOf("Bold") >= 0)
167+ {
168+ tmpFS = FontStyle.Bold;
169+ }
170+ if (Global_Val.s_fontstyle.IndexOf("Italic") >= 0)
171+ {
172+ tmpFS = FontStyle.Italic;
173+ }
174+ if (Global_Val.s_fontstyle.IndexOf("Bold, Italic") >= 0)
175+ {
176+ tmpFS = FontStyle.Bold | FontStyle.Italic;
177+ }
178+
179+ this.dataGridView1.DefaultCellStyle.Font = new Font(Global_Val.s_font, Global_Val.i_current_fontsize, tmpFS);
180+ }
181+
182+ private static void GetSettingReg()
183+ {
184+ // settingダイアログでレジストリに保存された情報を読み取る。
185+ RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\appletkan\\nodoka");
186+ int readData;
187+
188+ // 終了時に位置を覚える
189+ readData = (int)rk.GetValue("b_position", 0);
190+ Global_Val.b_position = (readData == 0) ? false : true;
191+
192+ Global_Val.i_position_x = (int)rk.GetValue("i_position_x", 0);
193+ Global_Val.i_position_y = (int)rk.GetValue("i_position_y", 0);
194+
195+ //ウィンドウサイズを覚える
196+ readData = (int)rk.GetValue("b_windowsize", 0);
197+ Global_Val.b_windowsize = (readData == 0) ? false : true;
198+
199+ Global_Val.i_windowsize_width = (int)rk.GetValue("i_windowsize_width", 635);
200+ Global_Val.i_windowsize_height = (int)rk.GetValue("i_windowsize_height", 398);
201+
202+ //カラムサイズを覚える
203+ readData = (int)rk.GetValue("b_column", 0);
204+ Global_Val.b_column = (readData == 0) ? false : true;
205+
206+ Global_Val.i_column_0_fillwidth = (int)rk.GetValue("i_column_0_fillwidth", 16);
207+ Global_Val.i_column_1_fillwidth = (int)rk.GetValue("i_column_1_fillwidth", 100);
208+ Global_Val.i_column_2_fillwidth = (int)rk.GetValue("i_column_2_fillwidth", 50);
209+ Global_Val.i_column_3_fillwidth = (int)rk.GetValue("i_column_3_fillwidth", 50);
210+
211+ //フォントサイズを覚える
212+ readData = (int)rk.GetValue("b_fontsize", 0);
213+ Global_Val.b_fontsize = (readData == 0) ? false : true;
214+
215+
216+ // フォント名、フォントスタイル
217+ Global_Val.s_font = (string)rk.GetValue("s_font", "MS ゴシック");
218+ Global_Val.s_fontstyle = (string)rk.GetValue("s_fontstyle", FontStyle.Regular.ToString());
219+
220+
221+ //予約語の強調表示
222+ readData = (int)rk.GetValue("b_bold", 0);
223+ Global_Val.b_bold = (readData == 0) ? false : true;
224+
225+ //ファイル名を上に表示する
226+ readData = (int)rk.GetValue("b_filename_caption", 0);
227+ Global_Val.b_filename_caption = (readData == 0) ? false : true;
228+
229+ //フォント名の取得
230+ Global_Val.s_font = (String)rk.GetValue("s_font", "MS ゴシック");
231+
232+ //フォントスタイルの取得
233+ Global_Val.s_fontstyle = (String)rk.GetValue("s_fontstyle", "Reguler");
234+ //Regular = 0, Bold = 1, Italic = 2
235+
236+ //フォントサイズの取得
237+ Global_Val.i_fontsize = (int)rk.GetValue("i_fontsize", 10);
238+
239+ //色の取得
240+ Global_Val.b_color = (int)rk.GetValue("b_color", 1); // 1 色はデフォルトのまま 0 変える。
241+
242+ if (Global_Val.b_color != 1)
243+ {
244+ Global_Val.i_color = (uint)((int)rk.GetValue("i_color", unchecked((int)(0xff000000)))); // Color.Black
245+ Global_Val.i_backcolor = (uint)((int)rk.GetValue("i_backcolor", unchecked((int)(0xffffffff)))); // Color.White
246+ Global_Val.i_backcolorAlt = (uint)((int)rk.GetValue("i_backcolorAlt", unchecked((int)(0xfff0f8ff)))); // Color.AliceBlue
247+ Global_Val.i_selectcolor = (uint)((int)rk.GetValue("i_selectcolor", unchecked((int)(0xffffffff)))); // Color.White
248+ Global_Val.i_selectbackcolor = (uint)((int)rk.GetValue("i_selectbackcolor", unchecked((int)(0xff3399ff)))); // Blue Green
249+ }
250+ else
251+ {
252+ Global_Val.i_color = 0xff000000; // Color.Black
253+ Global_Val.i_backcolor = 0xffffffff; // Color.White
254+ Global_Val.i_backcolorAlt = 0xfff0f8ff; // Color.AliceBlue
255+ Global_Val.i_selectcolor = 0xffffffff; // Color.White
256+ Global_Val.i_selectbackcolor = 0xff3399ff; // Blue Green
257+ }
258+
259+ // 終了時に文字コード指定を覚える
260+ readData = (int)rk.GetValue("b_selectencode", 0);
261+ Global_Val.b_selectencode = (readData == 0) ? false : true;
262+
263+ // 指定された文字コード
264+ Global_Val.i_selectencode = (int)rk.GetValue("i_selectencode", 0); // 0: System Default
265+
266+
267+ }
268+
269+ private void setFileSaveStatus()
270+ {
271+ // 未保存/保存済、自動保存/自動保存なし のステータス表示をアップデイトする
272+ // todo: 各ボタンやメニュー状態の有効無効を切り替える。
273+ if (Global_Val.bSaved == false)
274+ {
275+ this.toolStripSaveStatusLabel.Text = "未保存";
276+ }
277+ else
278+ {
279+ this.toolStripSaveStatusLabel.Text = "保存済";
280+ }
281+ if (Global_Val.bAutoSave == true)
282+ {
283+ this.toolStripSaveStatusLabel.Text += " 自動保存有効";
284+ this.AutoSaveToolStripMenuItem.Checked = true;
285+ }
286+ else
287+ {
288+ this.toolStripSaveStatusLabel.Text += " 自動保存なし";
289+ this.AutoSaveToolStripMenuItem.Checked = false;
290+ }
291+ }
292+
293+ public class Global_Val
294+ {
295+ // グローバル変数の宣言
296+ static public bool bSaved = true; // 変更があったらfalseにすること。
297+ static public bool bAutoSave = false; //
298+ static public bool bNew = false;
299+ static public bool b_readonly = false;
300+ static public bool bSystemClose = true;
301+ static public int i;
302+ static public int j;
303+ static public string tmpString;
304+ static public string caption;
305+ static public string LeftString;
306+ static public string RightString;
307+ static public Encoding fileCode; // 現在読み込んだファイルの文字コード
308+ static public bool addMode;
309+ static public bool wizardModeNew;
310+ static public bool bNest = false;
311+ static public bool bPrivNest = false;
312+
313+ static public bool b_position;
314+ static public bool b_windowsize;
315+ static public bool b_column;
316+ static public bool b_fontsize;
317+ static public bool b_bold;
318+ static public bool b_filename_caption;
319+
320+ static public int i_position_x;
321+ static public int i_position_y;
322+ static public int i_windowsize_width;
323+ static public int i_windowsize_height;
324+ static public int i_column_0_fillwidth;
325+ static public int i_column_1_fillwidth;
326+ static public int i_column_2_fillwidth;
327+ static public int i_column_3_fillwidth;
328+
329+ static public string s_font;
330+ static public string s_fontstyle;
331+ static public int i_fontsize;
332+ static public int i_current_fontsize;
333+
334+ static public int b_color;
335+ static public uint i_color;
336+ static public uint i_backcolor;
337+ static public uint i_backcolorAlt;
338+ static public uint i_selectcolor;
339+ static public uint i_selectbackcolor;
340+
341+ static public int i_selectencode;
342+ static public bool b_selectencode;
343+
344+ }
345+
346+ // 行ヘッダーに行番号を書くコールバックルーチン
347+ void putLineNumber(object sender, DataGridViewRowPostPaintEventArgs e)
348+ {
349+
350+ // 行番号描画領域の設定
351+ Rectangle rect = new Rectangle(
352+ e.RowBounds.Location.X,
353+ e.RowBounds.Location.Y,
354+ dataGridView1.RowHeadersWidth - 4,
355+ e.RowBounds.Height);
356+
357+ // 行番号の描画
358+ TextRenderer.DrawText(
359+ e.Graphics,
360+ (e.RowIndex + 1).ToString(),
361+ dataGridView1.RowHeadersDefaultCellStyle.Font,
362+ rect,
363+ dataGridView1.RowHeadersDefaultCellStyle.ForeColor,
364+ TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
365+ }
366+
367+
368+ //セルコンテンツクリック コールバックルーチン
369+ protected void OnCellContentClick(object sender, DataGridViewCellEventArgs args)
370+ {
371+ CellSelect(sender, args, "CellContentClick");
372+ }
373+
374+ // http://d.hatena.ne.jp/gsf_zero1/20070323/p2
375+ void CellSelect(object sender, DataGridViewCellEventArgs args, string boxTitle)
376+ {
377+
378+ DataGridView g = sender as DataGridView;
379+
380+ if (g != null)
381+ {
382+ int col = args.ColumnIndex; // 列
383+ int row = args.RowIndex; // 行
384+
385+ if (row == -1) // header
386+ {
387+ // ヘッダーをクリックしたら編集モードを終了させる。
388+ dataGridView1.EndEdit();
389+
390+ switch (col)
391+ {
392+ case 0: // 一括コメント化
393+ {
394+ int selectedCount = dataGridView1.Rows.GetRowCount(DataGridViewElementStates.Selected);
395+ bool bCheck = false;
396+
397+ // 現在選択されている行の最初に選んだ行のチェック状態を取得する。
398+ if (selectedCount > 0)
399+ {
400+ if (dataGridView1.SelectedRows[0].Cells[0] != null)
401+ {
402+ bCheck = !(bool)(dataGridView1.SelectedRows[0].Cells[0].Value);
403+
404+ // 逆にする。
405+ for (int i = 0; i < selectedCount; i++)
406+ {
407+ int index = dataGridView1.SelectedRows[i].Index;
408+ dataGridView1.BeginEdit(false);
409+ this.dataGridView1[0, index].Value = bCheck;
410+ dataGridView1.EndEdit();
411+ }
412+ }
413+ }
414+ }
415+ break;
416+/*
417+ case 2: // LString
418+ if (dataGridView1.Columns[2].Width == 16) // 右辺
419+ {
420+ dataGridView1.Columns[2].Width = 50; // 左辺
421+ }
422+ else
423+ {
424+ dataGridView1.Columns[2].Width = 16; // 左辺
425+ }
426+ break;
427+ case 3: // RString
428+ if (dataGridView1.Columns[3].Width == 16)
429+ {
430+ dataGridView1.Columns[3].Width = 50; // 右辺
431+ }
432+ else
433+ {
434+ dataGridView1.Columns[3].Width = 16;
435+ }
436+ break;
437+*/
438+ default:
439+ break;
440+ }
441+ }
442+
443+ if (col >= 0 && row >= 0) // header以外
444+ {
445+ //dataGridView1.BeginEdit(false);
446+ //toolStripStatusLabel_debug.Text = string.Format("y row:{0}, x col:{1}, 値:{2}, {3}", row, col, g[col, row].Value, boxTitle);
447+ }
448+ }
449+ }
450+
451+
452+ // 引数から dot.nodoka ファイルのパスを取得する
453+ private static string get_arg()
454+ {
455+ string[] cmds;
456+ cmds = System.Environment.GetCommandLineArgs();
457+
458+ string file_name = string.Empty;
459+ if (cmds.Length >= 2)
460+ {
461+ file_name = cmds[1];
462+ }
463+
464+ return file_name;
465+ }
466+
467+
468+ // 指定されたファイルを読み取り、GridDataViewに入れる。
469+ public bool read_dotnodoka(string file_name, Encoding encode, bool read_only)
470+ {
471+ Global_Val.bPrivNest = false;
472+
473+ if (file_name == string.Empty)
474+ {
475+ // ファイル名指定が無かったので、新規ファイルとする。
476+ this.toolStripStatusLabel_FileName.Text = "new_file.nodoka";
477+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit new_file.nodoka" : "のどかGuiEdit";
478+
479+ // その場合、encodeがnullならば、本来自動認識だが、新規の場合は空っぽなのでシステムデフォルトにする。
480+ if (encode == null)
481+ {
482+ Global_Val.fileCode = Encoding.GetEncoding(0); // System Default
483+ }
484+ else
485+ {
486+ Global_Val.fileCode = encode;
487+ }
488+
489+ setEncodingName(Global_Val.fileCode.CodePage, Global_Val.fileCode.EncodingName);
490+
491+ if (read_only == true)
492+ {
493+ Global_Val.b_readonly = true;
494+ toolStripStatusReadOnly.Text = "読み取り専用";
495+ }
496+ else
497+ {
498+ Global_Val.b_readonly = false;
499+ toolStripStatusReadOnly.Text = String.Empty;
500+ }
501+
502+ dataGridView1[1, 0].Selected = true;
503+ dataGridView1.CurrentCell = dataGridView1[1, 0];
504+ //dataGridView1.BeginEdit(false);
505+ return false;
506+ }
507+ else
508+ {
509+ // ファイルの存在を確認する。無い場合はエラーダイアログを出して抜ける。
510+ if (!File.Exists(file_name))
511+ {
512+ MessageBox.Show("指定したファイルが見つかりません。\n" + file_name, "のどかGuiEdit", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
513+ return false;
514+ }
515+
516+ // 存在する場合は、read onlyか調べて、フラグを立てる。
517+ FileAttributes attributes = File.GetAttributes(file_name);
518+
519+ if ((attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly || read_only == true)
520+ {
521+ Global_Val.b_readonly = true;
522+ toolStripStatusReadOnly.Text = "読み取り専用";
523+ }
524+ else
525+ {
526+ Global_Val.b_readonly = false;
527+ toolStripStatusReadOnly.Text = String.Empty;
528+ }
529+ }
530+
531+ try
532+ {
533+ // ファイル名指定があり、encodeがnullもしくはシステムデフォルトであった場合自動認識にトライする。
534+ detectencode fileEnc = new detectencode();
535+ if (encode == null || encode == Encoding.Default)
536+ {
537+ Global_Val.fileCode = fileEnc.DetectFileEncoding(file_name);
538+ }
539+ else
540+ {
541+ Global_Val.fileCode = encode;
542+ }
543+
544+ setEncodingName(Global_Val.fileCode.CodePage, Global_Val.fileCode.EncodingName);
545+
546+ // ファイルリード
547+ string[] nodokaLine = File.ReadAllLines(file_name, Global_Val.fileCode);
548+ int nodokaLineCount = nodokaLine.Length;
549+
550+ // dataGridViewに格納する際の変数を準備する。
551+ string stringCaption;
552+ string stringLeft;
553+ string stringRight;
554+ bool check_comment;
555+ bool bCaptionOnly;
556+
557+ for (int i = 1; i <= nodokaLineCount; i++) // 1行ずつ最後まで
558+ {
559+ // 初期化
560+ stringCaption = string.Empty;
561+ stringLeft = string.Empty;
562+ stringRight = string.Empty;
563+ check_comment = false;
564+ bCaptionOnly = false;
565+
566+ // targetStringに代入
567+ // 代入する際 Tabはスペースに置き換える。
568+ // targetStringは基本的にはそれ以上改変しないオリジナル。
569+ string targetString = convTab2SP(nodokaLine[i - 1]);
570+ string tmpCaption = string.Empty;
571+
572+
573+ // コメント行を見つける。
574+ // 行頭の#の有無
575+
576+ // targetStringのうち (),"",//に囲まれた # =を除外して testStringに入れる。
577+ // testStringは区切り検索用の文字列
578+ string testString = convDouble2aster(targetString);
579+
580+ // caption onlyを探す
581+
582+ if (testString.StartsWith(" #") || testString.StartsWith("# #"))
583+ {
584+ bCaptionOnly = true;
585+ stringCaption = targetString.Substring(3);
586+
587+ if (testString.StartsWith("#"))
588+ {
589+ check_comment = true;
590+ }
591+ goto terminate;
592+ }
593+
594+ // testStringの行頭の空白を取り除いたものをcommentcheckに代入
595+ string commentcheck = testString.TrimStart(null);
596+
597+ // # だったらコメント文
598+ if (commentcheck.StartsWith("#"))
599+ {
600+ // この行はコメントアウトされている。
601+ check_comment = true;
602+
603+ // 行頭の残りの文のみにする。なお行頭の続いた#はすべて削除される。
604+ testString = testString.TrimStart(null).TrimStart('#');
605+ targetString = targetString.TrimStart(null).TrimStart('#');
606+
607+ // コメント行で有った場合、キャプション候補として取っておく。
608+ tmpCaption = targetString; // とりあえずキャプションと考える。
609+ }
610+
611+ // コメント行で無かった場合
612+ // testString,targetStringのいずれも、読み込んだ1行そのまま
613+ // tmpCaption は Emptyである。
614+
615+
616+ // 2個めのコメント(キャプション)を探す
617+
618+ // #があるかどうか探す。
619+ // 検索用文字列 testStringから #を探す。
620+ int foundIndex = testString.IndexOf('#');
621+ if (foundIndex > 0)
622+ {
623+ //2個目があったのでtmpCaptionに代入しキャプションにする。
624+ tmpCaption = targetString.Substring(foundIndex);
625+ tmpCaption = tmpCaption.TrimStart('#');
626+
627+ //1個目から、2個目を切り取り、機能記述部位をtargetString, testStringに取り出す。
628+ // Lengthが1未満だと切れない。
629+ Debug.WriteLine("tmpCaption\"" + tmpCaption + "\"," + " tmpString\"" + targetString + "\"");
630+
631+ if (targetString.Length != 0)
632+ {
633+ int tmpLength = targetString.Length;
634+ if (tmpLength > 1)
635+ {
636+ //tmpString = tmpString.Substring(0, tmpString.Length - foundIndex - 1);
637+ targetString = targetString.Substring(0, foundIndex - 1);
638+ testString = testString.Substring(0, foundIndex - 1);
639+ Debug.WriteLine("Length:" + tmpLength.ToString() + "Index:" + foundIndex.ToString() + "String\"" + targetString + "\"");
640+ Debug.Flush();
641+ }
642+ targetString = targetString.TrimEnd('#').TrimEnd(null);
643+ testString = testString.TrimEnd('#').TrimEnd(null);
644+ }
645+ }
646+ else
647+ {
648+ // 2個目のコメントが無かったので tmpCapsionはクリアする。
649+ tmpCaption = string.Empty;
650+
651+ // コメント行でなく、キャプションが無い場合で、文末に\があった場合、ネスト行フラグを立てる。
652+ // コメント行だった場合は、継続させる。
653+
654+ string checknest = testString.TrimEnd(null);
655+ if (check_comment != true)
656+ {
657+ if (checknest.EndsWith("\\"))
658+ {
659+ Global_Val.bNest = true;
660+ }
661+ else
662+ {
663+ Global_Val.bNest = false;
664+ }
665+ }
666+ }
667+
668+ // コマンド文の処理
669+ // captionは tmpCaptionで決定
670+ stringCaption = tmpCaption;
671+
672+ // targetStringを左右(stringLeft, stringRight)に分ける。
673+ if (Global_Val.bPrivNest != true)
674+ {
675+ if (targetString.Length != 0)
676+ {
677+ // targetStringを '='にて左右に切り分ける。
678+ int LRIndex = testString.IndexOf('=');
679+ if (LRIndex >= 0) // 一つ以上存在した場合
680+ {
681+ //2個目をstringRに入れる。
682+ stringRight = targetString.Substring(LRIndex);
683+ stringRight = stringRight.TrimStart(null).TrimEnd(null);
684+
685+ //1個目から、2個目を切り取る
686+ // Lengthが1未満だと切れない。
687+ //Debug.WriteLine("tmpCaption\"" + tmpCaption + "\"," + " tmpString\"" + tmpString + "\"");
688+ int tmpLength = targetString.Length;
689+ if (tmpLength > 1)
690+ {
691+ stringLeft = targetString.Substring(0, LRIndex);// - 1);
692+ }
693+ stringLeft = stringLeft.TrimEnd('#');
694+ }
695+ else
696+ {
697+ // ':' を探す
698+ LRIndex = testString.IndexOf(':');
699+ if (LRIndex >= 0)
700+ {
701+ //2個目をstringRに入れる。
702+ stringRight = targetString.Substring(LRIndex);
703+ stringRight = stringRight.TrimStart(null).TrimEnd(null);
704+
705+ //1個目から、2個目を切り取る
706+ // Lengthが1未満だと切れない。
707+ //Debug.WriteLine("tmpCaption\"" + tmpCaption + "\"," + " tmpString\"" + tmpString + "\"");
708+ int tmpLength = targetString.Length;
709+ if (tmpLength > 1)
710+ {
711+ stringLeft = targetString.Substring(0, LRIndex);// - 1);
712+ }
713+ stringLeft = stringLeft.TrimEnd('#');
714+ }
715+ else
716+ {
717+ // '='も':'も無かった。
718+ // もし現在のキャプションと targetStringが一致しなければ
719+ // 漏れるのでstringLに入れる。
720+ if (tmpCaption != targetString)
721+ {
722+ stringLeft = targetString;
723+ }
724+ }
725+ }
726+ }
727+ }
728+ else
729+ {
730+ // ネストしている行なので、Rに入れる。
731+ stringRight = targetString;
732+ }
733+ terminate:
734+ this.dataGridView1.Rows.Add(check_comment, stringCaption, stringLeft, stringRight);
735+ Global_Val.bPrivNest = Global_Val.bNest; // 継続行情報のアップデイト
736+ }
737+ }
738+ catch (Exception e)
739+ {
740+ // Let the user know what went wrong.
741+ Debug.WriteLine(e.StackTrace);
742+ Debug.WriteLine(e.TargetSite);
743+ Debug.WriteLine(e.InnerException);
744+ MessageBox.Show(e.Message, "のどかGuiEdit Error"); // ファイルが見つからないとここでエラーとなるが何もしない。
745+ this.toolStripStatusLabel_FileName.Text = "new_file.nodoka";
746+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit new_file.nodoka" : "のどかGuiEdit";
747+ if (Global_Val.fileCode == null)
748+ {
749+ Global_Val.fileCode = Encoding.GetEncoding(0);
750+ }
751+ setEncodingName(Global_Val.fileCode.CodePage, Global_Val.fileCode.EncodingName);
752+
753+ return false;
754+ }
755+
756+ this.toolStripStatusLabel_FileName.Text = file_name;
757+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit " + file_name : "のどかGuiEdit";
758+ setEncodingName(Global_Val.fileCode.CodePage, Global_Val.fileCode.EncodingName);
759+
760+ return true;
761+ }
762+
763+ private void setEncodingName(int CodePage, string defaultString)
764+ {
765+ String myEncodingName = String.Empty;
766+ switch (CodePage)
767+ {
768+ case 932:
769+ myEncodingName = "シフトJIS";
770+ break;
771+ case 20127:
772+ myEncodingName = "ASCII";
773+ break;
774+ case 65001:
775+ myEncodingName = "UTF-8 LE";
776+ break;
777+ case 1200:
778+ myEncodingName = "UTF-16 LE";
779+ break;
780+ case 1201:
781+ myEncodingName = "UTF-16 BE";
782+ break;
783+ default:
784+ myEncodingName = defaultString;
785+ break;
786+ }
787+ this.toolStripStatusLabel_encode.Text = myEncodingName;
788+ }
789+
790+ // 正規表現による検索
791+ private string convDouble2aster(string inputString)
792+ {
793+ string outputString;
794+
795+ // Regexの定義
796+ Regex r0 = new Regex(@"\(.*?\)"); // ( )
797+ Regex r1 = new Regex(@"\[.*?\]"); // [ ]
798+ Regex r2 = new Regex(@"/.*?/"); // / /
799+ Regex r3 = new Regex(@""".*?"""); // " "
800+ Regex r4 = new Regex(@"'.*?'"); // ' '
801+
802+ // todo: \m@ @ には対応していない。
803+
804+ // MatchEvaluatorの定義
805+ MatchEvaluator myEvaluator = new MatchEvaluator(ReplaceAster);
806+
807+ outputString = r0.Replace(inputString, ReplaceAster);
808+ outputString = r1.Replace(outputString, ReplaceAster);
809+ outputString = r2.Replace(outputString, ReplaceAster);
810+ outputString = r3.Replace(outputString, ReplaceAster);
811+ outputString = r4.Replace(outputString, ReplaceAster);
812+
813+ return outputString;
814+ }
815+
816+ // 正規表現によるマッチした部分を*に変換する。
817+ private static string ReplaceAster(Match m)
818+ {
819+ string retStr = new String('*', m.Length);
820+ return retStr;
821+ }
822+
823+
824+ private static string convTab2SP(string inputString)
825+ {
826+ Debug.WriteLine(inputString);
827+
828+ // tabを空白に置き換える。理由はDataGridViewではTabは扱えないから。
829+ int nTab = 8;
830+ int tmpStringLength = inputString.Length;
831+ int currentLength;
832+ int modTab;
833+ string tmpSP;
834+ int countTabs;
835+ int i;
836+ string outputString = String.Empty;
837+
838+ // 一つ以上でも\tが有った場合
839+ if (inputString.IndexOf("\t") >= 0)
840+ {
841+ i = 1;
842+ // \tでsplitする。
843+ string[] splitTabs = inputString.Split('\t');
844+ countTabs = splitTabs.Length;
845+ foreach (string splitTab in splitTabs)
846+ {
847+ currentLength = (outputString + splitTab).Length;
848+ modTab = nTab - (currentLength % nTab);
849+ tmpSP = String.Empty;
850+ if (i != countTabs)
851+ {
852+ tmpSP = new String(' ', modTab);
853+ }
854+ outputString += splitTab + tmpSP;
855+ i++;
856+ }
857+ }
858+ else
859+ {
860+ outputString = inputString;
861+ }
862+
863+ Debug.WriteLine(outputString);
864+ return outputString;
865+ }
866+
867+
868+ // ファイル出力
869+ public bool write_dotnodoka(string file_name, Encoding encode)
870+ {
871+ if (file_name == String.Empty)
872+ {
873+ return false;
874+ }
875+
876+ this.dataGridView1.EndEdit(); // 編集終了状態にする。
877+
878+ try
879+ {
880+ if (encode == null)
881+ {
882+ encode = Encoding.GetEncoding(0); // System Default
883+ Global_Val.fileCode = encode;
884+ }
885+ if (Global_Val.i_selectencode == 0) // System Default
886+ {
887+ encode = Global_Val.fileCode; // System Defaultであった場合、実際のエンコードにする。
888+ }
889+
890+ // backupを作成する。
891+ string randomname = System.IO.Path.GetRandomFileName();
892+ System.IO.File.Copy(@file_name, @file_name + "." + randomname + "-bak.nodoka", true);
893+ }
894+
895+ catch (Exception e)
896+ {
897+ // 新規の場合などでも、ここでエラーとなるので、特に何もしない。
898+ // 例えば Save Asで、バックアップ作成に失敗してもそうなる。
899+ }
900+
901+ try
902+ {
903+ using (StreamWriter sw = new StreamWriter(file_name, false, encode))
904+ {
905+ int i;
906+ //this.dataGridView1.AllowUserToAddRows = false;
907+ int y = this.dataGridView1.RowCount - 1; // 行数
908+ int x = this.dataGridView1.ColumnCount - 1; // カラム数
909+ string oneLine = string.Empty;
910+ for (i = 0; i < y; i++)
911+ {
912+ oneLine = GetOneLine(i, x);
913+ sw.WriteLine(oneLine);
914+ }
915+ sw.Flush();
916+ sw.Close();
917+ }
918+ }
919+ catch (Exception e)
920+ {
921+ // Let the user know what went wrong.
922+ MessageBox.Show(string.Format("{0}, {1}, {2}, {3}", Global_Val.i, Global_Val.j, Global_Val.tmpString, e.Message), "dot.nodoka Editor");
923+ this.dataGridView1.AllowUserToAddRows = true;
924+ return false;
925+ }
926+
927+ Global_Val.fileCode = encode;
928+ setEncodingName(Global_Val.fileCode.CodePage, Global_Val.fileCode.EncodingName);
929+
930+ this.dataGridView1.AllowUserToAddRows = true;
931+ return true;
932+ }
933+
934+ private string GetOneLine(int lineNum, int maxColumn)
935+ {
936+ string oneLine = string.Empty; // 初期化
937+ Global_Val.i = lineNum;
938+ //Global_Val.j = currentColumn;
939+ string Caption = string.Empty;
940+ string Lstring = string.Empty;
941+ string Rstring = string.Empty;
942+ bool bCaptionOnly = false;
943+ bool bComment = false;
944+
945+
946+ // comment flag
947+ if (this.dataGridView1[0, lineNum].Value != null)
948+ {
949+ //Global_Val.tmpString = this.dataGridView1[0, lineNum].Value.ToString();
950+ if ((bool)this.dataGridView1[0, lineNum].Value) // comment line
951+ {
952+ bComment = true;
953+ oneLine = "#";
954+ }
955+ }
956+
957+ // Caption, Lstring, Rstring取得
958+ if (this.dataGridView1[1, lineNum].Value != null)
959+ {
960+ Caption = this.dataGridView1[1, lineNum].Value.ToString();
961+ }
962+
963+ if (this.dataGridView1[2, lineNum].Value == null && this.dataGridView1[3, lineNum].Value == null)
964+ {
965+ bCaptionOnly = true;
966+ }
967+ else
968+ {
969+ if (this.dataGridView1[2, lineNum].Value != null)
970+ {
971+ Lstring = this.dataGridView1[2, lineNum].Value.ToString();
972+ }
973+
974+ if (this.dataGridView1[3, lineNum].Value != null)
975+ {
976+ Rstring = this.dataGridView1[3, lineNum].Value.ToString();
977+ }
978+ }
979+
980+ // セルが存在するが中身がNULLのケースがあるので、それもCaptionOnlyとする。
981+ if (Lstring == String.Empty && Rstring == String.Empty)
982+ {
983+ bCaptionOnly = true;
984+ }
985+
986+ if (bCaptionOnly == false)
987+ {
988+ oneLine += Lstring + Rstring;
989+
990+ if (string.Compare(Caption, string.Empty) != 0) // captionがあるとき
991+ {
992+ if (oneLine.Length < 71 && oneLine.Length > 1) // 72-1文字になるよう空白を補う。
993+ {
994+ oneLine += new String(' ', 71 - oneLine.Length);
995+ }
996+ oneLine += " #";
997+ oneLine += Caption; // captionを付ける。
998+ }
999+ }
1000+ else
1001+ {
1002+ if (bComment == true)
1003+ {
1004+ oneLine = "# #" + Caption; // # #captionにする。
1005+ }
1006+ else
1007+ {
1008+ oneLine = " #" + Caption; // #captionnにする。
1009+ }
1010+ }
1011+
1012+ Debug.WriteLine(lineNum.ToString() + ":" + oneLine);
1013+ return oneLine;
1014+ }
1015+
1016+
1017+ private void DataGridView1_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
1018+ {
1019+ //セルの既定値を指定する
1020+ e.Row.Cells[0].Value = false;
1021+ e.Row.Cells[1].Value = string.Empty;
1022+ e.Row.Cells[2].Value = string.Empty;
1023+ e.Row.Cells[3].Value = string.Empty;
1024+ }
1025+
1026+
1027+ private void OpenOToolStripMenuItem_Click(object sender, EventArgs e)
1028+ {
1029+ // もし未保存状態なら、続行してもよいか聞く。保存ダイアログまでは出さない。
1030+ if (Global_Val.bSaved == false)
1031+ {
1032+ if(DialogResult.Cancel == MessageBox.Show("現在編集中のファイルは保存されていませんが、続行しますか?", "のどかGuiEdit",
1033+ MessageBoxButtons.OKCancel,
1034+ MessageBoxIcon.Exclamation,
1035+ MessageBoxDefaultButton.Button1))
1036+ {
1037+ return;
1038+ }
1039+ }
1040+
1041+ if (isXP() == true)
1042+ {
1043+ // File Open Dialog
1044+ string file_name;
1045+
1046+ OpenFileDialog OF_Dialog = new OpenFileDialog();
1047+ OF_Dialog.FileName = string.Empty;
1048+ OF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
1049+ OF_Dialog.Filter =
1050+ "nodokaファイル(*.nodoka;*.mayu)|*.nodoka;*.mayu|すべてのファイル(*.*)|*.*";
1051+ OF_Dialog.FilterIndex = 1;
1052+ OF_Dialog.Title = "開くファイルを選択してください";
1053+ OF_Dialog.RestoreDirectory = true;
1054+ OF_Dialog.CheckFileExists = true;
1055+ OF_Dialog.CheckPathExists = true;
1056+
1057+ OF_Dialog.AutoUpgradeEnabled = true;
1058+ OF_Dialog.CustomPlaces.Add(Environment.GetEnvironmentVariable("NODOKA"));
1059+ OF_Dialog.CustomPlaces.Add(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
1060+ OF_Dialog.CustomPlaces.Add(readRegNodokaDir());
1061+
1062+ if (OF_Dialog.ShowDialog() == DialogResult.OK)
1063+ {
1064+ // file name取得
1065+ file_name = OF_Dialog.FileName;
1066+
1067+ // dataGridViewの初期化
1068+ this.dataGridView1.Rows.Clear();
1069+
1070+ // File Read 呼び出し
1071+ read_dotnodoka(file_name, encodes[Global_Val.i_selectencode], false);
1072+ dataGridView1[1, 0].Selected = true;
1073+ dataGridView1.CurrentCell = dataGridView1[1, 0];
1074+ }
1075+
1076+ }
1077+ else
1078+ {
1079+ /*
1080+ // File Open Dialog
1081+ string file_name;
1082+ Encoding encode = null;
1083+
1084+ CommonOpenFileDialog OF_Dialog = new CommonOpenFileDialog();
1085+
1086+ //文字コード選択コンボボックス
1087+ CommonFileDialogComboBox charset = new CommonFileDialogComboBox();
1088+
1089+ //文字コード追加
1090+ Encoding[] encodes = { Encoding.GetEncoding(0), // system default
1091+ Encoding.GetEncoding(932), // SHIFT-JIS
1092+ Encoding.ASCII, // US-ASCII
1093+ Encoding.UTF8, // UTF8 LE
1094+ Encoding.Unicode, // UTF16 LE
1095+ Encoding.BigEndianUnicode // UTF16 BE
1096+ };
1097+
1098+ foreach (var item in encodes)
1099+ {
1100+ charset.Items.Add(new CommonFileDialogComboBoxItem(item.EncodingName));
1101+ }
1102+
1103+ //トップを選択
1104+ charset.SelectedIndex = 0;
1105+
1106+ //ダイアログに追加
1107+ OF_Dialog.Controls.Add(charset);
1108+
1109+ OF_Dialog.DefaultFileName = string.Empty;
1110+ OF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
1111+ OF_Dialog.Title = "開くファイルを選択してください";
1112+ OF_Dialog.RestoreDirectory = true;
1113+ OF_Dialog.EnsureFileExists = true;
1114+ OF_Dialog.EnsurePathExists = true;
1115+
1116+
1117+ ShellContainer Place = KnownFolders.DocumentsLibrary as ShellContainer;
1118+ OF_Dialog.AddPlace(Place, FileDialogAddPlaceLocation.Top);
1119+
1120+ string NODOKA = Environment.GetEnvironmentVariable("NODOKA");
1121+ if (NODOKA != null)
1122+ {
1123+ OF_Dialog.AddPlace(NODOKA, FileDialogAddPlaceLocation.Bottom);
1124+ }
1125+ OF_Dialog.AddPlace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), FileDialogAddPlaceLocation.Bottom);
1126+ string NODOKAreg = readRegNodokaDir();
1127+ if (NODOKAreg != null)
1128+ {
1129+ OF_Dialog.AddPlace(NODOKAreg, FileDialogAddPlaceLocation.Top);
1130+ }
1131+
1132+
1133+ // Add selection filters.
1134+ OF_Dialog.Filters.Add(new CommonFileDialogFilter("nodokaファイル", ".nodoka,.mayu"));
1135+ OF_Dialog.Filters.Add(new CommonFileDialogFilter("すべてのファイル", "*.*"));
1136+
1137+ if (OF_Dialog.ShowDialog() == CommonFileDialogResult.Ok)
1138+ {
1139+ // file nameと文字コード取得
1140+ file_name = OF_Dialog.FileName;
1141+ encode = encodes[charset.SelectedIndex];
1142+
1143+ // dataGridViewの初期化
1144+ this.dataGridView1.Rows.Clear();
1145+
1146+ // File Read 呼び出し
1147+ read_dotnodoka(file_name, encode);
1148+ }
1149+ */
1150+ }
1151+ }
1152+
1153+ private static bool isXP()
1154+ {
1155+ return true;
1156+ /*
1157+ System.OperatingSystem os = System.Environment.OSVersion;
1158+ if (os.Platform == System.PlatformID.Win32NT &&
1159+ os.Version.Major < 6 &&
1160+ os.Version.Minor <= 1)
1161+ {
1162+ MessageBox.Show("XP");
1163+ return true;
1164+ }
1165+
1166+ MessageBox.Show("Vista以降");
1167+ return false;
1168+ */
1169+ }
1170+
1171+ private void NewNToolStripMenuItem_Click(object sender, EventArgs e)
1172+ {
1173+ // もし未保存状態なら、続行してもよいか聞く。保存ダイアログまでは出さない。
1174+ if (Global_Val.bSaved == false)
1175+ {
1176+ if (DialogResult.Cancel == MessageBox.Show("現在編集中のファイルは保存されていませんが、続行しますか?", "のどかGuiEdit",
1177+ MessageBoxButtons.OKCancel,
1178+ MessageBoxIcon.Exclamation,
1179+ MessageBoxDefaultButton.Button1))
1180+ {
1181+ return;
1182+ }
1183+ }
1184+
1185+ // dataGridViewの初期化
1186+ this.dataGridView1.Rows.Clear();
1187+ Global_Val.bSaved = true;
1188+ setFileSaveStatus();
1189+
1190+ Global_Val.b_readonly = false;
1191+ toolStripStatusReadOnly.Text = String.Empty;
1192+
1193+ // file name初期化
1194+ read_dotnodoka(string.Empty, encodes[Global_Val.i_selectencode], false);
1195+ dataGridView1[1, 0].Selected = true;
1196+ dataGridView1.CurrentCell = dataGridView1[1, 0];
1197+ //dataGridView1.BeginEdit(false);
1198+ }
1199+
1200+ private void SaveCToolStripMenuItem_Click(object sender, EventArgs e)
1201+ {
1202+ // file save
1203+ if (this.toolStripStatusLabel_FileName.Text == "new_file.nodoka")
1204+ {
1205+ if (isXP())
1206+ {
1207+ SaveFileDialog SF_Dialog = new SaveFileDialog();
1208+ SF_Dialog.FileName = "new_file.nodoka";
1209+ SF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
1210+ SF_Dialog.Filter = "nodokaファイル(*.nodoka;*.mayu)|*.nodoka;*.mayu|すべてのファイル(*.*)|*.*";
1211+ SF_Dialog.FilterIndex = 1;
1212+ SF_Dialog.AddExtension = true;
1213+ SF_Dialog.Title = "名前を付けて保存";
1214+
1215+ SF_Dialog.AutoUpgradeEnabled = true;
1216+ SF_Dialog.CustomPlaces.Add(Environment.GetEnvironmentVariable("NODOKA"));
1217+ SF_Dialog.CustomPlaces.Add(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
1218+ SF_Dialog.CustomPlaces.Add(readRegNodokaDir());
1219+
1220+ if (SF_Dialog.ShowDialog() == DialogResult.OK)
1221+ {
1222+ string file_name = SF_Dialog.FileName;
1223+ this.toolStripStatusLabel_FileName.Text = file_name;
1224+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit " + file_name : "のどかGuiEdit";
1225+ if (write_dotnodoka(file_name, encodes[Global_Val.i_selectencode]))
1226+ {
1227+ Global_Val.bSaved = true;
1228+ if (Global_Val.b_readonly == true)
1229+ {
1230+ Global_Val.b_readonly = false;
1231+ toolStripStatusReadOnly.Text = String.Empty;
1232+
1233+ }
1234+ }
1235+ else
1236+ {
1237+ Global_Val.bSaved = false;
1238+ }
1239+ setFileSaveStatus();
1240+ }
1241+ }
1242+ else
1243+ {
1244+ /*
1245+ CommonSaveFileDialog SF_Dialog = new CommonSaveFileDialog();
1246+
1247+ //文字コード選択コンボボックス
1248+ CommonFileDialogComboBox charset = new CommonFileDialogComboBox();
1249+
1250+ //文字コード追加
1251+ Encoding[] encodes = { Encoding.GetEncoding(0), // system default
1252+ Encoding.GetEncoding(932), // SHIFT-JIS
1253+ Encoding.ASCII, // US-ASCII
1254+ Encoding.UTF8, // UTF8 LE
1255+ Encoding.Unicode, // UTF16 LE
1256+ Encoding.BigEndianUnicode // UTF16 BE
1257+ };
1258+
1259+ foreach (var item in encodes)
1260+ {
1261+ charset.Items.Add(new CommonFileDialogComboBoxItem(item.EncodingName));
1262+ }
1263+
1264+ //トップを選択
1265+ charset.SelectedIndex = 0;
1266+
1267+ //ダイアログに追加
1268+ SF_Dialog.Controls.Add(charset);
1269+
1270+ SF_Dialog.DefaultFileName = "new_file.nodoka";
1271+ SF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
1272+ SF_Dialog.Title = "名前を付けて保存";
1273+ SF_Dialog.RestoreDirectory = true;
1274+ SF_Dialog.EnsureFileExists = true;
1275+ SF_Dialog.EnsurePathExists = true;
1276+
1277+
1278+ ShellContainer Place = KnownFolders.DocumentsLibrary as ShellContainer;
1279+ SF_Dialog.AddPlace(Place, FileDialogAddPlaceLocation.Top);
1280+
1281+ string NODOKA = Environment.GetEnvironmentVariable("NODOKA");
1282+ if (NODOKA != null)
1283+ {
1284+ SF_Dialog.AddPlace(NODOKA, FileDialogAddPlaceLocation.Bottom);
1285+ }
1286+ SF_Dialog.AddPlace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), FileDialogAddPlaceLocation.Bottom);
1287+ string NODOKAreg = readRegNodokaDir();
1288+ if (NODOKAreg != null)
1289+ {
1290+ SF_Dialog.AddPlace(NODOKAreg, FileDialogAddPlaceLocation.Top);
1291+ }
1292+
1293+
1294+ if (SF_Dialog.ShowDialog() == CommonFileDialogResult.Ok)
1295+ {
1296+ string file_name = SF_Dialog.FileName;
1297+ Encoding encode = encodes[charset.SelectedIndex];
1298+ this.toolStripStatusLabel_FileName.Text = file_name;
1299+ this.Text = file_name;
1300+ this.toolStripStatusLabel_encode.Text = encode.EncodingName;
1301+ write_dotnodoka(file_name, encode);
1302+ Global_Val.bSaved = true;
1303+ }
1304+ */
1305+ }
1306+ }
1307+ else
1308+ {
1309+ // 上書き保存がありうるので、bSavedフラグがfalseであることはチェックしない。
1310+
1311+ // リードオンリーかどうかはチェックする。
1312+ if (Global_Val.b_readonly == true)
1313+ {
1314+ MessageBox.Show("読み取り専用ファイルなので保存できません。", "のどかGuiEdit", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
1315+ return;
1316+ }
1317+ if (write_dotnodoka(this.toolStripStatusLabel_FileName.Text, encodes[Global_Val.i_selectencode]))
1318+ {
1319+ Global_Val.bSaved = true;
1320+ }
1321+ else
1322+ {
1323+ Global_Val.bSaved = false;
1324+ }
1325+ }
1326+ setFileSaveStatus();
1327+ }
1328+
1329+ private void SaveAsWToolStripMenuItem_Click(object sender, EventArgs e)
1330+ {
1331+ if (isXP())
1332+ {
1333+ SaveFileDialog SF_Dialog = new SaveFileDialog();
1334+ SF_Dialog.FileName = Path.GetFileName(this.toolStripStatusLabel_FileName.Text);
1335+ //SF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
1336+ SF_Dialog.InitialDirectory = Path.GetDirectoryName(this.toolStripStatusLabel_FileName.Text);
1337+ SF_Dialog.Filter =
1338+ "nodokaファイル(*.nodoka;*.mayu)|*.nodoka;*.mayu|すべてのファイル(*.*)|*.*";
1339+ SF_Dialog.FilterIndex = 1;
1340+ SF_Dialog.Title = "名前を付けて保存";
1341+
1342+ SF_Dialog.AutoUpgradeEnabled = true;
1343+ SF_Dialog.CustomPlaces.Add(Environment.GetEnvironmentVariable("NODOKA"));
1344+ SF_Dialog.CustomPlaces.Add(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
1345+ SF_Dialog.CustomPlaces.Add(readRegNodokaDir());
1346+
1347+ if (SF_Dialog.ShowDialog() == DialogResult.OK)
1348+ {
1349+ string file_name = SF_Dialog.FileName;
1350+ this.toolStripStatusLabel_FileName.Text = file_name;
1351+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit " + file_name : "のどかGuiEdit";
1352+
1353+ if (write_dotnodoka(file_name, encodes[Global_Val.i_selectencode]))
1354+ {
1355+ Global_Val.bSaved = true;
1356+ if (Global_Val.b_readonly == true)
1357+ {
1358+ Global_Val.b_readonly = false;
1359+ toolStripStatusReadOnly.Text = String.Empty;
1360+
1361+ }
1362+ }
1363+ else
1364+ {
1365+ Global_Val.bSaved = false;
1366+ }
1367+ setFileSaveStatus();
1368+ }
1369+ }
1370+ else
1371+ {
1372+ /*
1373+ CommonSaveFileDialog SF_Dialog = new CommonSaveFileDialog();
1374+
1375+ //文字コード選択コンボボックス
1376+ CommonFileDialogComboBox charset = new CommonFileDialogComboBox();
1377+
1378+ //文字コード追加
1379+ Encoding[] encodes = { Encoding.GetEncoding(0), // system default
1380+ Encoding.GetEncoding(932), // SHIFT-JIS
1381+ Encoding.ASCII, // US-ASCII
1382+ Encoding.UTF8, // UTF8 LE
1383+ Encoding.Unicode, // UTF16 LE
1384+ Encoding.BigEndianUnicode // UTF16 BE
1385+ };
1386+
1387+ foreach (var item in encodes)
1388+ {
1389+ charset.Items.Add(new CommonFileDialogComboBoxItem(item.EncodingName));
1390+ }
1391+
1392+ //トップを選択
1393+ charset.SelectedIndex = 0;
1394+
1395+ //ダイアログに追加
1396+ SF_Dialog.Controls.Add(charset);
1397+
1398+ SF_Dialog.DefaultFileName = Path.GetFileName(this.toolStripStatusLabel_FileName.Text);
1399+ SF_Dialog.InitialDirectory = Path.GetDirectoryName(this.toolStripStatusLabel_FileName.Text);
1400+ SF_Dialog.Title = "名前を付けて保存";
1401+ SF_Dialog.RestoreDirectory = true;
1402+ SF_Dialog.EnsureFileExists = true;
1403+ SF_Dialog.EnsurePathExists = true;
1404+
1405+
1406+ ShellContainer Place = KnownFolders.DocumentsLibrary as ShellContainer;
1407+ SF_Dialog.AddPlace(Place, FileDialogAddPlaceLocation.Top);
1408+
1409+ string NODOKA = Environment.GetEnvironmentVariable("NODOKA");
1410+ if (NODOKA != null)
1411+ {
1412+ SF_Dialog.AddPlace(NODOKA, FileDialogAddPlaceLocation.Bottom);
1413+ }
1414+ SF_Dialog.AddPlace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), FileDialogAddPlaceLocation.Bottom);
1415+ string NODOKAreg = readRegNodokaDir();
1416+ if (NODOKAreg != null)
1417+ {
1418+ SF_Dialog.AddPlace(NODOKAreg, FileDialogAddPlaceLocation.Top);
1419+ }
1420+
1421+
1422+ if (SF_Dialog.ShowDialog() == CommonFileDialogResult.Ok)
1423+ {
1424+ string file_name = SF_Dialog.FileName;
1425+ this.toolStripStatusLabel_FileName.Text = file_name;
1426+ Encoding encode = encodes[charset.SelectedIndex];
1427+ this.toolStripStatusLabel_FileName.Text = file_name;
1428+ this.toolStripStatusLabel_encode.Text = encode.EncodingName;
1429+ write_dotnodoka(file_name, encode);
1430+ Global_Val.bSaved = true;
1431+ setFileSaveStatus();
1432+ }
1433+ */
1434+ }
1435+ }
1436+
1437+ private void ToolStripMenuItemExit_Click(object sender, EventArgs e)
1438+ {
1439+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
1440+
1441+ // 終了時に位置を覚える
1442+ // 現在のウィンドウ位置を保存
1443+ if (Global_Val.b_position)
1444+ {
1445+ rk.SetValue("i_position_x", this.DesktopLocation.X);
1446+ rk.SetValue("i_position_y", this.DesktopLocation.Y);
1447+ }
1448+
1449+ // 現在のウィンドウサイズを保存
1450+ if (Global_Val.b_windowsize)
1451+ {
1452+ rk.SetValue("i_windowsize_width", this.Size.Width);
1453+ rk.SetValue("i_windowsize_height", this.Size.Height);
1454+ }
1455+
1456+ // 現在のカラムサイズを保存
1457+ if (Global_Val.b_column)
1458+ {
1459+ rk.SetValue("i_column_0_fillwidth", (int)this.dataGridView1.Columns[0].FillWeight);
1460+ rk.SetValue("i_column_1_fillwidth", (int)this.dataGridView1.Columns[1].FillWeight);
1461+ rk.SetValue("i_column_2_fillwidth", (int)this.dataGridView1.Columns[2].FillWeight);
1462+ rk.SetValue("i_column_3_fillwidth", (int)this.dataGridView1.Columns[3].FillWeight);
1463+ }
1464+
1465+ // 現在のフォントサイズを保存
1466+ if (Global_Val.b_fontsize)
1467+ {
1468+ rk.SetValue("i_fontsize", (int)this.dataGridView1.DefaultCellStyle.Font.Size);
1469+ }
1470+
1471+ // 現在のフォント名を保存
1472+ rk.SetValue("s_font", (string)this.dataGridView1.DefaultCellStyle.Font.Name.ToString());
1473+
1474+ // 現在のフォントスタイルを保存
1475+ rk.SetValue("s_fontstyle", (string)this.dataGridView1.DefaultCellStyle.Font.Style.ToString());
1476+
1477+ // 文字コード選択情報を保存
1478+ rk.SetValue("i_selectencode", combo_encode.SelectedIndex);
1479+
1480+
1481+ // file save
1482+ DialogResult ret = DialogResult.Cancel;
1483+ setFileSaveStatus();
1484+
1485+ if (Global_Val.bSaved == false)
1486+ {
1487+ if (Global_Val.bAutoSave == false)
1488+ {
1489+ ret = MessageBox.Show(this.toolStripStatusLabel_FileName.Text + "は更新されています。保存しますか?", "のどかGuiEdit",
1490+ MessageBoxButtons.YesNoCancel,
1491+ MessageBoxIcon.Exclamation,
1492+ MessageBoxDefaultButton.Button1);
1493+
1494+ switch (ret)
1495+ {
1496+ case DialogResult.Yes:
1497+ SaveCToolStripMenuItem_Click(sender, e);
1498+ Global_Val.bSaved = true;
1499+ Global_Val.bSystemClose = false;
1500+ this.Close();
1501+ break;
1502+ case DialogResult.No:
1503+ Global_Val.bSystemClose = false;
1504+ this.Close();
1505+ break;
1506+ case DialogResult.Cancel:
1507+ default:
1508+ Global_Val.bSystemClose = true;
1509+ setFileSaveStatus();
1510+ return;
1511+ }
1512+ }
1513+ else
1514+ {
1515+ SaveCToolStripMenuItem_Click(sender, e);
1516+ Global_Val.bSaved = true;
1517+ Global_Val.bSystemClose = false;
1518+ this.Close();
1519+ }
1520+ }
1521+ // close
1522+ Global_Val.bSystemClose = false;
1523+ this.Close();
1524+ }
1525+
1526+ private void PrintAToolStripMenuItem_Click(object sender, EventArgs e)
1527+ {
1528+ System.Drawing.Printing.PrintDocument PrintDoc = new System.Drawing.Printing.PrintDocument();
1529+ PrintDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
1530+
1531+ PrintDialog PD_Dialog = new PrintDialog();
1532+ PD_Dialog.Document = PrintDoc;
1533+
1534+ if (PD_Dialog.ShowDialog() == DialogResult.OK)
1535+ {
1536+ PrintDoc.Print();
1537+ }
1538+ }
1539+
1540+ private void PrintDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
1541+ {
1542+ float linesPerPage = 0;
1543+ float leftMargin = e.MarginBounds.Left;
1544+ float topMargin = e.MarginBounds.Top;
1545+ String line = null;
1546+ Font printFont = this.dataGridView1.Font;
1547+
1548+ // Calculate the number of lines per page.
1549+ linesPerPage = e.MarginBounds.Height / printFont.GetHeight(e.Graphics);
1550+
1551+ // Iterate over the file, printing each line.
1552+ //while (count < linesPerPage && ((line = streamToPrint.ReadLine()) != null))
1553+ //{
1554+ // yPos = topMargin + (count * printFont.GetHeight(e.Graphics));
1555+ // e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, new StringFormat());
1556+ // count++;
1557+ //}
1558+
1559+ // If more lines exist, print another page.
1560+ if (line != null)
1561+ {
1562+ e.HasMorePages = true;
1563+ }
1564+ else
1565+ {
1566+ e.HasMorePages = false;
1567+ }
1568+ }
1569+
1570+ private void UnDoUToolStripMenuItem_Click(object sender, EventArgs e)
1571+ {
1572+
1573+ }
1574+
1575+ private void CutCToolStripMenuItem_Click(object sender, EventArgs e)
1576+ {
1577+ // todo undo対応
1578+ // セル選択が無ければ抜ける。行選択時でも問題なし
1579+ if (dataGridView1.CurrentCell == null)
1580+ {
1581+ return;
1582+ }
1583+
1584+ // 選択されたセルが存在する場合、含まれる行を選択済にする。
1585+ foreach (DataGridViewCell cells in dataGridView1.SelectedCells)
1586+ {
1587+ if (!dataGridView1.Rows[cells.RowIndex].IsNewRow) // 新規行を除く
1588+ {
1589+ dataGridView1.Rows[cells.RowIndex].Selected = true;
1590+ }
1591+ }
1592+
1593+ // クリップボードに選択されている行をコピーする。
1594+ Clipboard.SetDataObject(dataGridView1.GetClipboardContent());
1595+
1596+ // 選択行をdeleteする。
1597+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
1598+ {
1599+ if (!raws.IsNewRow) // 新規行は除く
1600+ {
1601+ dataGridView1.Rows.Remove(raws);
1602+ }
1603+ }
1604+ }
1605+
1606+ private void CopyCToolStripMenuItem_Click(object sender, EventArgs e)
1607+ {
1608+ // todo undo対応
1609+
1610+ // セル選択が無ければ抜ける。行選択時でも問題なし
1611+ if (dataGridView1.CurrentCell == null)
1612+ {
1613+ return;
1614+ }
1615+
1616+ // 選択されたセルが存在する場合、含まれる行を選択済にする。
1617+ foreach (DataGridViewCell cells in dataGridView1.SelectedCells)
1618+ {
1619+ if (!dataGridView1.Rows[cells.RowIndex].IsNewRow) // 新規行を除く
1620+ {
1621+ dataGridView1.Rows[cells.RowIndex].Selected = true;
1622+ }
1623+ }
1624+
1625+ Clipboard.SetDataObject(dataGridView1.GetClipboardContent());
1626+ }
1627+
1628+ private void PastePToolStripMenuItem_Click(object sender, EventArgs e)
1629+ {
1630+ // 現在選択されている行がある場合
1631+ // かつバッファに行データがある場合
1632+ // バッファの中身を挿入する
1633+
1634+ // todo undo対応
1635+
1636+ // セル選択が無ければ抜ける。行選択時でも問題なし
1637+ if (dataGridView1.CurrentCell == null)
1638+ {
1639+ return;
1640+ }
1641+
1642+ // 選択されたセルが存在する場合、含まれる行を選択済にする。
1643+ foreach (DataGridViewCell cells in dataGridView1.SelectedCells)
1644+ {
1645+ //if (!dataGridView1.Rows[cells.RowIndex].IsNewRow) // 新規行を除く
1646+ {
1647+ dataGridView1.Rows[cells.RowIndex].Selected = true;
1648+ }
1649+ }
1650+
1651+ // 現在選択行があった場合、一番若い行番号を取得する
1652+ int firstLine = 32768;
1653+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
1654+ {
1655+ if(raws.Index < firstLine)
1656+ {
1657+ firstLine = raws.Index;
1658+ }
1659+ }
1660+ if (firstLine < 32768) // 選択行があった
1661+ {
1662+ // clip boardのデータ取得
1663+ string pasteData = Clipboard.GetText();
1664+
1665+ if (string.IsNullOrEmpty(pasteData))
1666+ {
1667+ // clip boardが空っぽだったので抜ける。
1668+ return;
1669+ }
1670+
1671+ // 改行コードを\nにして、改行で分割する。
1672+ pasteData = pasteData.Replace("\r\n", "\n");
1673+ pasteData = pasteData.Replace('\r', '\n');
1674+ pasteData = pasteData.TrimEnd(new char[] { '\n' });
1675+ string[] lines = pasteData.Split('\n');
1676+
1677+ // linesの処理
1678+ foreach (string line in lines)
1679+ {
1680+ string [] cells = line.Split('\t');
1681+ int cells_max = cells.Length;
1682+
1683+ bool check_comment = false;
1684+ string stringCaption = String.Empty;
1685+ string stringLeft = String.Empty;
1686+ string stringRight = String.Empty;
1687+
1688+ for (int i = 0; i < cells_max; i++)
1689+ {
1690+ switch (i)
1691+ {
1692+ case 0:
1693+ if (cells[0] == "True")
1694+ {
1695+ check_comment = true;
1696+ }
1697+ else
1698+ {
1699+ check_comment = false;
1700+ }
1701+ break;
1702+ case 1:
1703+ stringCaption = cells[1];
1704+ break;
1705+ case 2:
1706+ stringLeft = cells[2];
1707+ break;
1708+ case 3:
1709+ stringRight = cells[3];
1710+ break;
1711+ default:
1712+ break;
1713+ }
1714+ }
1715+
1716+ // 挿入
1717+ dataGridView1.Rows.Insert(firstLine, 1); // 1行追加
1718+ DataGridViewRow row = dataGridView1.Rows[firstLine];
1719+ row.Cells[0].Value = check_comment;
1720+ row.Cells[1].Value = stringCaption;
1721+ row.Cells[2].Value = stringLeft;
1722+ row.Cells[3].Value = stringRight;
1723+
1724+ firstLine++;
1725+ }
1726+ }
1727+ }
1728+
1729+ private void DeleteDToolStripMenuItem_Click(object sender, EventArgs e)
1730+ {
1731+ // 選択行を削除する。
1732+ // todo. undoに対応する。Delキーでの入力もオーバーライドが必要
1733+ // foreachで複数行済
1734+
1735+ // セル選択が無ければ抜ける。行選択時でも問題なし
1736+ if (dataGridView1.CurrentCell == null)
1737+ {
1738+ return;
1739+ }
1740+
1741+ // 選択されたセルが存在する場合、含まれる行を選択済にする。
1742+ foreach (DataGridViewCell cells in dataGridView1.SelectedCells)
1743+ {
1744+ if (!dataGridView1.Rows[cells.RowIndex].IsNewRow) // 新規行を除く
1745+ {
1746+ dataGridView1.Rows[cells.RowIndex].Selected = true;
1747+ }
1748+ }
1749+
1750+ // 選択行の処理を実行する。
1751+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
1752+ {
1753+ if (!raws.IsNewRow) // 新規行は除く
1754+ {
1755+ dataGridView1.Rows.Remove(raws);
1756+ }
1757+ }
1758+ dataGridView1.ClearSelection();
1759+ dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Selected = true;
1760+ }
1761+
1762+ private void FindToolStripMenuItem_Click(object sender, EventArgs e)
1763+ {
1764+
1765+ }
1766+
1767+ private void FindNextToolStripMenuItem_Click(object sender, EventArgs e)
1768+ {
1769+
1770+ }
1771+
1772+ private void ReplaceToolStripMenuItem_Click(object sender, EventArgs e)
1773+ {
1774+
1775+ }
1776+
1777+ private void JumpJToolStripMenuItem_Click(object sender, EventArgs e)
1778+ {
1779+ // 指定行にジャンプ
1780+ // ジャンプ先を入力させる。
1781+
1782+ // ジャンプ。
1783+ }
1784+
1785+ private void AutoSaveToolStripMenuItem_Click(object sender, EventArgs e)
1786+ {
1787+ // 自動保存状態の変更
1788+ // ユーザによる状態変更なのでレジストリにも状態を保存する
1789+ if (this.AutoSaveToolStripMenuItem.Checked == true)
1790+ {
1791+ Global_Val.bAutoSave = true;
1792+ setRegbUserAutoSave(true);
1793+ }
1794+ else
1795+ {
1796+ Global_Val.bAutoSave = false;
1797+ setRegbUserAutoSave(false);
1798+ }
1799+ setFileSaveStatus();
1800+ }
1801+
1802+ private void OptionToolStripMenuItem_Click(object sender, EventArgs e)
1803+ {
1804+ // menu option
1805+ Form SettingDialog = new FormSetting();
1806+ RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\appletkan\\nodoka");
1807+
1808+ SettingDialog.ShowDialog();
1809+
1810+ // 設定ダイアログで設定された情報の取得
1811+ GetSettingReg();
1812+
1813+ // キャプションへのファイル名表示オプションの反映
1814+ this.Text = Global_Val.b_filename_caption ? "のどかGuiEdit " + this.toolStripStatusLabel_FileName.Text : "のどかGuiEdit";
1815+
1816+ // フォント名、フォントサイズ、フォントスタイルを反映
1817+ SetFont();
1818+
1819+ // 色の設定
1820+ SetColor();
1821+
1822+ }
1823+
1824+ private void ViewHelpToolStripMenuItem_Click(object sender, EventArgs e)
1825+ {
1826+ // help表示
1827+ string HelpFile = ".\\doc\\GUIEdit-ja.html";
1828+ string HelpFile2 = "c:\\Program Files\\nodoka\\doc\\GUIEdit-ja.html";
1829+ if (System.IO.File.Exists(@HelpFile))
1830+ {
1831+ System.Diagnostics.Process.Start(HelpFile);
1832+ }
1833+ else
1834+ {
1835+ if (System.IO.File.Exists(@HelpFile2))
1836+ {
1837+ System.Diagnostics.Process.Start(HelpFile2);
1838+ }
1839+ }
1840+ }
1841+
1842+ private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
1843+ {
1844+ // about のどか
1845+ MessageBox.Show("のどかGuiEdit\n\n" + "Version 1.03\n\n" + "Copyright(c)2013 G.K.Applet All Rights Reserved.", "のどかGuiEditについて");
1846+ }
1847+
1848+ private void Form1_Load(object sender, EventArgs e)
1849+ {
1850+
1851+ }
1852+
1853+ private void Form1_Closing(object sender, FormClosingEventArgs e)
1854+ {
1855+ if (Global_Val.bSystemClose)
1856+ {
1857+ ToolStripMenuItemExit_Click(sender, e);
1858+ }
1859+ }
1860+
1861+ private void InserttoolStripMenuItem_Click(object sender, EventArgs e)
1862+ {
1863+ // todo undo対応
1864+ // 複数選択時に、選択した行数だけ追加する。
1865+ try
1866+ {
1867+ int firstLine = 32768;
1868+ int currentRowIndex = -1;
1869+ //int currentCellRowIndex = -1;
1870+
1871+ // セル選択が無ければ抜ける。行選択時でも問題なし
1872+ if (dataGridView1.CurrentCell == null)
1873+ {
1874+ return;
1875+ }
1876+
1877+ // 選択されたセルが存在する場合、含まれる行を選択済にする。
1878+ foreach (DataGridViewCell cells in dataGridView1.SelectedCells)
1879+ {
1880+ //if (!dataGridView1.Rows[cells.RowIndex].IsNewRow) // 新規行を除く
1881+ {
1882+ dataGridView1.Rows[cells.RowIndex].Selected = true;
1883+ }
1884+ }
1885+
1886+ // 一番若い行を取得する
1887+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
1888+ {
1889+ if(raws.Index < firstLine)
1890+ {
1891+ firstLine = raws.Index;
1892+ }
1893+ }
1894+
1895+ if (firstLine < 32768)
1896+ {
1897+ currentRowIndex = firstLine; //dataGridView1.SelectedRows[0].Index;
1898+ }
1899+
1900+ if (currentRowIndex >= 0) // 選択されていた場合
1901+ {
1902+ int SelectedRowsCount = dataGridView1.SelectedRows.Count;
1903+ Debug.WriteLine("current:" + currentRowIndex.ToString());
1904+ Debug.WriteLine("before:" + dataGridView1.SelectedRows[0].Index.ToString());
1905+
1906+ for (int i = 0; i < SelectedRowsCount; i++)
1907+ {
1908+ dataGridView1.Rows.Insert(currentRowIndex, 1);
1909+ DataGridViewRow row = dataGridView1.Rows[currentRowIndex];
1910+ row.Cells[0].Value = false;
1911+ row.Cells[1].Value = String.Empty;
1912+ row.Cells[2].Value = String.Empty;
1913+ row.Cells[3].Value = String.Empty;
1914+ }
1915+
1916+ Debug.WriteLine("after:" + dataGridView1.SelectedRows[0].Index.ToString());
1917+ // 挿入行にフォーカスを移す
1918+ dataGridView1.ClearSelection();
1919+ dataGridView1.Rows[currentRowIndex].Selected = true;
1920+ }
1921+ }
1922+ catch (Exception)
1923+ {
1924+ // nothing todo.
1925+ }
1926+ }
1927+
1928+ private void WizardtoolStripMenuItem_Click(object sender, EventArgs e)
1929+ {
1930+ // menu 挿入Wizardが選択されたので、Formを開く
1931+ Global_Val.wizardModeNew = true;
1932+ WizardCore(Global_Val.wizardModeNew);
1933+ }
1934+
1935+ private void ReWizardtoolStripMenuItem_Click(object sender, EventArgs e)
1936+ {
1937+ // menu 再Wizardが選択されたので、Formを開く
1938+
1939+ Global_Val.wizardModeNew = false;
1940+ WizardCore(Global_Val.wizardModeNew);
1941+ }
1942+
1943+
1944+ private void WizardCore(bool wizardModeNew)
1945+ {
1946+ // 一端、編集単位を行単位にする。
1947+ //dataGridView1.SelectionMode = DataGridViewSelectionMode.FullColumnSelect;
1948+ //dataGridView1.EndEdit();
1949+ // wizardModeNewがfalseの場合は、新規行にしない。現在の値をFormに渡す。
1950+
1951+ bool bSelected = false;
1952+ int firstLine = 32768;
1953+ int currentRowIndex = -1;
1954+
1955+ try
1956+ {
1957+ // 行選択状態
1958+ // 一番若い行を取得する
1959+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
1960+ {
1961+ if (raws.Index < firstLine)
1962+ {
1963+ firstLine = raws.Index;
1964+ }
1965+ }
1966+
1967+ if (firstLine < 32768)
1968+ {
1969+ currentRowIndex = firstLine; //dataGridView1.SelectedRows[0].Index;
1970+ }
1971+
1972+ if (currentRowIndex >= 0) // 選択されていた場合
1973+ {
1974+ bSelected = true;
1975+ }
1976+
1977+
1978+ // セル選択状態
1979+ currentRowIndex = dataGridView1.CurrentCell.RowIndex;
1980+ if (currentRowIndex != -1)
1981+ {
1982+ bSelected = true;
1983+ dataGridView1.Rows[currentRowIndex].Selected = true;
1984+ }
1985+ }
1986+
1987+ catch (Exception)
1988+ {
1989+ // nothing todo.
1990+ goto terminate;
1991+ }
1992+
1993+ if (bSelected == false)
1994+ {
1995+ goto terminate;
1996+ }
1997+
1998+ // 選択済なら左右の定義文の初期設定を行う
1999+ FormMain.Global_Val.caption = string.Empty;
2000+ FormMain.Global_Val.LeftString = string.Empty;
2001+ FormMain.Global_Val.RightString = string.Empty;
2002+ Global_Val.addMode = false;
2003+
2004+ // 再Wizardなら現在の値を取得する。
2005+ if (wizardModeNew == false)
2006+ {
2007+ Global_Val.addMode = true;
2008+ DataGridViewRow row = dataGridView1.Rows[currentRowIndex];
2009+
2010+ if (row.Cells[1].Value != null)
2011+ {
2012+ FormMain.Global_Val.caption = row.Cells[1].Value.ToString();
2013+ }
2014+
2015+ if (row.Cells[2].Value != null)
2016+ {
2017+ FormMain.Global_Val.LeftString = row.Cells[2].Value.ToString();
2018+ }
2019+
2020+ if (row.Cells[3].Value != null)
2021+ {
2022+ FormMain.Global_Val.RightString = row.Cells[3].Value.ToString();
2023+ }
2024+ }
2025+
2026+ // フォームを開く
2027+ // コマンド名を決める。
2028+ int commandNumber = 1; // 将来的には、挿入位置に応じて include, keymapが無ければ、それにする。
2029+
2030+ // 再Wizardの場合には、現在のコマンド名から commandNumberを設定する。
2031+ if (wizardModeNew == false)
2032+ {
2033+ String tmpLeftString = FormMain.Global_Val.LeftString.TrimStart(null);
2034+ Debug.Write("current:" + tmpLeftString +"\n");
2035+ commandNumber = 7; // 不明な場合は otherにしておく。
2036+ foreach (string i in commandWizard.mode_list)
2037+ {
2038+ String tmpSearchString = i + " "; // スペースを1個追加しておく
2039+ Debug.Write("i=\"" + tmpSearchString + "\"\n");
2040+ if (tmpLeftString.IndexOf(tmpSearchString) == 0) // 先頭からヒットした時だけ
2041+ {
2042+ commandNumber = Array.IndexOf(commandWizard.mode_list, i);
2043+ Debug.Write("detect:" + commandNumber.ToString() + "\n");
2044+ break;
2045+ }
2046+ }
2047+ }
2048+
2049+ Form fInsert = new commandWizard(commandNumber);
2050+ fInsert.ShowDialog();
2051+ if (commandWizard.Global_Val.status == true)
2052+ {
2053+
2054+ // もしも left/rightStringがNULLだとエラーになるので注意。
2055+ Debug.WriteLine("Left:" + commandWizard.Global_Val.leftString.ToString() + "Right:" + commandWizard.Global_Val.rightString.ToString());
2056+ Debug.Flush();
2057+
2058+ if (wizardModeNew == true)
2059+ {
2060+ // 行を挿入する。
2061+ // todo undo対応
2062+ Debug.WriteLine("before:" + dataGridView1.SelectedRows[0].Index.ToString());
2063+ dataGridView1.Rows.Insert(currentRowIndex, 1); // 現状1行だけ追加
2064+ Debug.WriteLine("after:" + dataGridView1.SelectedRows[0].Index.ToString());
2065+
2066+ // 挿入行にフォーカスを移す
2067+ int beforeRowIndex = dataGridView1.SelectedRows[0].Index;
2068+ dataGridView1.ClearSelection();
2069+ dataGridView1.Rows[currentRowIndex].Selected = true;
2070+
2071+ int newRowIndex = dataGridView1.SelectedRows[0].Index;
2072+ DataGridViewRow row = dataGridView1.Rows[newRowIndex];
2073+ Debug.WriteLine("new:" + row.ToString() + "\n");
2074+
2075+ // 値を入れる。
2076+ editCells(row);
2077+
2078+ // 挿入前にフォーカスを戻す
2079+ dataGridView1.ClearSelection();
2080+ dataGridView1.Rows[beforeRowIndex].Selected = true;
2081+ }
2082+ else
2083+ {
2084+ DataGridViewRow row = dataGridView1.Rows[currentRowIndex];
2085+
2086+ // 値を入れる。
2087+ editCells(row);
2088+ }
2089+
2090+ }
2091+ terminate:
2092+ {
2093+ // nothing todo.
2094+ //dataGridView1.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
2095+
2096+ }
2097+ }
2098+
2099+ private static void editCells(DataGridViewRow row)
2100+ {
2101+ if (commandWizard.Global_Val.caption != null)
2102+ {
2103+ row.Cells[1].Value = commandWizard.Global_Val.caption.ToString();
2104+ }
2105+
2106+ if (commandWizard.Global_Val.leftString != null)
2107+ {
2108+ row.Cells[2].Value = commandWizard.Global_Val.leftString.ToString();
2109+ }
2110+
2111+ if (commandWizard.Global_Val.rightString != null)
2112+ {
2113+ row.Cells[3].Value = commandWizard.Global_Val.rightString.ToString();
2114+ }
2115+ }
2116+
2117+ private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
2118+ {
2119+ // セルの中身をシングルクリックしたときの挙動
2120+ }
2121+
2122+ private void toolStripNewButton1_Click(object sender, EventArgs e)
2123+ {
2124+ NewNToolStripMenuItem_Click(sender, e);
2125+ }
2126+
2127+ private void toolStripOpenButton_Click(object sender, EventArgs e)
2128+ {
2129+ OpenOToolStripMenuItem_Click(sender, e);
2130+ }
2131+
2132+ private void toolStripSaveButton_Click(object sender, EventArgs e)
2133+ {
2134+ SaveCToolStripMenuItem_Click(sender, e);
2135+ }
2136+
2137+ private void toolStripNewWizardButton_Click(object sender, EventArgs e)
2138+ {
2139+ WizardtoolStripMenuItem_Click(sender, e);
2140+ }
2141+
2142+ private void toolStripReWizardButton_Click(object sender, EventArgs e)
2143+ {
2144+ ReWizardtoolStripMenuItem_Click(sender, e);
2145+ }
2146+
2147+ private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
2148+ {
2149+ // dataGridViewの値が変更されたので、未保存であるフラグをSetする。
2150+ Global_Val.bSaved = false;
2151+ setFileSaveStatus();
2152+ }
2153+
2154+ private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
2155+ {
2156+ //ToolStripMenuItemExit_Click(sender, e);
2157+ }
2158+
2159+ private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
2160+ {
2161+ return;
2162+
2163+ /*
2164+ // セルをシングルクリックで編集可能にする
2165+ DataGridView dataGridView = sender as DataGridView;
2166+
2167+ if (e.ColumnIndex >= 0)
2168+ {
2169+ if (dataGridView.Columns[e.ColumnIndex] is DataGridViewTextBoxColumn)
2170+ {
2171+ SendKeys.Send("{F2}");
2172+ }
2173+ }
2174+ */
2175+ }
2176+
2177+ private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
2178+ {
2179+ // 現在見えている行が一番下だった時に、スクロールさせる。
2180+ if (e.IsLastVisibleRow == true)
2181+ {
2182+ this.dataGridView1.FirstDisplayedScrollingRowIndex = this.dataGridView1.Rows.Count - 1;
2183+ //this.dataGridView1.InvalidateRow(this.dataGridView1.Rows.Count);
2184+ }
2185+ }
2186+
2187+ private void toolStrip1_Click(object sender, EventArgs e)
2188+ {
2189+ // ツールボタン部位をクリックしたら、dataGridViewを編集モード終了させる。
2190+ this.dataGridView1.EndEdit();
2191+ }
2192+
2193+ private void menuStrip1_Click(object sender, EventArgs e)
2194+ {
2195+ // メニューをクリックしたら、dataGridViewを編集モード終了させる。
2196+ this.dataGridView1.EndEdit();
2197+ }
2198+
2199+ private void statusStrip1_Click(object sender, EventArgs e)
2200+ {
2201+ // ステータスバーをクリックしたら、dataGridViewを編集モード終了させる。
2202+ this.dataGridView1.EndEdit();
2203+ }
2204+
2205+ private void FormMain_Click(object sender, EventArgs e)
2206+ {
2207+ // フォームのどこかをクリックしたら、dataGridViewを編集モード終了させる。
2208+ this.dataGridView1.EndEdit();
2209+ }
2210+
2211+ private void toolStripUndoButton_Click(object sender, EventArgs e)
2212+ {
2213+ // undo
2214+ }
2215+
2216+ private void toolStripCopyButton_Click(object sender, EventArgs e)
2217+ {
2218+ // copy
2219+ CopyCToolStripMenuItem_Click(sender, e);
2220+ }
2221+
2222+ private void toolStripCutButton_Click(object sender, EventArgs e)
2223+ {
2224+ // cut
2225+ CutCToolStripMenuItem_Click(sender, e);
2226+ }
2227+
2228+ private void toolStripPasteButton_Click(object sender, EventArgs e)
2229+ {
2230+ // paste
2231+ PastePToolStripMenuItem_Click(sender, e);
2232+ }
2233+
2234+ private void toolStripInsertButton_Click(object sender, EventArgs e)
2235+ {
2236+ // insert
2237+ InserttoolStripMenuItem_Click(sender, e);
2238+ }
2239+
2240+ private void toolStripDeleteButton_Click(object sender, EventArgs e)
2241+ {
2242+ // delete
2243+ DeleteDToolStripMenuItem_Click(sender, e);
2244+ }
2245+
2246+ private bool readRegbUserAutoSave()
2247+ {
2248+ string stringValue = String.Empty;
2249+ // ユーザによるメニューからの自動保存チェック状態を取り出す。
2250+ // ファイル名指定されて実行された場合は、bAutoSaveはtrueにされるが、それは保存されていない。
2251+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
2252+
2253+ if (rk != null)
2254+ {
2255+ stringValue = (string)rk.GetValue("bUserAutoSave");
2256+ }
2257+
2258+ if (stringValue == "true")
2259+ {
2260+ return true;
2261+ }
2262+ else
2263+ {
2264+ return false;
2265+ }
2266+ }
2267+
2268+ private void setRegbUserAutoSave(bool bStatus)
2269+ {
2270+ // ユーザによるメニューからの自動保存チェック状態を保存。
2271+ // ファイル名指定されて実行された場合は、bAutoSaveはtrueにされるが、それは保存しない運用。
2272+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
2273+
2274+ if (rk != null)
2275+ {
2276+ if (bStatus == true)
2277+ {
2278+ rk.SetValue("bUserAutoSave", "true");
2279+ }
2280+ else
2281+ {
2282+ rk.SetValue("bUserAutoSave", "false");
2283+ }
2284+ }
2285+ }
2286+
2287+ //readRegNodokaDir()
2288+ private string readRegNodokaDir()
2289+ {
2290+ try
2291+ {
2292+ // のどかがインストールされているパスを取り出す。
2293+ RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\appletkan\\nodoka");
2294+ string stringValue = (string)rk.GetValue("dir");
2295+ return stringValue;
2296+ }
2297+ catch (Exception e)
2298+ {
2299+ return null;
2300+ }
2301+ }
2302+
2303+ private void cutToolStripMenuItem_Click(object sender, EventArgs e)
2304+ {
2305+ // cut
2306+ CutCToolStripMenuItem_Click(sender, e);
2307+ }
2308+
2309+ private void copyContextMenuItem_Click(object sender, EventArgs e)
2310+ {
2311+ // copy
2312+ CopyCToolStripMenuItem_Click(sender, e);
2313+ }
2314+
2315+ private void pasteContextMenuItem_Click(object sender, EventArgs e)
2316+ {
2317+ // paste
2318+ PastePToolStripMenuItem_Click(sender, e);
2319+ }
2320+
2321+ private void insertContextMenuItem_Click(object sender, EventArgs e)
2322+ {
2323+ // insert
2324+ InserttoolStripMenuItem_Click(sender, e);
2325+ }
2326+
2327+ private void deleteContextMenuItem_Click(object sender, EventArgs e)
2328+ {
2329+ // delete
2330+ DeleteDToolStripMenuItem_Click(sender, e);
2331+ }
2332+
2333+ private void newWizardContextMenuItem_Click(object sender, EventArgs e)
2334+ {
2335+ WizardtoolStripMenuItem_Click(sender, e);
2336+ }
2337+
2338+ private void reWizardContextMenuItem_Click(object sender, EventArgs e)
2339+ {
2340+ ReWizardtoolStripMenuItem_Click(sender, e);
2341+ }
2342+
2343+ private void keyDown(object sender, KeyEventArgs e)
2344+ {
2345+ // dataGridView1 キー入力の実装
2346+
2347+ if (e.Control == true)
2348+ {
2349+ switch (e.KeyCode)
2350+ {
2351+ case Keys.C:
2352+ // copy
2353+ CopyCToolStripMenuItem_Click(sender, e);
2354+ break;
2355+ case Keys.X:
2356+ // cut
2357+ CutCToolStripMenuItem_Click(sender, e);
2358+ break;
2359+ case Keys.V:
2360+ // paste
2361+ PastePToolStripMenuItem_Click(sender, e);
2362+ break;
2363+ case Keys.W:
2364+ // ウィンドウを閉じる as 終了
2365+ ToolStripMenuItemExit_Click(sender, e);
2366+ break;
2367+ case Keys.Z:
2368+ // undo
2369+ break;
2370+ }
2371+ return;
2372+ }
2373+
2374+ switch (e.KeyCode)
2375+ {
2376+ case Keys.Insert:
2377+ // insert
2378+ InserttoolStripMenuItem_Click(sender, e);
2379+ break;
2380+ case Keys.Delete:
2381+ // delete ここでDeleteを呼べば削除されるが余分に削除されることがあるので、機能としてサポートしない。
2382+ //DeleteDToolStripMenuItem_Click(sender, e);
2383+ break;
2384+ }
2385+
2386+ return;
2387+ }
2388+
2389+ private void FontSmallButton_Click(object sender, EventArgs e)
2390+ {
2391+ float currentFontSize = this.dataGridView1.DefaultCellStyle.Font.Size;
2392+ currentFontSize--;
2393+ if (currentFontSize < 5)
2394+ {
2395+ currentFontSize = 5;
2396+ }
2397+
2398+ SetFontSize(currentFontSize);
2399+ }
2400+
2401+ private void fontStandardButton_Click(object sender, EventArgs e)
2402+ {
2403+ float currentFontSize = Global_Val.i_fontsize;
2404+ SetFontSize(currentFontSize);
2405+ }
2406+
2407+ private void fontLergeButton_Click(object sender, EventArgs e)
2408+ {
2409+ float currentFontSize = this.dataGridView1.DefaultCellStyle.Font.Size;
2410+ currentFontSize++;
2411+ if (currentFontSize > 72)
2412+ {
2413+ currentFontSize = 72;
2414+ }
2415+
2416+ SetFontSize(currentFontSize);
2417+ }
2418+
2419+ // サイズ以外のフォント関係の値をレジストリから取りだし DataGridViewに反映させる。
2420+ private void SetFontSize(float currentFontSize)
2421+ {
2422+ Global_Val.i_current_fontsize = (int)currentFontSize;
2423+
2424+ FontStyle tmpFS = FontStyle.Regular;
2425+
2426+ if (Global_Val.s_fontstyle.IndexOf("Bold") >= 0)
2427+ {
2428+ tmpFS = FontStyle.Bold;
2429+ }
2430+ if (Global_Val.s_fontstyle.IndexOf("Italic") >= 0)
2431+ {
2432+ tmpFS = FontStyle.Italic;
2433+ }
2434+ if (Global_Val.s_fontstyle.IndexOf("Bold, Italic") >= 0)
2435+ {
2436+ tmpFS = FontStyle.Bold | FontStyle.Italic;
2437+ }
2438+
2439+ this.dataGridView1.DefaultCellStyle.Font = new Font(Global_Val.s_font, currentFontSize, tmpFS);
2440+ }
2441+
2442+ private void ReloadRToolStripMenuItem_Click(object sender, EventArgs e)
2443+ {
2444+ // もし未保存状態なら、続行してもよいか聞く。保存ダイアログまでは出さない。
2445+ if (Global_Val.bSaved == false)
2446+ {
2447+ if (DialogResult.Cancel == MessageBox.Show("現在編集中のファイルは保存されていませんが、続行しますか?", "のどかGuiEdit",
2448+ MessageBoxButtons.OKCancel,
2449+ MessageBoxIcon.Exclamation,
2450+ MessageBoxDefaultButton.Button1))
2451+ {
2452+ return;
2453+ }
2454+ }
2455+
2456+ // dataGridViewの初期化
2457+ this.dataGridView1.Rows.Clear();
2458+
2459+ // File Read 呼び出し
2460+ string fileName = this.toolStripStatusLabel_FileName.Text;
2461+ if (fileName == "new_file.nodoka")
2462+ {
2463+ fileName = String.Empty;
2464+ }
2465+ read_dotnodoka(fileName, encodes[Global_Val.i_selectencode], false);
2466+ dataGridView1[1, 0].Selected = true;
2467+ dataGridView1.CurrentCell = dataGridView1[1, 0];
2468+ }
2469+
2470+ // dataGridView1のセル内編集処理
2471+ private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
2472+ {
2473+ if (e.Control is DataGridViewTextBoxEditingControl)
2474+ {
2475+ DataGridView dgv = (DataGridView)sender;
2476+
2477+ //編集のために表示されているコントロールを取得
2478+ DataGridViewTextBoxEditingControl tb = (DataGridViewTextBoxEditingControl)e.Control;
2479+
2480+ //イベントハンドラを削除
2481+ tb.KeyDown -= new KeyEventHandler(dataGridViewTexBox_myKeyDown);
2482+
2483+ //KeyPressイベントハンドラを追加
2484+ tb.KeyDown += new KeyEventHandler(dataGridViewTexBox_myKeyDown);
2485+ }
2486+ }
2487+
2488+ private void dataGridViewTextBox_myKeyPress(object sender, KeyPressEventArgs e)
2489+ {
2490+ e.Handled = true;
2491+ /*//数字しか入力できないようにする
2492+ if (e.KeyChar < '0' || e.KeyChar > '9')
2493+ {
2494+ e.Handled = true;
2495+ }*/
2496+ }
2497+
2498+ public void dataGridViewTexBox_myKeyDown(object sender, KeyEventArgs e)
2499+ {
2500+ if (e.Control == true)
2501+ {
2502+ switch (e.KeyCode)
2503+ {
2504+ case Keys.C:
2505+ case Keys.X:
2506+ case Keys.V:
2507+ case Keys.Z:
2508+ e.Handled = false;
2509+ break;
2510+ }
2511+ return;
2512+ }
2513+
2514+ if (e.KeyCode == Keys.F2)
2515+ {
2516+ this.dataGridView1.EndEdit();
2517+ }
2518+
2519+ if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right)
2520+ {
2521+ e.Handled = false;
2522+ return;
2523+ }
2524+
2525+ if (e.KeyCode == Keys.Delete)
2526+ {
2527+ e.Handled = false;
2528+ return;
2529+ }
2530+
2531+ e.Handled = true;
2532+ return;
2533+ }
2534+
2535+ private void openIncludeFile(object sender, EventArgs e)
2536+ {
2537+ // 右クリックで includeファイルを開く
2538+
2539+ // 選択行の情報取得
2540+ bool bSelected = false;
2541+ int firstLine = 32768;
2542+ int currentRowIndex = -1;
2543+ string CommandL = String.Empty;
2544+
2545+ try
2546+ {
2547+ // 行選択状態
2548+ // 一番若い行を取得する
2549+ foreach (DataGridViewRow raws in dataGridView1.SelectedRows)
2550+ {
2551+ if (raws.Index < firstLine)
2552+ {
2553+ firstLine = raws.Index;
2554+ }
2555+ }
2556+
2557+ if (firstLine < 32768)
2558+ {
2559+ currentRowIndex = firstLine; //dataGridView1.SelectedRows[0].Index;
2560+ }
2561+
2562+ if (currentRowIndex >= 0) // 選択されていた場合
2563+ {
2564+ bSelected = true;
2565+ }
2566+
2567+
2568+ // セル選択状態
2569+ currentRowIndex = dataGridView1.CurrentCell.RowIndex;
2570+ if (currentRowIndex != -1)
2571+ {
2572+ bSelected = true;
2573+ dataGridView1.Rows[currentRowIndex].Selected = true;
2574+ }
2575+ }
2576+
2577+ catch (Exception)
2578+ {
2579+ // nothing todo.
2580+ goto terminate;
2581+ }
2582+
2583+ if (bSelected == false)
2584+ {
2585+ goto terminate;
2586+ }
2587+
2588+ DataGridViewRow row = dataGridView1.Rows[currentRowIndex];
2589+
2590+ if (row.Cells[2].Value != null)
2591+ {
2592+ CommandL = row.Cells[2].Value.ToString();
2593+ }
2594+
2595+ // command L が include文でなければ終了
2596+ CommandL = CommandL.Trim();
2597+ if (CommandL.StartsWith("include"))
2598+ {
2599+ // file名の取得
2600+ // ""で囲まれたファイル名を取得する
2601+ CommandL = CommandL.Substring("include".Length);
2602+ CommandL = CommandL.Trim().TrimStart('\"').TrimEnd('\"');
2603+
2604+ // HOMEの取得
2605+ string[] HOME_PATH = { "", "", "", "", "", "" };
2606+ HOME_PATH[0] = Path.GetDirectoryName(this.toolStripStatusLabel_FileName.Text);
2607+ HOME_PATH[1] = System.Environment.GetEnvironmentVariable("NODOKA", System.EnvironmentVariableTarget.User);
2608+ HOME_PATH[2] = System.Environment.GetEnvironmentVariable("HOME");
2609+ HOME_PATH[3] = System.Environment.GetEnvironmentVariable("USERPROFILE");
2610+ HOME_PATH[4] = System.Environment.GetEnvironmentVariable("HOMEDRIVE")
2611+ + System.Environment.GetEnvironmentVariable("HOMEPATH");
2612+
2613+ RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\appletkan\\nodoka");
2614+ HOME_PATH[5] = (string)rk.GetValue("currentPath");
2615+
2616+ // GuiEditを引数付きで開く
2617+ int i = 0;
2618+ string fileName = string.Empty;
2619+ string fileNameS = String.Empty;
2620+
2621+ while (i <= 5)
2622+ {
2623+ fileName = HOME_PATH[i] + "\\" + CommandL;
2624+ fileNameS = fileNameS + "\n" + fileName;
2625+
2626+ if (System.IO.File.Exists(fileName))
2627+ {
2628+ string exeFileName = System.Reflection.Assembly.GetExecutingAssembly().Location;
2629+ System.Diagnostics.Process.Start(exeFileName, "\"" + fileName + "\"");
2630+ goto terminate;
2631+ }
2632+ i++;
2633+ }
2634+ MessageBox.Show("設定ファイルが見当たりません。" + fileNameS, "のどかGuiEdit", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
2635+ }
2636+
2637+ terminate:
2638+ {
2639+ // nothing to do.
2640+ }
2641+ }
2642+
2643+ private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
2644+ {
2645+ // セル内容をダブルクリックした際、includeファイルがあるものと仮定し開く。不発することが多いのでコメントアウト
2646+ openIncludeFile(sender, e);
2647+ }
2648+
2649+ private void toolStripButtonSetting_Click(object sender, EventArgs e)
2650+ {
2651+ // セッティングボタン
2652+ OptionToolStripMenuItem_Click(sender, e);
2653+ }
2654+
2655+ private void combo_encode_SelectedIndexChanged(object sender, EventArgs e)
2656+ {
2657+ //文字コード指定変更があった時
2658+ Global_Val.i_selectencode = combo_encode.SelectedIndex;
2659+ }
2660+
2661+ private void toolStripSeparator1_Click(object sender, EventArgs e)
2662+ {
2663+
2664+ }
2665+
2666+ private void ReadOnlyToolStripMenuItem_Click(object sender, EventArgs e)
2667+ {
2668+ // もし未保存状態なら、続行してもよいか聞く。保存ダイアログまでは出さない。
2669+ if (Global_Val.bSaved == false)
2670+ {
2671+ if (DialogResult.Cancel == MessageBox.Show("現在編集中のファイルは保存されていませんが、続行しますか?", "のどかGuiEdit",
2672+ MessageBoxButtons.OKCancel,
2673+ MessageBoxIcon.Exclamation,
2674+ MessageBoxDefaultButton.Button1))
2675+ {
2676+ return;
2677+ }
2678+ }
2679+
2680+ // dataGridViewの初期化
2681+ this.dataGridView1.Rows.Clear();
2682+
2683+ // File Read 呼び出し
2684+ string fileName = this.toolStripStatusLabel_FileName.Text;
2685+ if (fileName == "new_file.nodoka")
2686+ {
2687+ fileName = String.Empty;
2688+ }
2689+ read_dotnodoka(fileName, encodes[Global_Val.i_selectencode], true); // read onlyで開く。
2690+ dataGridView1[1, 0].Selected = true;
2691+ dataGridView1.CurrentCell = dataGridView1[1, 0];
2692+ }
2693+
2694+ private void FormMain_Shown(object sender, EventArgs e)
2695+ {
2696+ // 最初にメイン画面が作られた時
2697+ dataGridView1[1, 0].Selected = true;
2698+ dataGridView1.CurrentCell = dataGridView1[1, 0];
2699+ }
2700+ }
2701+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetNODOKA.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetNODOKA.cs (revision 228)
@@ -0,0 +1,76 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Windows.Forms;
9+using System.Runtime.InteropServices; // DllImport
10+using System.IO;
11+//using Microsoft.Win32; // Path
12+
13+
14+namespace nodokaGuiEdit
15+{
16+ public partial class FormSetNODOKA : Form
17+ {
18+ public FormSetNODOKA()
19+ {
20+ InitializeComponent();
21+ string viewPath = System.Environment.GetEnvironmentVariable("NODOKA", System.EnvironmentVariableTarget.User);
22+
23+ textBox2.Text = viewPath;
24+
25+ if (viewPath == null)
26+ {
27+ viewPath = "未設定";
28+ }
29+
30+ textBox1.Text = viewPath;
31+ }
32+
33+ public class Global_Val
34+ {
35+ // グローバル変数の宣言
36+ static public string envString;
37+ }
38+
39+ private void Getbutton_Click(object sender, EventArgs e)
40+ {
41+ // 参照ボタンが押された
42+ // File Open Dialog
43+ string folder_name = String.Empty;
44+
45+ OpenFileDialog OF_Dialog = new OpenFileDialog();
46+ OF_Dialog.FileName = string.Empty;
47+ OF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
48+ OF_Dialog.Filter =
49+ "すべてのファイル(*.*)|*.*";
50+ OF_Dialog.FilterIndex = 1;
51+ OF_Dialog.Title = "環境変数NODOKAに設定するフォルダに存在するファイルを選択してください";
52+ OF_Dialog.RestoreDirectory = true;
53+ OF_Dialog.CheckFileExists = false;
54+ OF_Dialog.CheckPathExists = true;
55+ OF_Dialog.Multiselect = false;
56+
57+ if (OF_Dialog.ShowDialog() == DialogResult.OK)
58+ {
59+ // file name取得
60+ folder_name = Path.GetDirectoryName(OF_Dialog.FileName);
61+
62+ textBox2.Text = folder_name;
63+ }
64+
65+
66+
67+ }
68+
69+ private void SetNODOKAclosing(object sender, FormClosingEventArgs e)
70+ {
71+ // Global_Valに残す。
72+ Global_Val.envString = textBox2.Text;
73+ }
74+ }
75+}
76+
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/detectencode.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/detectencode.cs (revision 228)
@@ -0,0 +1,111 @@
1+using System;
2+//using System.Collections.Generic;
3+//using System.Linq;
4+using System.IO; // FileStream, FileMode, FileAccess
5+using System.Runtime.InteropServices; // GCHandle, GCHandleType, Marshal, ComImport, Guid, InterfaceType, In, Out
6+using System.Text; // Encoding
7+
8+namespace nodokaGuiEdit
9+{
10+ // from http://tech.nitoyon.com/ja/blog/2012/03/07/detectinputcodepage-in-cs/
11+ class detectencode
12+ {
13+
14+ public Encoding DetectFileEncoding(string srcFile)
15+ {
16+ Encoding encoding = DetectEncoding(GetFileAsByteArray(srcFile));
17+ return encoding;
18+ }
19+
20+ // 指定されたファイルを開いてbyte配列で返す。
21+ // todo fileが無かった場合の処理を追加するか、呼び側で処理すること。
22+ private byte[] GetFileAsByteArray(string path)
23+ {
24+ using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
25+ {
26+ byte[] bytes = new byte[fs.Length];
27+ fs.Read(bytes, 0, bytes.Length);
28+ return bytes;
29+ }
30+ }
31+
32+ // 指定されたbyte配列から、文字エンコードを返す。
33+ private Encoding DetectEncoding(byte[] bytes)
34+ {
35+ IMultiLanguage2 lang = (IMultiLanguage2)new MultiLanguage();
36+ int len = bytes.Length;
37+ DetectEncodingInfo info = new DetectEncodingInfo();
38+ int scores = 1;
39+
40+ // bytes to IntPtr
41+ GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
42+ IntPtr pbytes = Marshal.UnsafeAddrOfPinnedArrayElement(bytes, 0);
43+
44+ try
45+ {
46+ lang.DetectInputCodepage(0, 0, pbytes, ref len, out info, ref scores);
47+ }
48+ finally
49+ {
50+ if (handle.IsAllocated)
51+ handle.Free();
52+ }
53+
54+ return Encoding.GetEncoding((int)info.nCodePage);
55+ }
56+
57+#pragma warning disable 0649
58+ public struct DetectEncodingInfo
59+ {
60+ public UInt32 nLangID;
61+ public UInt32 nCodePage;
62+ public Int32 nDocPercent;
63+ public Int32 nConfidence;
64+ };
65+#pragma warning restore 0649
66+
67+ [ComImport, Guid("275c23e2-3747-11d0-9fea-00aa003f8646")]
68+ public class MultiLanguage
69+ {
70+ }
71+
72+ [Guid("DCCFC164-2B38-11D2-B7EC-00C04F8F5D9A"),
73+ InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
74+ public interface IMultiLanguage2
75+ {
76+ void GetNumberOfCodePageInfo();
77+ void GetCodePageInfo();
78+ void GetFamilyCodePage();
79+ void EnumCodePages();
80+ void GetCharsetInfo();
81+ void IsConvertible();
82+ void ConvertString();
83+ void ConvertStringToUnicode();
84+ void ConvertStringFromUnicode();
85+ void ConvertStringReset();
86+ void GetRfc1766FromLcid();
87+ void GetLcidFromRfc1766();
88+ void EnumRfc1766();
89+ void GetRfc1766Info();
90+ void CreateConvertCharset();
91+ void ConvertStringInIStream();
92+ void ConvertStringToUnicodeEx();
93+ void ConvertStringFromUnicodeEx();
94+ void DetectCodepageInIStream();
95+ void DetectInputCodepage(
96+ [In] UInt32 dwFlag,
97+ [In] UInt32 dwPrefWinCodePage,
98+ [In] IntPtr pSrcStr,
99+ [In, Out] ref Int32 pcSrcSize,
100+ [Out] out DetectEncodingInfo lpEncoding,
101+ [In, Out] ref Int32 pnScores);
102+ void ValidateCodePage();
103+ void GetCodePageDescription();
104+ void IsCodePageInstallable();
105+ void SetMimeDBSource();
106+ void GetNumberOfScripts();
107+ void EnumScripts();
108+ void ValidateCodePageEx();
109+ }
110+ }
111+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormInsert.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormInsert.Designer.cs (revision 228)
@@ -0,0 +1,621 @@
1+namespace nodokaGuiEdit
2+{
3+ partial class commandWizard
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(commandWizard));
32+ this.tabControl1 = new System.Windows.Forms.TabControl();
33+ this.tabPage1 = new System.Windows.Forms.TabPage();
34+ this.Tab1CaptionTextBox = new System.Windows.Forms.TextBox();
35+ this.Tab1CaptionLabel = new System.Windows.Forms.Label();
36+ this.Tab1CancelButton = new System.Windows.Forms.Button();
37+ this.Tab1CommandLabel = new System.Windows.Forms.Label();
38+ this.Tab1CommandListBox = new System.Windows.Forms.ListBox();
39+ this.Tab1NextButton = new System.Windows.Forms.Button();
40+ this.tabPage2 = new System.Windows.Forms.TabPage();
41+ this.SelectFileButton = new System.Windows.Forms.Button();
42+ this.Tab2RadioButton109 = new System.Windows.Forms.RadioButton();
43+ this.Tab2RadioButton104 = new System.Windows.Forms.RadioButton();
44+ this.Tab2OldTextBox = new System.Windows.Forms.TextBox();
45+ this.Tab2CancelButton = new System.Windows.Forms.Button();
46+ this.Tab2NewTextBox = new System.Windows.Forms.TextBox();
47+ this.Tab2AsterCheckBox = new System.Windows.Forms.CheckBox();
48+ this.Tab2RightLabel = new System.Windows.Forms.Label();
49+ this.Tab2CenterLabel = new System.Windows.Forms.Label();
50+ this.Tab2LeftLabel = new System.Windows.Forms.Label();
51+ this.Tab2RightListBox = new System.Windows.Forms.ListBox();
52+ this.Tab2CenterListBox = new System.Windows.Forms.ListBox();
53+ this.Tab2LeftCheckedListBox = new System.Windows.Forms.CheckedListBox();
54+ this.Tab2PrevButton = new System.Windows.Forms.Button();
55+ this.Tab2NextButton = new System.Windows.Forms.Button();
56+ this.tabPage3 = new System.Windows.Forms.TabPage();
57+ this.Tab3AddModeCheckBox = new System.Windows.Forms.CheckBox();
58+ this.Tab3OldTextBox = new System.Windows.Forms.TextBox();
59+ this.Tab3LeftCheckedListBox = new System.Windows.Forms.CheckedListBox();
60+ this.Tab3CancelButton = new System.Windows.Forms.Button();
61+ this.Tab3NewTextBox = new System.Windows.Forms.TextBox();
62+ this.Tab3RightLabel = new System.Windows.Forms.Label();
63+ this.Tab3CenterLabel = new System.Windows.Forms.Label();
64+ this.Tab3LeftLabel = new System.Windows.Forms.Label();
65+ this.Tab3RightListBox = new System.Windows.Forms.ListBox();
66+ this.Tab3CenterListBox = new System.Windows.Forms.ListBox();
67+ this.Tab3PrevButton = new System.Windows.Forms.Button();
68+ this.Tab3OkButton = new System.Windows.Forms.Button();
69+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
70+ this.FormInsertStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
71+ this.FormInsertStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
72+ this.tabControl1.SuspendLayout();
73+ this.tabPage1.SuspendLayout();
74+ this.tabPage2.SuspendLayout();
75+ this.tabPage3.SuspendLayout();
76+ this.statusStrip1.SuspendLayout();
77+ this.SuspendLayout();
78+ //
79+ // tabControl1
80+ //
81+ this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons;
82+ this.tabControl1.Controls.Add(this.tabPage1);
83+ this.tabControl1.Controls.Add(this.tabPage2);
84+ this.tabControl1.Controls.Add(this.tabPage3);
85+ this.tabControl1.Location = new System.Drawing.Point(0, 1);
86+ this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
87+ this.tabControl1.Name = "tabControl1";
88+ this.tabControl1.SelectedIndex = 0;
89+ this.tabControl1.ShowToolTips = true;
90+ this.tabControl1.Size = new System.Drawing.Size(466, 295);
91+ this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.FillToRight;
92+ this.tabControl1.TabIndex = 0;
93+ //
94+ // tabPage1
95+ //
96+ this.tabPage1.Controls.Add(this.Tab1CaptionTextBox);
97+ this.tabPage1.Controls.Add(this.Tab1CaptionLabel);
98+ this.tabPage1.Controls.Add(this.Tab1CancelButton);
99+ this.tabPage1.Controls.Add(this.Tab1CommandLabel);
100+ this.tabPage1.Controls.Add(this.Tab1CommandListBox);
101+ this.tabPage1.Controls.Add(this.Tab1NextButton);
102+ this.tabPage1.Location = new System.Drawing.Point(4, 25);
103+ this.tabPage1.Margin = new System.Windows.Forms.Padding(2);
104+ this.tabPage1.Name = "tabPage1";
105+ this.tabPage1.Padding = new System.Windows.Forms.Padding(2);
106+ this.tabPage1.Size = new System.Drawing.Size(458, 266);
107+ this.tabPage1.TabIndex = 0;
108+ this.tabPage1.Text = "コマンド指定";
109+ this.tabPage1.UseVisualStyleBackColor = true;
110+ //
111+ // Tab1CaptionTextBox
112+ //
113+ this.Tab1CaptionTextBox.Location = new System.Drawing.Point(43, 204);
114+ this.Tab1CaptionTextBox.Multiline = true;
115+ this.Tab1CaptionTextBox.Name = "Tab1CaptionTextBox";
116+ this.Tab1CaptionTextBox.Size = new System.Drawing.Size(376, 35);
117+ this.Tab1CaptionTextBox.TabIndex = 3;
118+ //
119+ // Tab1CaptionLabel
120+ //
121+ this.Tab1CaptionLabel.AutoSize = true;
122+ this.Tab1CaptionLabel.Location = new System.Drawing.Point(43, 186);
123+ this.Tab1CaptionLabel.Name = "Tab1CaptionLabel";
124+ this.Tab1CaptionLabel.Size = new System.Drawing.Size(89, 12);
125+ this.Tab1CaptionLabel.TabIndex = 2;
126+ this.Tab1CaptionLabel.Text = "説明(キャプション)";
127+ //
128+ // Tab1CancelButton
129+ //
130+ this.Tab1CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
131+ this.Tab1CancelButton.Location = new System.Drawing.Point(340, 248);
132+ this.Tab1CancelButton.Margin = new System.Windows.Forms.Padding(2);
133+ this.Tab1CancelButton.Name = "Tab1CancelButton";
134+ this.Tab1CancelButton.Size = new System.Drawing.Size(56, 18);
135+ this.Tab1CancelButton.TabIndex = 4;
136+ this.Tab1CancelButton.Text = "Cancel";
137+ this.Tab1CancelButton.UseVisualStyleBackColor = true;
138+ //
139+ // Tab1CommandLabel
140+ //
141+ this.Tab1CommandLabel.AutoSize = true;
142+ this.Tab1CommandLabel.Location = new System.Drawing.Point(40, 7);
143+ this.Tab1CommandLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
144+ this.Tab1CommandLabel.Name = "Tab1CommandLabel";
145+ this.Tab1CommandLabel.Size = new System.Drawing.Size(40, 12);
146+ this.Tab1CommandLabel.TabIndex = 0;
147+ this.Tab1CommandLabel.Text = "コマンド";
148+ //
149+ // Tab1CommandListBox
150+ //
151+ this.Tab1CommandListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
152+ this.Tab1CommandListBox.FormattingEnabled = true;
153+ this.Tab1CommandListBox.ItemHeight = 12;
154+ this.Tab1CommandListBox.Location = new System.Drawing.Point(43, 26);
155+ this.Tab1CommandListBox.Margin = new System.Windows.Forms.Padding(2);
156+ this.Tab1CommandListBox.Name = "Tab1CommandListBox";
157+ this.Tab1CommandListBox.Size = new System.Drawing.Size(374, 148);
158+ this.Tab1CommandListBox.TabIndex = 1;
159+ this.Tab1CommandListBox.SelectedIndexChanged += new System.EventHandler(this.Tab1CommandListBox_SelectedIndexChanged);
160+ //
161+ // Tab1NextButton
162+ //
163+ this.Tab1NextButton.Location = new System.Drawing.Point(401, 248);
164+ this.Tab1NextButton.Margin = new System.Windows.Forms.Padding(2);
165+ this.Tab1NextButton.Name = "Tab1NextButton";
166+ this.Tab1NextButton.Size = new System.Drawing.Size(56, 18);
167+ this.Tab1NextButton.TabIndex = 5;
168+ this.Tab1NextButton.Text = "次";
169+ this.Tab1NextButton.UseVisualStyleBackColor = true;
170+ this.Tab1NextButton.Click += new System.EventHandler(this.Tab1NextButton_Click);
171+ //
172+ // tabPage2
173+ //
174+ this.tabPage2.Controls.Add(this.SelectFileButton);
175+ this.tabPage2.Controls.Add(this.Tab2RadioButton109);
176+ this.tabPage2.Controls.Add(this.Tab2RadioButton104);
177+ this.tabPage2.Controls.Add(this.Tab2OldTextBox);
178+ this.tabPage2.Controls.Add(this.Tab2CancelButton);
179+ this.tabPage2.Controls.Add(this.Tab2NewTextBox);
180+ this.tabPage2.Controls.Add(this.Tab2AsterCheckBox);
181+ this.tabPage2.Controls.Add(this.Tab2RightLabel);
182+ this.tabPage2.Controls.Add(this.Tab2CenterLabel);
183+ this.tabPage2.Controls.Add(this.Tab2LeftLabel);
184+ this.tabPage2.Controls.Add(this.Tab2RightListBox);
185+ this.tabPage2.Controls.Add(this.Tab2CenterListBox);
186+ this.tabPage2.Controls.Add(this.Tab2LeftCheckedListBox);
187+ this.tabPage2.Controls.Add(this.Tab2PrevButton);
188+ this.tabPage2.Controls.Add(this.Tab2NextButton);
189+ this.tabPage2.Location = new System.Drawing.Point(4, 25);
190+ this.tabPage2.Margin = new System.Windows.Forms.Padding(2);
191+ this.tabPage2.Name = "tabPage2";
192+ this.tabPage2.Padding = new System.Windows.Forms.Padding(2);
193+ this.tabPage2.Size = new System.Drawing.Size(458, 266);
194+ this.tabPage2.TabIndex = 1;
195+ this.tabPage2.Text = "変更前のキーバインド";
196+ this.tabPage2.UseVisualStyleBackColor = true;
197+ this.tabPage2.Click += new System.EventHandler(this.tabPage2_Click);
198+ //
199+ // SelectFileButton
200+ //
201+ this.SelectFileButton.Location = new System.Drawing.Point(178, 248);
202+ this.SelectFileButton.Margin = new System.Windows.Forms.Padding(2);
203+ this.SelectFileButton.Name = "SelectFileButton";
204+ this.SelectFileButton.Size = new System.Drawing.Size(77, 18);
205+ this.SelectFileButton.TabIndex = 9;
206+ this.SelectFileButton.Text = "ファイル選択";
207+ this.SelectFileButton.UseVisualStyleBackColor = true;
208+ this.SelectFileButton.Click += new System.EventHandler(this.SelectFileButton_Click);
209+ //
210+ // Tab2RadioButton109
211+ //
212+ this.Tab2RadioButton109.AutoSize = true;
213+ this.Tab2RadioButton109.Checked = true;
214+ this.Tab2RadioButton109.Location = new System.Drawing.Point(96, 249);
215+ this.Tab2RadioButton109.Name = "Tab2RadioButton109";
216+ this.Tab2RadioButton109.Size = new System.Drawing.Size(65, 16);
217+ this.Tab2RadioButton109.TabIndex = 6;
218+ this.Tab2RadioButton109.TabStop = true;
219+ this.Tab2RadioButton109.Text = "106/109";
220+ this.Tab2RadioButton109.UseVisualStyleBackColor = true;
221+ //
222+ // Tab2RadioButton104
223+ //
224+ this.Tab2RadioButton104.AutoSize = true;
225+ this.Tab2RadioButton104.Location = new System.Drawing.Point(25, 249);
226+ this.Tab2RadioButton104.Name = "Tab2RadioButton104";
227+ this.Tab2RadioButton104.Size = new System.Drawing.Size(65, 16);
228+ this.Tab2RadioButton104.TabIndex = 5;
229+ this.Tab2RadioButton104.Text = "101/104";
230+ this.Tab2RadioButton104.UseVisualStyleBackColor = true;
231+ this.Tab2RadioButton104.CheckedChanged += new System.EventHandler(this.Tab2RadioButton104_CheckedChanged);
232+ //
233+ // Tab2OldTextBox
234+ //
235+ this.Tab2OldTextBox.BackColor = System.Drawing.SystemColors.InactiveCaption;
236+ this.Tab2OldTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
237+ this.Tab2OldTextBox.Location = new System.Drawing.Point(25, 7);
238+ this.Tab2OldTextBox.Margin = new System.Windows.Forms.Padding(2);
239+ this.Tab2OldTextBox.Multiline = true;
240+ this.Tab2OldTextBox.Name = "Tab2OldTextBox";
241+ this.Tab2OldTextBox.ReadOnly = true;
242+ this.Tab2OldTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
243+ this.Tab2OldTextBox.Size = new System.Drawing.Size(395, 42);
244+ this.Tab2OldTextBox.TabIndex = 0;
245+ //
246+ // Tab2CancelButton
247+ //
248+ this.Tab2CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
249+ this.Tab2CancelButton.Location = new System.Drawing.Point(340, 248);
250+ this.Tab2CancelButton.Margin = new System.Windows.Forms.Padding(2);
251+ this.Tab2CancelButton.Name = "Tab2CancelButton";
252+ this.Tab2CancelButton.Size = new System.Drawing.Size(56, 18);
253+ this.Tab2CancelButton.TabIndex = 13;
254+ this.Tab2CancelButton.Text = "Cancel";
255+ this.Tab2CancelButton.UseVisualStyleBackColor = true;
256+ //
257+ // Tab2NewTextBox
258+ //
259+ this.Tab2NewTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
260+ this.Tab2NewTextBox.Location = new System.Drawing.Point(25, 53);
261+ this.Tab2NewTextBox.Margin = new System.Windows.Forms.Padding(2);
262+ this.Tab2NewTextBox.Multiline = true;
263+ this.Tab2NewTextBox.Name = "Tab2NewTextBox";
264+ this.Tab2NewTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
265+ this.Tab2NewTextBox.Size = new System.Drawing.Size(395, 42);
266+ this.Tab2NewTextBox.TabIndex = 1;
267+ //
268+ // Tab2AsterCheckBox
269+ //
270+ this.Tab2AsterCheckBox.AutoSize = true;
271+ this.Tab2AsterCheckBox.Checked = true;
272+ this.Tab2AsterCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
273+ this.Tab2AsterCheckBox.Location = new System.Drawing.Point(25, 233);
274+ this.Tab2AsterCheckBox.Margin = new System.Windows.Forms.Padding(2);
275+ this.Tab2AsterCheckBox.Name = "Tab2AsterCheckBox";
276+ this.Tab2AsterCheckBox.Size = new System.Drawing.Size(139, 16);
277+ this.Tab2AsterCheckBox.TabIndex = 4;
278+ this.Tab2AsterCheckBox.Text = "他のモディファイヤを無視";
279+ this.Tab2AsterCheckBox.UseVisualStyleBackColor = true;
280+ this.Tab2AsterCheckBox.CheckedChanged += new System.EventHandler(this.Tab2AsterCheckBoxCheckd);
281+ //
282+ // Tab2RightLabel
283+ //
284+ this.Tab2RightLabel.AutoSize = true;
285+ this.Tab2RightLabel.Location = new System.Drawing.Point(316, 97);
286+ this.Tab2RightLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
287+ this.Tab2RightLabel.Name = "Tab2RightLabel";
288+ this.Tab2RightLabel.Size = new System.Drawing.Size(25, 12);
289+ this.Tab2RightLabel.TabIndex = 10;
290+ this.Tab2RightLabel.Text = "キー";
291+ //
292+ // Tab2CenterLabel
293+ //
294+ this.Tab2CenterLabel.AutoSize = true;
295+ this.Tab2CenterLabel.Location = new System.Drawing.Point(178, 97);
296+ this.Tab2CenterLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
297+ this.Tab2CenterLabel.Name = "Tab2CenterLabel";
298+ this.Tab2CenterLabel.Size = new System.Drawing.Size(59, 12);
299+ this.Tab2CenterLabel.TabIndex = 7;
300+ this.Tab2CenterLabel.Text = "キーの種類";
301+ //
302+ // Tab2LeftLabel
303+ //
304+ this.Tab2LeftLabel.AutoSize = true;
305+ this.Tab2LeftLabel.Location = new System.Drawing.Point(28, 97);
306+ this.Tab2LeftLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
307+ this.Tab2LeftLabel.Name = "Tab2LeftLabel";
308+ this.Tab2LeftLabel.Size = new System.Drawing.Size(65, 12);
309+ this.Tab2LeftLabel.TabIndex = 2;
310+ this.Tab2LeftLabel.Text = "モディファイヤ";
311+ //
312+ // Tab2RightListBox
313+ //
314+ this.Tab2RightListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
315+ this.Tab2RightListBox.FormattingEnabled = true;
316+ this.Tab2RightListBox.ItemHeight = 12;
317+ this.Tab2RightListBox.Location = new System.Drawing.Point(316, 114);
318+ this.Tab2RightListBox.Margin = new System.Windows.Forms.Padding(2);
319+ this.Tab2RightListBox.Name = "Tab2RightListBox";
320+ this.Tab2RightListBox.Size = new System.Drawing.Size(105, 124);
321+ this.Tab2RightListBox.TabIndex = 11;
322+ this.Tab2RightListBox.SelectedIndexChanged += new System.EventHandler(this.Tab2RightListBoxItemCheck);
323+ //
324+ // Tab2CenterListBox
325+ //
326+ this.Tab2CenterListBox.BackColor = System.Drawing.SystemColors.Window;
327+ this.Tab2CenterListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
328+ this.Tab2CenterListBox.FormattingEnabled = true;
329+ this.Tab2CenterListBox.ItemHeight = 12;
330+ this.Tab2CenterListBox.Location = new System.Drawing.Point(178, 114);
331+ this.Tab2CenterListBox.Margin = new System.Windows.Forms.Padding(2);
332+ this.Tab2CenterListBox.Name = "Tab2CenterListBox";
333+ this.Tab2CenterListBox.Size = new System.Drawing.Size(105, 124);
334+ this.Tab2CenterListBox.TabIndex = 8;
335+ this.Tab2CenterListBox.SelectedIndexChanged += new System.EventHandler(this.Tab2CenterListBoxItemCheck);
336+ //
337+ // Tab2LeftCheckedListBox
338+ //
339+ this.Tab2LeftCheckedListBox.CheckOnClick = true;
340+ this.Tab2LeftCheckedListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
341+ this.Tab2LeftCheckedListBox.FormattingEnabled = true;
342+ this.Tab2LeftCheckedListBox.Location = new System.Drawing.Point(25, 114);
343+ this.Tab2LeftCheckedListBox.Margin = new System.Windows.Forms.Padding(2);
344+ this.Tab2LeftCheckedListBox.Name = "Tab2LeftCheckedListBox";
345+ this.Tab2LeftCheckedListBox.Size = new System.Drawing.Size(105, 102);
346+ this.Tab2LeftCheckedListBox.TabIndex = 3;
347+ this.Tab2LeftCheckedListBox.SelectedValueChanged += new System.EventHandler(this.Tab2LeftCheckedListBoxItemCheck);
348+ //
349+ // Tab2PrevButton
350+ //
351+ this.Tab2PrevButton.Location = new System.Drawing.Point(278, 248);
352+ this.Tab2PrevButton.Margin = new System.Windows.Forms.Padding(2);
353+ this.Tab2PrevButton.Name = "Tab2PrevButton";
354+ this.Tab2PrevButton.Size = new System.Drawing.Size(56, 18);
355+ this.Tab2PrevButton.TabIndex = 12;
356+ this.Tab2PrevButton.Text = "前";
357+ this.Tab2PrevButton.UseVisualStyleBackColor = true;
358+ this.Tab2PrevButton.Click += new System.EventHandler(this.Tab2PrevButton_Click);
359+ //
360+ // Tab2NextButton
361+ //
362+ this.Tab2NextButton.Location = new System.Drawing.Point(401, 248);
363+ this.Tab2NextButton.Margin = new System.Windows.Forms.Padding(2);
364+ this.Tab2NextButton.Name = "Tab2NextButton";
365+ this.Tab2NextButton.Size = new System.Drawing.Size(56, 18);
366+ this.Tab2NextButton.TabIndex = 14;
367+ this.Tab2NextButton.Text = "次";
368+ this.Tab2NextButton.UseVisualStyleBackColor = true;
369+ this.Tab2NextButton.Click += new System.EventHandler(this.Tab2NextButton_Click);
370+ //
371+ // tabPage3
372+ //
373+ this.tabPage3.Controls.Add(this.Tab3AddModeCheckBox);
374+ this.tabPage3.Controls.Add(this.Tab3OldTextBox);
375+ this.tabPage3.Controls.Add(this.Tab3LeftCheckedListBox);
376+ this.tabPage3.Controls.Add(this.Tab3CancelButton);
377+ this.tabPage3.Controls.Add(this.Tab3NewTextBox);
378+ this.tabPage3.Controls.Add(this.Tab3RightLabel);
379+ this.tabPage3.Controls.Add(this.Tab3CenterLabel);
380+ this.tabPage3.Controls.Add(this.Tab3LeftLabel);
381+ this.tabPage3.Controls.Add(this.Tab3RightListBox);
382+ this.tabPage3.Controls.Add(this.Tab3CenterListBox);
383+ this.tabPage3.Controls.Add(this.Tab3PrevButton);
384+ this.tabPage3.Controls.Add(this.Tab3OkButton);
385+ this.tabPage3.Location = new System.Drawing.Point(4, 25);
386+ this.tabPage3.Margin = new System.Windows.Forms.Padding(2);
387+ this.tabPage3.Name = "tabPage3";
388+ this.tabPage3.Padding = new System.Windows.Forms.Padding(2);
389+ this.tabPage3.Size = new System.Drawing.Size(458, 266);
390+ this.tabPage3.TabIndex = 2;
391+ this.tabPage3.Text = "変更後のキーバインド";
392+ this.tabPage3.UseVisualStyleBackColor = true;
393+ //
394+ // Tab3AddModeCheckBox
395+ //
396+ this.Tab3AddModeCheckBox.AutoSize = true;
397+ this.Tab3AddModeCheckBox.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
398+ this.Tab3AddModeCheckBox.Location = new System.Drawing.Point(25, 249);
399+ this.Tab3AddModeCheckBox.Name = "Tab3AddModeCheckBox";
400+ this.Tab3AddModeCheckBox.Size = new System.Drawing.Size(76, 16);
401+ this.Tab3AddModeCheckBox.TabIndex = 11;
402+ this.Tab3AddModeCheckBox.Text = "追加モード";
403+ this.Tab3AddModeCheckBox.UseVisualStyleBackColor = true;
404+ //
405+ // Tab3OldTextBox
406+ //
407+ this.Tab3OldTextBox.BackColor = System.Drawing.SystemColors.InactiveCaption;
408+ this.Tab3OldTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
409+ this.Tab3OldTextBox.Location = new System.Drawing.Point(25, 7);
410+ this.Tab3OldTextBox.Margin = new System.Windows.Forms.Padding(2);
411+ this.Tab3OldTextBox.Multiline = true;
412+ this.Tab3OldTextBox.Name = "Tab3OldTextBox";
413+ this.Tab3OldTextBox.ReadOnly = true;
414+ this.Tab3OldTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
415+ this.Tab3OldTextBox.Size = new System.Drawing.Size(395, 42);
416+ this.Tab3OldTextBox.TabIndex = 0;
417+ //
418+ // Tab3LeftCheckedListBox
419+ //
420+ this.Tab3LeftCheckedListBox.CheckOnClick = true;
421+ this.Tab3LeftCheckedListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
422+ this.Tab3LeftCheckedListBox.FormattingEnabled = true;
423+ this.Tab3LeftCheckedListBox.Location = new System.Drawing.Point(25, 114);
424+ this.Tab3LeftCheckedListBox.Margin = new System.Windows.Forms.Padding(2);
425+ this.Tab3LeftCheckedListBox.Name = "Tab3LeftCheckedListBox";
426+ this.Tab3LeftCheckedListBox.Size = new System.Drawing.Size(105, 102);
427+ this.Tab3LeftCheckedListBox.TabIndex = 3;
428+ this.Tab3LeftCheckedListBox.SelectedValueChanged += new System.EventHandler(this.Tab3LeftCheckedListBoxItemCheck);
429+ //
430+ // Tab3CancelButton
431+ //
432+ this.Tab3CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
433+ this.Tab3CancelButton.Location = new System.Drawing.Point(340, 248);
434+ this.Tab3CancelButton.Margin = new System.Windows.Forms.Padding(2);
435+ this.Tab3CancelButton.Name = "Tab3CancelButton";
436+ this.Tab3CancelButton.Size = new System.Drawing.Size(56, 18);
437+ this.Tab3CancelButton.TabIndex = 9;
438+ this.Tab3CancelButton.Text = "Cancel";
439+ this.Tab3CancelButton.UseVisualStyleBackColor = true;
440+ //
441+ // Tab3NewTextBox
442+ //
443+ this.Tab3NewTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
444+ this.Tab3NewTextBox.Location = new System.Drawing.Point(25, 53);
445+ this.Tab3NewTextBox.Margin = new System.Windows.Forms.Padding(2);
446+ this.Tab3NewTextBox.Multiline = true;
447+ this.Tab3NewTextBox.Name = "Tab3NewTextBox";
448+ this.Tab3NewTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
449+ this.Tab3NewTextBox.Size = new System.Drawing.Size(395, 42);
450+ this.Tab3NewTextBox.TabIndex = 1;
451+ //
452+ // Tab3RightLabel
453+ //
454+ this.Tab3RightLabel.AutoSize = true;
455+ this.Tab3RightLabel.Location = new System.Drawing.Point(316, 97);
456+ this.Tab3RightLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
457+ this.Tab3RightLabel.Name = "Tab3RightLabel";
458+ this.Tab3RightLabel.Size = new System.Drawing.Size(25, 12);
459+ this.Tab3RightLabel.TabIndex = 6;
460+ this.Tab3RightLabel.Text = "キー";
461+ //
462+ // Tab3CenterLabel
463+ //
464+ this.Tab3CenterLabel.AutoSize = true;
465+ this.Tab3CenterLabel.Location = new System.Drawing.Point(178, 97);
466+ this.Tab3CenterLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
467+ this.Tab3CenterLabel.Name = "Tab3CenterLabel";
468+ this.Tab3CenterLabel.Size = new System.Drawing.Size(59, 12);
469+ this.Tab3CenterLabel.TabIndex = 4;
470+ this.Tab3CenterLabel.Text = "キーの種類";
471+ //
472+ // Tab3LeftLabel
473+ //
474+ this.Tab3LeftLabel.AutoSize = true;
475+ this.Tab3LeftLabel.Location = new System.Drawing.Point(28, 97);
476+ this.Tab3LeftLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
477+ this.Tab3LeftLabel.Name = "Tab3LeftLabel";
478+ this.Tab3LeftLabel.Size = new System.Drawing.Size(65, 12);
479+ this.Tab3LeftLabel.TabIndex = 2;
480+ this.Tab3LeftLabel.Text = "モディファイヤ";
481+ //
482+ // Tab3RightListBox
483+ //
484+ this.Tab3RightListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
485+ this.Tab3RightListBox.FormattingEnabled = true;
486+ this.Tab3RightListBox.ItemHeight = 12;
487+ this.Tab3RightListBox.Location = new System.Drawing.Point(316, 114);
488+ this.Tab3RightListBox.Margin = new System.Windows.Forms.Padding(2);
489+ this.Tab3RightListBox.Name = "Tab3RightListBox";
490+ this.Tab3RightListBox.Size = new System.Drawing.Size(105, 124);
491+ this.Tab3RightListBox.TabIndex = 7;
492+ this.Tab3RightListBox.SelectedIndexChanged += new System.EventHandler(this.Tab3RightListBoxItemCheck);
493+ //
494+ // Tab3CenterListBox
495+ //
496+ this.Tab3CenterListBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
497+ this.Tab3CenterListBox.FormattingEnabled = true;
498+ this.Tab3CenterListBox.ItemHeight = 12;
499+ this.Tab3CenterListBox.Location = new System.Drawing.Point(178, 114);
500+ this.Tab3CenterListBox.Margin = new System.Windows.Forms.Padding(2);
501+ this.Tab3CenterListBox.Name = "Tab3CenterListBox";
502+ this.Tab3CenterListBox.Size = new System.Drawing.Size(105, 124);
503+ this.Tab3CenterListBox.TabIndex = 5;
504+ this.Tab3CenterListBox.SelectedIndexChanged += new System.EventHandler(this.Tab3CenterListBoxItemCheck);
505+ //
506+ // Tab3PrevButton
507+ //
508+ this.Tab3PrevButton.Location = new System.Drawing.Point(278, 248);
509+ this.Tab3PrevButton.Margin = new System.Windows.Forms.Padding(2);
510+ this.Tab3PrevButton.Name = "Tab3PrevButton";
511+ this.Tab3PrevButton.Size = new System.Drawing.Size(56, 18);
512+ this.Tab3PrevButton.TabIndex = 8;
513+ this.Tab3PrevButton.Text = "前";
514+ this.Tab3PrevButton.UseVisualStyleBackColor = true;
515+ this.Tab3PrevButton.Click += new System.EventHandler(this.Tab3PrevButton_Click);
516+ //
517+ // Tab3OkButton
518+ //
519+ this.Tab3OkButton.DialogResult = System.Windows.Forms.DialogResult.OK;
520+ this.Tab3OkButton.Location = new System.Drawing.Point(401, 248);
521+ this.Tab3OkButton.Margin = new System.Windows.Forms.Padding(2);
522+ this.Tab3OkButton.Name = "Tab3OkButton";
523+ this.Tab3OkButton.Size = new System.Drawing.Size(56, 18);
524+ this.Tab3OkButton.TabIndex = 10;
525+ this.Tab3OkButton.Text = "OK";
526+ this.Tab3OkButton.UseVisualStyleBackColor = true;
527+ this.Tab3OkButton.Click += new System.EventHandler(this.Tab3OkButton_Click);
528+ //
529+ // statusStrip1
530+ //
531+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
532+ this.FormInsertStatusLabel,
533+ this.FormInsertStatusLabel2});
534+ this.statusStrip1.Location = new System.Drawing.Point(0, 298);
535+ this.statusStrip1.Name = "statusStrip1";
536+ this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
537+ this.statusStrip1.Size = new System.Drawing.Size(464, 23);
538+ this.statusStrip1.TabIndex = 1;
539+ //
540+ // FormInsertStatusLabel
541+ //
542+ this.FormInsertStatusLabel.Name = "FormInsertStatusLabel";
543+ this.FormInsertStatusLabel.Size = new System.Drawing.Size(272, 18);
544+ this.FormInsertStatusLabel.Text = "コマンドを選択して説明文の入力してください。";
545+ //
546+ // FormInsertStatusLabel2
547+ //
548+ this.FormInsertStatusLabel2.Name = "FormInsertStatusLabel2";
549+ this.FormInsertStatusLabel2.Size = new System.Drawing.Size(0, 18);
550+ //
551+ // commandWizard
552+ //
553+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
554+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
555+ this.CancelButton = this.Tab1CancelButton;
556+ this.ClientSize = new System.Drawing.Size(464, 321);
557+ this.Controls.Add(this.statusStrip1);
558+ this.Controls.Add(this.tabControl1);
559+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
560+ this.Margin = new System.Windows.Forms.Padding(2);
561+ this.Name = "commandWizard";
562+ this.Text = "コマンドWizard";
563+ this.Load += new System.EventHandler(this.FormInsert_Load);
564+ this.tabControl1.ResumeLayout(false);
565+ this.tabPage1.ResumeLayout(false);
566+ this.tabPage1.PerformLayout();
567+ this.tabPage2.ResumeLayout(false);
568+ this.tabPage2.PerformLayout();
569+ this.tabPage3.ResumeLayout(false);
570+ this.tabPage3.PerformLayout();
571+ this.statusStrip1.ResumeLayout(false);
572+ this.statusStrip1.PerformLayout();
573+ this.ResumeLayout(false);
574+ this.PerformLayout();
575+
576+ }
577+
578+ #endregion
579+
580+ private System.Windows.Forms.TabControl tabControl1;
581+ private System.Windows.Forms.TabPage tabPage1;
582+ private System.Windows.Forms.TabPage tabPage2;
583+ private System.Windows.Forms.StatusStrip statusStrip1;
584+ private System.Windows.Forms.TabPage tabPage3;
585+ private System.Windows.Forms.ListBox Tab1CommandListBox;
586+ private System.Windows.Forms.Button Tab1NextButton;
587+ private System.Windows.Forms.ListBox Tab2CenterListBox;
588+ private System.Windows.Forms.CheckedListBox Tab2LeftCheckedListBox;
589+ private System.Windows.Forms.Button Tab2PrevButton;
590+ private System.Windows.Forms.Button Tab2NextButton;
591+ private System.Windows.Forms.Button Tab3PrevButton;
592+ private System.Windows.Forms.Button Tab3OkButton;
593+ private System.Windows.Forms.Label Tab1CommandLabel;
594+ private System.Windows.Forms.TextBox Tab2NewTextBox;
595+ private System.Windows.Forms.CheckBox Tab2AsterCheckBox;
596+ private System.Windows.Forms.Label Tab2RightLabel;
597+ private System.Windows.Forms.Label Tab2CenterLabel;
598+ private System.Windows.Forms.Label Tab2LeftLabel;
599+ private System.Windows.Forms.ListBox Tab2RightListBox;
600+ private System.Windows.Forms.TextBox Tab3NewTextBox;
601+ private System.Windows.Forms.Label Tab3RightLabel;
602+ private System.Windows.Forms.Label Tab3CenterLabel;
603+ private System.Windows.Forms.Label Tab3LeftLabel;
604+ private System.Windows.Forms.ListBox Tab3RightListBox;
605+ private System.Windows.Forms.ListBox Tab3CenterListBox;
606+ private System.Windows.Forms.Button Tab1CancelButton;
607+ private System.Windows.Forms.Button Tab2CancelButton;
608+ private System.Windows.Forms.Button Tab3CancelButton;
609+ private System.Windows.Forms.CheckedListBox Tab3LeftCheckedListBox;
610+ private System.Windows.Forms.RadioButton Tab2RadioButton109;
611+ private System.Windows.Forms.RadioButton Tab2RadioButton104;
612+ private System.Windows.Forms.TextBox Tab2OldTextBox;
613+ private System.Windows.Forms.TextBox Tab3OldTextBox;
614+ private System.Windows.Forms.CheckBox Tab3AddModeCheckBox;
615+ private System.Windows.Forms.TextBox Tab1CaptionTextBox;
616+ private System.Windows.Forms.Label Tab1CaptionLabel;
617+ private System.Windows.Forms.ToolStripStatusLabel FormInsertStatusLabel;
618+ private System.Windows.Forms.Button SelectFileButton;
619+ private System.Windows.Forms.ToolStripStatusLabel FormInsertStatusLabel2;
620+ }
621+}
\ No newline at end of file
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormInsert.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormInsert.cs (revision 228)
@@ -0,0 +1,914 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Windows.Forms;
9+using System.Diagnostics; // for Debug.WriteLine
10+using System.IO;
11+using Microsoft.Win32; // Path
12+
13+
14+namespace nodokaGuiEdit
15+{
16+ public partial class commandWizard : Form
17+ {
18+ public FormMain formMain;
19+ public commandWizard(int commandNumber)
20+ {
21+ InitializeComponent();
22+
23+ Global_Val.status = false;
24+ Global_Val.commandNumber = commandNumber;
25+
26+ // keyの時は下記でよいが、他では違う可能性がある。
27+ Debug.WriteLine("wizardModeNew:" + FormMain.Global_Val.wizardModeNew.ToString());
28+ Debug.WriteLine("caption:" + FormMain.Global_Val.caption);
29+ if (FormMain.Global_Val.wizardModeNew == true) // 新規
30+ {
31+ Tab1CaptionTextBox.Text = mode_name[commandNumber];
32+ Global_Val.reWizardFirst = false;
33+ Debug.WriteLine("new \"" + Tab1CaptionTextBox.Text + "\"");
34+ }
35+ else
36+ {
37+ Tab1CaptionTextBox.Text = FormMain.Global_Val.caption;
38+ Global_Val.reWizardFirst = true;
39+ }
40+ Tab2NewTextBox.Text = FormMain.Global_Val.LeftString;
41+ Tab3NewTextBox.Text = FormMain.Global_Val.RightString;
42+ Tab2OldTextBox.Text = FormMain.Global_Val.LeftString;
43+ Tab3OldTextBox.Text = FormMain.Global_Val.RightString;
44+
45+ // タブが変更された時のイベントハンドラー
46+ tabControl1.SelectedIndexChanged += new EventHandler(TabControl1_SelectedIndexChanged);
47+ }
48+
49+ private void FormInsert_Load(object sender, EventArgs e)
50+ {
51+ // tabPage1 listboxの初期化
52+ this.Tab1CommandListBox.ClearSelected();
53+ this.Tab1CommandListBox.Items.AddRange(mode_list);
54+ this.Tab1CommandListBox.SelectedIndex = Global_Val.commandNumber;
55+ Global_Val.firstView = true;
56+ Global_Val.caption = String.Empty;
57+ Global_Val.leftString = String.Empty;
58+ Global_Val.rightString = String.Empty;
59+ Global_Val.left_mod = String.Empty;
60+ Global_Val.left_key = String.Empty;
61+ Global_Val.right_mod = String.Empty;
62+ Global_Val.right_key = String.Empty;
63+
64+ Reg104Read();
65+ }
66+
67+ private void Reg104Read()
68+ {
69+ // のどかインストール時に設定された104 layout状態を取り出す。
70+ this.Tab2RadioButton104.Enabled = true;
71+ this.Tab2RadioButton109.Enabled = true;
72+
73+ string stringValue = string.Empty;
74+
75+ RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\appletkan\\nodoka", false);
76+ if (rk != null)
77+ {
78+ stringValue = (string)rk.GetValue("layout");
79+ }
80+
81+ // system user104 user109 resurt
82+ // null false false 109
83+ // 104 false false 104
84+ // 109 false false 109
85+ // * true false 104
86+ // * false true 109
87+
88+ // システム側 null だった場合、user側どちらが trueなら、その値を使う。
89+ if (stringValue == string.Empty)
90+ {
91+ if(readRegbUser104() == false && readRegbUser109() == false)
92+ {
93+ this.Tab2RadioButton104.Checked = false;
94+ }
95+ if(readRegbUser104() == true && readRegbUser109() == false)
96+ {
97+ this.Tab2RadioButton104.Checked = true;
98+ }
99+ if(readRegbUser104() == false && readRegbUser109() == true)
100+ {
101+ this.Tab2RadioButton104.Checked = false;
102+ }
103+ }
104+
105+ if (stringValue == "104")
106+ {
107+ if (readRegbUser104() == false && readRegbUser109() == false)
108+ {
109+ this.Tab2RadioButton104.Checked = true;
110+ }
111+ if (readRegbUser104() == true && readRegbUser109() == false)
112+ {
113+ this.Tab2RadioButton104.Checked = true;
114+ }
115+ if (readRegbUser104() == false && readRegbUser109() == true)
116+ {
117+ this.Tab2RadioButton104.Checked = false;
118+ }
119+ }
120+
121+ if (stringValue == "109")
122+ {
123+ if (readRegbUser104() == false && readRegbUser109() == false)
124+ {
125+ this.Tab2RadioButton104.Checked = false;
126+ }
127+ if (readRegbUser104() == true && readRegbUser109() == false)
128+ {
129+ this.Tab2RadioButton104.Checked = true;
130+ }
131+ if (readRegbUser104() == false && readRegbUser109() == true)
132+ {
133+ this.Tab2RadioButton104.Checked = false;
134+ }
135+ }
136+ }
137+
138+
139+ private bool readRegbUser104()
140+ {
141+ string stringValue = String.Empty;
142+
143+ // ユーザによるラジオボタン設定状態を取り出す
144+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
145+ if (rk != null)
146+ {
147+ stringValue = (string)rk.GetValue("bUser104");
148+ }
149+
150+ if (stringValue == "true")
151+ {
152+ return true;
153+ }
154+ else
155+ {
156+ return false;
157+ }
158+ }
159+
160+ private bool readRegbUser109()
161+ {
162+ string stringValue = String.Empty;
163+
164+ // ユーザによるラジオボタン設定状態を取り出す
165+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
166+ if (rk != null)
167+ {
168+ stringValue = (string)rk.GetValue("bUser104");
169+ }
170+
171+ if (stringValue == "false")
172+ {
173+ return true;
174+ }
175+ else
176+ {
177+ return false;
178+ }
179+ }
180+
181+ private void setRegbUser104(bool bStatus)
182+ {
183+ // ユーザによるラジオボタン状態を保存。
184+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
185+
186+ if (rk != null)
187+ {
188+ if (bStatus == true)
189+ {
190+ rk.SetValue("bUser104", "true");
191+ }
192+ else
193+ {
194+ rk.SetValue("bUser104", "false");
195+ }
196+ }
197+ }
198+
199+ // Windowを閉じる処理
200+ private void closeMyDialog()
201+ {
202+ Global_Val.caption = Tab1CaptionTextBox.Text.TrimEnd(null);
203+ Global_Val.leftString = Tab2NewTextBox.Text.TrimEnd(null);
204+ Global_Val.rightString = Tab3NewTextBox.Text.TrimEnd(null);
205+ Global_Val.status = true;
206+ this.Close();
207+ }
208+
209+ private void Tab3OkButton_Click(object sender, EventArgs e)
210+ {
211+ // 3rd tab OK
212+ closeMyDialog();
213+ }
214+
215+ // Wizard的ボタン実装
216+ private void Tab1NextButton_Click(object sender, EventArgs e)
217+ {
218+ // tabPage1 Next Button
219+ this.tabControl1.SelectedTab = tabPage2;
220+ }
221+
222+ private void Tab2PrevButton_Click(object sender, EventArgs e)
223+ {
224+ // tabPage2 Priv Button
225+ this.tabControl1.SelectedTab = tabPage1;
226+ }
227+
228+ private void Tab2NextButton_Click(object sender, EventArgs e)
229+ {
230+ // tabPage2 Next Button
231+ if (Global_Val.commandNumber == 4) // include
232+ {
233+ // includeではTab2の次ボタンは、OKに変えてあるので
234+ // Tab3を表示せずに閉じる。
235+ closeMyDialog();
236+ }
237+ else
238+ {
239+ this.tabControl1.SelectedTab = tabPage3;
240+ }
241+ }
242+
243+ private void Tab3PrevButton_Click(object sender, EventArgs e)
244+ {
245+ // tabPage3 Priv Button
246+ this.tabControl1.SelectedTab = tabPage2;
247+ }
248+
249+ // tabPage1の実装 Wizardのモード番号を取得する。
250+ private void Tab1CommandListBox_SelectedIndexChanged(object sender, EventArgs e)
251+ {
252+ Global_Val.commandNumber = Tab1CommandListBox.SelectedIndex;
253+ if (Global_Val.reWizardFirst == true)
254+ {
255+ Global_Val.reWizardFirst = false;
256+ }
257+ else
258+ {
259+ Tab1CaptionTextBox.Text = mode_name[Global_Val.commandNumber]; // 再Wizardでもコマンド変更された場合
260+ }
261+ }
262+
263+ // タブが変更されたときにモード番号ごとに表示内容の初期化
264+ private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
265+ {
266+ // タブが変更された時のイベントハンドラー
267+ Debug.WriteLine("current tab = " + tabControl1.SelectedTab.Name.ToString());
268+
269+ // 表示されているタブにおいて、通知領域をコマンドごとに初期化する。
270+ switch (tabControl1.SelectedIndex)
271+ {
272+ case 0: // タブ1
273+ this.FormInsertStatusLabel.Text = "コマンドを選択して説明文の入力してください。";
274+ break;
275+ case 1: // タブ2
276+ switch (Global_Val.commandNumber)
277+ {
278+ case 0: // keymap
279+ this.FormInsertStatusLabel.Text = "キーマップ名の入力してください。";
280+ break;
281+ case 1: // key
282+ this.FormInsertStatusLabel.Text = "変更前のキーバインドを入力してください。";
283+ Reg104Read();
284+ break;
285+ case 2: // mod
286+ this.FormInsertStatusLabel.Text = "設定を変更したいモディファイヤ種別を選択してください。";
287+ Reg104Read();
288+ break;
289+ case 3: // window
290+ break;
291+ case 4: // include
292+ this.FormInsertStatusLabel.Text = "読み込ませるファイル名を指定してください。";
293+ break;
294+ case 5: // def option
295+ break;
296+ case 6: // def key
297+ break;
298+ case 7: // other
299+ break;
300+ default:
301+ this.FormInsertStatusLabel.Text = string.Empty;
302+ break;
303+ }
304+ break;
305+ case 2: // タブ3
306+ switch (Global_Val.commandNumber)
307+ {
308+ case 0: // keymap
309+ this.FormInsertStatusLabel.Text = "親キーマップ名を入力してください。";
310+ break;
311+ case 1: // key
312+ this.FormInsertStatusLabel.Text = "変更後のキーバインドを入力してください。";
313+ break;
314+ case 2: // mod
315+ this.FormInsertStatusLabel.Text = "モディファイヤに追加/削除したいキーを選択してください。";
316+ break;
317+ case 3: // window
318+ break;
319+ case 4: // include
320+ this.FormInsertStatusLabel.Text = string.Empty;
321+ break;
322+ case 5: // def option
323+ break;
324+ case 6: // def key
325+ break;
326+ case 7: // other
327+ break;
328+ default:
329+ this.FormInsertStatusLabel.Text = string.Empty;
330+ break;
331+ }
332+ break;
333+ default:
334+ this.FormInsertStatusLabel.Text = string.Empty;
335+ break;
336+ }
337+
338+ // コマンドに応じてタブ2,3を初期化する。
339+
340+ // ファイル名選択ボタンを無効にして隠す。
341+ this.SelectFileButton.Enabled = false;
342+ this.SelectFileButton.Visible = false;
343+
344+ switch (Global_Val.commandNumber)
345+ {
346+ case 0: // keymap
347+ // 必要なコントロールを有効にして、他は無効にすること。
348+ // 文言も変更する必要がある。
349+ this.tabControl1.TabPages[1].Text = "キーマップ名";
350+ this.tabControl1.TabPages[2].Text = "親キーマップ名";
351+
352+ this.Tab2LeftLabel.Text = "キーマップ名";
353+ this.Tab2LeftCheckedListBox.Items.Clear();
354+ this.Tab2LeftCheckedListBox.Items.AddRange(keymapGlobal);
355+
356+ this.Tab2AsterCheckBox.Text = string.Empty;
357+ this.Tab2AsterCheckBox.Enabled = false;
358+ this.Tab2AsterCheckBox.Visible = false;
359+
360+ this.Tab2CenterLabel.Text = string.Empty;
361+ this.Tab2RightLabel.Text = string.Empty;
362+ this.Tab2CenterListBox.Items.Clear();
363+ this.Tab2RightListBox.Items.Clear();
364+ this.Tab2CenterListBox.Enabled = false;
365+ this.Tab2RightListBox.Enabled = false;
366+
367+ this.Tab2RadioButton104.Text = string.Empty;
368+ this.Tab2RadioButton109.Text = string.Empty;
369+ this.Tab2RadioButton104.Enabled = false;
370+ this.Tab2RadioButton109.Enabled = false;
371+ this.Tab2RadioButton104.Visible = false;
372+ this.Tab2RadioButton109.Visible = false;
373+
374+ this.Tab2NextButton.Text = "次";
375+
376+ this.Tab3LeftLabel.Text = "親キーマップ名";
377+ this.Tab3LeftCheckedListBox.Items.Clear();
378+ this.Tab3LeftCheckedListBox.Items.AddRange(keymapGlobal);
379+
380+
381+ this.Tab3CenterLabel.Text = string.Empty;
382+ this.Tab3RightLabel.Text = string.Empty;
383+ this.Tab3CenterListBox.Items.Clear();
384+ this.Tab3RightListBox.Items.Clear();
385+ this.Tab3CenterListBox.Enabled = false;
386+ this.Tab3RightListBox.Enabled = false;
387+
388+ this.Tab3AddModeCheckBox.Text = string.Empty;
389+ this.Tab3AddModeCheckBox.Enabled = false;
390+ this.Tab3AddModeCheckBox.Visible = false;
391+ break;
392+
393+ case 1: // key
394+ // tab2
395+ this.tabControl1.TabPages[1].Text = "変更前のキーバインド";
396+ this.tabControl1.TabPages[2].Text = "変更後のキーバインド";
397+ this.Tab2LeftLabel.Text = "モディファイヤ";
398+ this.Tab2CenterLabel.Text = "キーの種類";
399+ this.Tab2RightLabel.Text = "キー";
400+ this.Tab2AsterCheckBox.Text = "他のモディファイヤを無視";
401+ this.Tab2RadioButton104.Text = "101/104";
402+ this.Tab2RadioButton109.Text = "106/109";
403+ Reg104Read();
404+ this.Tab3LeftLabel.Text = "モディファイヤ";
405+ this.Tab3CenterLabel.Text = "キーの種類";
406+ this.Tab3RightLabel.Text = "キー";
407+ this.Tab3AddModeCheckBox.Text = "追加モード";
408+ this.Tab3AddModeCheckBox.Enabled = true;
409+ this.Tab2NextButton.Text = "次";
410+
411+
412+ if (Global_Val.firstView == true) // 下記、本当にfirstViewの時に必要な処理だけにして、残りは上にあげる。
413+ {
414+ Global_Val.firstView = false;
415+ this.Tab2AsterCheckBox.Enabled = true;
416+ this.Tab2AsterCheckBox.Checked = true;
417+ this.Tab2AsterCheckBox.Visible = true;
418+
419+ Global_Val.aster = "*";
420+
421+ Reg104Read();
422+
423+ this.Tab2LeftCheckedListBox.Items.Clear();
424+ this.Tab2LeftCheckedListBox.Items.AddRange(mods_list);
425+ //this.checkedListBox1.SetSelected(0, true); // 初期状態では「無し」をチェックする。
426+ //this.checkedListBox1.SetItemChecked(0, true); // 同様
427+
428+ this.Tab2CenterListBox.Enabled = true;
429+ this.Tab2RightListBox.Enabled = true;
430+
431+ this.Tab2CenterListBox.Items.Clear();
432+ this.Tab2RightListBox.Items.Clear();
433+ if (this.Tab2RadioButton104.Checked == true)
434+ { // 101/104
435+ this.Tab2CenterListBox.Items.AddRange(key_cat104);
436+ this.Tab2CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
437+ this.Tab2RightListBox.Items.AddRange(key_104[0]); // 0「英字」をloadする。
438+ }
439+ else
440+ { // 106/109
441+ this.Tab2CenterListBox.Items.AddRange(key_cat109);
442+ this.Tab2CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
443+ this.Tab2RightListBox.Items.AddRange(key_109[0]); // 0「英字」をloadする。
444+ }
445+
446+ // tab3
447+ this.Tab3LeftCheckedListBox.Items.Clear();
448+ this.Tab3LeftCheckedListBox.Items.AddRange(mods_list);
449+ //this.checkedListBox2.SetSelected(0, true); // 初期状態では「無し」をチェックする。
450+ //this.checkedListBox2.SetItemChecked(0, true); // 同様
451+
452+ this.Tab3CenterListBox.Enabled = true;
453+ this.Tab3RightListBox.Enabled = true;
454+
455+ this.Tab3CenterListBox.Items.Clear();
456+ this.Tab3RightListBox.Items.Clear();
457+
458+ if (this.Tab2RadioButton104.Checked == true)
459+ { // 101/104
460+ this.Tab3CenterListBox.Items.AddRange(key_cat104);
461+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
462+ this.Tab3RightListBox.Items.AddRange(key_104[0]); // 0「英字」をloadする。
463+ }
464+ else
465+ {
466+ this.Tab3CenterListBox.Items.AddRange(key_cat109);
467+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
468+ this.Tab3RightListBox.Items.AddRange(key_109[0]); // 0「英字」をloadする。
469+ }
470+
471+ this.Tab3AddModeCheckBox.Checked = false; // 追加モードはクリア
472+ if (FormMain.Global_Val.addMode == true)
473+ {
474+ this.Tab3AddModeCheckBox.Checked = true; // ただし再Wizardで開いた時には、追加モードにする。
475+ }
476+
477+ Global_Val.right_mod = string.Empty; // 初期化しておかないと追加モード時に一度も選択しないときに初期化されない。
478+ }
479+ break;
480+ case 2: // mod
481+ // 必要なコントロールを有効にして、他は無効にすること。
482+ // 文言も変更する必要がある。
483+ this.tabControl1.TabPages[1].Text = "モディファイヤ種別の選択";
484+ this.tabControl1.TabPages[2].Text = "モディファイヤに設定するキー";
485+
486+ this.Tab2LeftLabel.Text = string.Empty;;
487+ this.Tab2LeftCheckedListBox.Items.Clear();
488+ //this.Tab2LeftCheckedListBox.Items.AddRange(keymapGlobal);
489+
490+ this.Tab2AsterCheckBox.Text = string.Empty;
491+ this.Tab2AsterCheckBox.Enabled = false;
492+ this.Tab2AsterCheckBox.Visible = false;
493+
494+ this.Tab2CenterLabel.Text = "モディファイヤ";
495+ this.Tab2RightLabel.Text = string.Empty;
496+ this.Tab2CenterListBox.Items.Clear();
497+ this.Tab2CenterListBox.Items.AddRange(modifier);
498+ this.Tab2RightListBox.Items.Clear();
499+ this.Tab2RightListBox.Items.AddRange(modifier_mode_name);
500+
501+ this.Tab2CenterListBox.Enabled = true;
502+ this.Tab2RightListBox.Enabled = true;
503+
504+ this.Tab2RadioButton104.Text = "101/104";
505+ this.Tab2RadioButton109.Text = "106/109";
506+ Reg104Read();
507+
508+ this.Tab2NextButton.Text = "次";
509+
510+ this.Tab3LeftLabel.Text = "モディファイヤ種別";
511+ this.Tab3LeftCheckedListBox.Items.Clear();
512+ this.Tab3LeftCheckedListBox.Items.AddRange(modifier_cat_name);
513+
514+
515+ this.Tab3CenterLabel.Text = string.Empty;
516+ this.Tab3RightLabel.Text = string.Empty;
517+ this.Tab3CenterListBox.Items.Clear();
518+ this.Tab3RightListBox.Items.Clear();
519+ this.Tab3CenterListBox.Enabled = true;
520+ this.Tab3RightListBox.Enabled = true;
521+
522+ this.Tab3AddModeCheckBox.Text = string.Empty;
523+ this.Tab3AddModeCheckBox.Enabled = false;
524+ this.Tab3AddModeCheckBox.Visible = false;
525+
526+ if (this.Tab2RadioButton104.Checked == true)
527+ { // 101/104
528+ this.Tab3CenterListBox.Items.AddRange(key_cat104);
529+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
530+ this.Tab3RightListBox.Items.AddRange(key_104[0]); // 0「英字」をloadする。
531+ }
532+ else
533+ {
534+ this.Tab3CenterListBox.Items.AddRange(key_cat109);
535+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
536+ this.Tab3RightListBox.Items.AddRange(key_109[0]); // 0「英字」をloadする。
537+ }
538+
539+ break;
540+ case 3: // window
541+ break;
542+ case 4: // include
543+ // ファイル名選択ボタンを有効にして見えるようにする。
544+ this.SelectFileButton.Enabled = true;
545+ this.SelectFileButton.Visible = true;
546+
547+ this.tabControl1.TabPages[1].Text = "読み込ませるファイル名";
548+ this.tabControl1.TabPages[2].Text = String.Empty;
549+ this.Tab2LeftLabel.Text = String.Empty;
550+ this.Tab2CenterLabel.Text = "デフォルト設定ファイル";
551+ this.Tab2RightLabel.Text = String.Empty;
552+
553+ this.Tab2AsterCheckBox.Text = String.Empty;
554+ this.Tab2AsterCheckBox.Enabled = false;
555+ this.Tab2AsterCheckBox.Checked = false;
556+ this.Tab2AsterCheckBox.Visible = false;
557+
558+ this.Tab2LeftCheckedListBox.Enabled = false;
559+ this.Tab2LeftCheckedListBox.Items.Clear();
560+ this.Tab2CenterListBox.Enabled = true;
561+ this.Tab2CenterListBox.Items.Clear();
562+ this.Tab2CenterListBox.Items.AddRange(includeFileList);
563+ this.Tab2RightListBox.Enabled = false;
564+ this.Tab2RightListBox.Items.Clear();
565+
566+ this.Tab2NextButton.Text = "OK";
567+
568+ this.Tab2RadioButton104.Text = String.Empty;
569+ this.Tab2RadioButton109.Text = String.Empty;
570+ this.Tab2RadioButton109.Checked = false;
571+ this.Tab2RadioButton104.Enabled = false;
572+ this.Tab2RadioButton109.Enabled = false;
573+ this.Tab2RadioButton104.Visible = false;
574+ this.Tab2RadioButton109.Visible = false;
575+
576+ this.Tab3LeftLabel.Text = String.Empty;
577+ this.Tab3CenterLabel.Text = String.Empty;
578+ this.Tab3RightLabel.Text = String.Empty;
579+
580+ this.Tab3LeftCheckedListBox.Enabled = false;
581+ this.Tab3LeftCheckedListBox.Items.Clear();
582+ this.Tab3CenterListBox.Enabled = false;
583+ this.Tab3CenterListBox.Items.Clear();
584+ this.Tab3RightListBox.Enabled = false;
585+ this.Tab3RightListBox.Items.Clear();
586+
587+ this.Tab3AddModeCheckBox.Text = String.Empty;
588+ this.Tab3AddModeCheckBox.Enabled = false;
589+ this.Tab3AddModeCheckBox.Visible = false;
590+
591+ break;
592+ case 5: // def option
593+ break;
594+ case 6: // def key
595+ break;
596+ case 7: // other
597+ break;
598+ default:
599+ break;
600+ }
601+
602+ }
603+
604+ // tabPage2 の実装
605+ private void Tab2LeftCheckedListBoxItemCheck(object sender, EventArgs e)
606+ {
607+ Global_Val.left_mod = String.Empty;
608+ switch (Global_Val.commandNumber)
609+ {
610+ case 0: // keymap
611+ if (Tab2LeftCheckedListBox.GetItemChecked(0))
612+ {
613+ Debug.WriteLine(Tab2LeftCheckedListBox.GetItemChecked(0).ToString());
614+ Global_Val.left_mod += "Global";
615+ }
616+ break;
617+ case 1: // key
618+ for (int i = 0; i < Tab2LeftCheckedListBox.Items.Count; i++)
619+ {
620+ if (Tab2LeftCheckedListBox.GetItemChecked(i))
621+ {
622+ Debug.WriteLine(Tab2LeftCheckedListBox.GetItemChecked(i).ToString());
623+ Global_Val.left_mod += mods_text[i];
624+ }
625+ }
626+ break;
627+ default:
628+ break;
629+ }
630+ SetLeftEditBox();
631+ }
632+
633+ // tab2のcenter
634+ private void Tab2CenterListBoxItemCheck(object sender, EventArgs e)
635+ {
636+ switch (Global_Val.commandNumber)
637+ {
638+ case 1: // key
639+ this.Tab2RightListBox.Items.Clear();
640+ if (this.Tab2RadioButton104.Checked == true)
641+ {
642+ this.Tab2RightListBox.Items.AddRange(key_104[Tab2CenterListBox.SelectedIndex]); // Centerのチェック位置でRightのlistBoxロードし直す。
643+ }
644+ else
645+ {
646+ this.Tab2RightListBox.Items.AddRange(key_109[Tab2CenterListBox.SelectedIndex]); // Centerのチェック位置でRightのlistBoxロードし直す。
647+ }
648+ break;
649+ case 2: // mod
650+ Global_Val.left_mod = this.Tab2CenterListBox.Text;
651+ SetLeftEditBox();
652+ break;
653+ case 4: // include
654+ Global_Val.left_mod = this.Tab2CenterListBox.Text;
655+ SetLeftEditBox();
656+ break;
657+ }
658+
659+ }
660+
661+ // tab2のright
662+ private void Tab2RightListBoxItemCheck(object sender, EventArgs e)
663+ {
664+ switch (Global_Val.commandNumber)
665+ {
666+ case 1: // key
667+ //Debug.WriteLine(" {3}", listBox3.SelectedIndex.ToString());
668+ if (this.Tab2RadioButton104.Checked == true)
669+ {
670+ string[] tempString = key_104[Tab2CenterListBox.SelectedIndex][Tab2RightListBox.SelectedIndex].Split(' ');
671+ Global_Val.left_key = tempString[0];
672+ }
673+ else
674+ {
675+ string[] tempString = key_109[Tab2CenterListBox.SelectedIndex][Tab2RightListBox.SelectedIndex].Split(' ');
676+ Global_Val.left_key = tempString[0];
677+ }
678+ SetLeftEditBox();
679+ break;
680+ case 2: // mod
681+ Global_Val.left_key = modifier_mode[Tab2RightListBox.SelectedIndex];
682+ SetLeftEditBox();
683+ break;
684+ }
685+ }
686+
687+ // modifierにおける * の設定
688+ private void Tab2AsterCheckBoxCheckd(object sender, EventArgs e)
689+ {
690+ Global_Val.aster = string.Empty;
691+ if (this.Tab2AsterCheckBox.Checked == true)
692+ {
693+ Global_Val.aster = "*";
694+ }
695+ SetLeftEditBox();
696+ }
697+
698+ // tabPage2の EditBox更新
699+ private void SetLeftEditBox()
700+ {
701+ switch (Global_Val.commandNumber)
702+ {
703+ case 0: // keymap
704+ this.Tab2NewTextBox.Text = "keymap " + Global_Val.left_mod;
705+ break;
706+ case 1: // key
707+ this.Tab2NewTextBox.Text = "key " + Global_Val.left_mod + Global_Val.aster + Global_Val.left_key;
708+ break;
709+ case 2: // mod
710+ this.Tab2NewTextBox.Text = "mod " + Global_Val.left_mod + " " + Global_Val.left_key;
711+ break;
712+ case 4: // include
713+ this.Tab2NewTextBox.Text = "include \"" + Global_Val.left_mod + "\"";
714+ break;
715+ }
716+ }
717+
718+ // tabPage3 の実装
719+ private void Tab3LeftCheckedListBoxItemCheck(object sender, EventArgs e)
720+ {
721+ bool addMode = true;
722+ switch (Global_Val.commandNumber)
723+ {
724+ case 0:
725+ Global_Val.right_mod = string.Empty;
726+ addMode = false;
727+ if (Tab3LeftCheckedListBox.GetItemChecked(0))
728+ {
729+ Debug.WriteLine(Tab3LeftCheckedListBox.GetItemChecked(0).ToString());
730+ Global_Val.right_mod += ": Global";
731+ }
732+ SetRightEditBox(addMode);
733+ break;
734+
735+ case 1:
736+ addMode = this.Tab3AddModeCheckBox.Checked;
737+ Global_Val.right_mod = string.Empty;
738+ for (int i = 0; i < Tab3LeftCheckedListBox.Items.Count; i++)
739+ {
740+ if (Tab3LeftCheckedListBox.GetItemChecked(i))
741+ {
742+ Debug.WriteLine(Tab3LeftCheckedListBox.GetItemChecked(i).ToString());
743+ Global_Val.right_mod += mods_text[i];
744+ }
745+ }
746+ if (addMode == false) // 追加モードの時には、まだ変更しない。
747+ {
748+ SetRightEditBox(addMode);
749+ }
750+ break;
751+
752+ case 2: // mod
753+ // checkboxだが単一選択にする。
754+ int currentIndex = Tab3LeftCheckedListBox.SelectedIndex;
755+ if (Tab3LeftCheckedListBox.GetItemChecked(currentIndex)) // checkされた?
756+ {
757+ for (int i = 0; i < Tab3LeftCheckedListBox.Items.Count; i++)
758+ {
759+ if (i != currentIndex)
760+ {
761+ Tab3LeftCheckedListBox.SetItemChecked(i, false);
762+ }
763+ }
764+ }
765+ Global_Val.right_mod = modifier_cat[Tab3LeftCheckedListBox.SelectedIndex];
766+ SetRightEditBox(false);
767+ break;
768+
769+ default:
770+ break;
771+ }
772+ }
773+
774+ // tabPage3のcenter
775+ private void Tab3CenterListBoxItemCheck(object sender, EventArgs e)
776+ {
777+ this.Tab3RightListBox.Items.Clear();
778+ if (this.Tab2RadioButton104.Checked == true)
779+ {
780+ this.Tab3RightListBox.Items.AddRange(key_104[Tab3CenterListBox.SelectedIndex]); // Centerのチェック位置でRightのlistBoxロードし直す。
781+ }
782+ else
783+ {
784+ this.Tab3RightListBox.Items.AddRange(key_109[Tab3CenterListBox.SelectedIndex]); // Centerのチェック位置でRightのlistBoxロードし直す。
785+ }
786+ }
787+
788+ // tabPage3のright
789+ private void Tab3RightListBoxItemCheck(object sender, EventArgs e)
790+ {
791+ switch (Global_Val.commandNumber)
792+ {
793+ case 1: // key
794+ case 2: // mod
795+ bool addMode = this.Tab3AddModeCheckBox.Checked;
796+ //Debug.WriteLine(" {3}", listBox3.SelectedIndex.ToString());
797+ if (this.Tab2RadioButton104.Checked == true)
798+ {
799+ string[] tempString = key_104[Tab3CenterListBox.SelectedIndex][Tab3RightListBox.SelectedIndex].Split(' ');
800+ Global_Val.right_key = tempString[0];
801+ }
802+ else
803+ {
804+ string[] tempString = key_109[Tab3CenterListBox.SelectedIndex][Tab3RightListBox.SelectedIndex].Split(' ');
805+ Global_Val.right_key = tempString[0];
806+ }
807+
808+ SetRightEditBox(addMode);
809+ break;
810+
811+ }
812+ }
813+
814+ // modifierにおける * の設定
815+ /*private void AsterCheckd2(object sender, EventArgs e)
816+ {
817+ Global_Val.aster = string.Empty;
818+ if (this.checkBox1.Checked == true)
819+ {
820+ Global_Val.aster = "*";
821+ }
822+ SetLeftEditBox();
823+ }
824+ */
825+
826+ // tabPage3の EditBox更新
827+ private void SetRightEditBox(bool addMode)
828+ {
829+ switch (Global_Val.commandNumber)
830+ {
831+ case 0: // keymap
832+ this.Tab3NewTextBox.Text = Global_Val.right_mod;
833+ break;
834+ case 1: // key
835+ if (addMode == false)
836+ {
837+ this.Tab3NewTextBox.Text = "= " + Global_Val.right_mod + Global_Val.right_key;
838+ }
839+ else
840+ {
841+ this.Tab3NewTextBox.Text = this.Tab3NewTextBox.Text + " " + Global_Val.right_mod + Global_Val.right_key;
842+ }
843+ break;
844+ case 2: // mod
845+ this.Tab3NewTextBox.Text = "= " + Global_Val.right_mod + Global_Val.right_key;
846+ break;
847+ }
848+ }
849+
850+ private void Tab2RadioButton104_CheckedChanged(object sender, EventArgs e)
851+ {
852+ // 101/104 RadioButtonの状態変更
853+ // 現状 コマンド key, modだけ、このRadioButtonは有効。
854+ this.Tab2CenterListBox.Items.Clear();
855+ this.Tab2RightListBox.Items.Clear();
856+ this.Tab3CenterListBox.Items.Clear();
857+ this.Tab3RightListBox.Items.Clear();
858+
859+ if (this.Tab2RadioButton104.Checked == true)
860+ { // 101/104
861+ this.Tab2CenterListBox.Items.AddRange(key_cat104);
862+ this.Tab2CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
863+ this.Tab2RightListBox.Items.AddRange(key_104[0]); // 0「英字」をloadする。
864+ this.Tab3CenterListBox.Items.AddRange(key_cat104);
865+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
866+ this.Tab3RightListBox.Items.AddRange(key_104[0]); // 0「英字」をloadする。
867+ setRegbUser104(true);
868+ }
869+ else
870+ { // 106/109
871+ this.Tab2CenterListBox.Items.AddRange(key_cat109);
872+ this.Tab2CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
873+ this.Tab2RightListBox.Items.AddRange(key_109[0]); // 0「英字」をloadする。
874+ this.Tab3CenterListBox.Items.AddRange(key_cat109);
875+ this.Tab3CenterListBox.SetSelected(0, true); // 初期状態では「英字」をチェックする。
876+ this.Tab3RightListBox.Items.AddRange(key_109[0]); // 0「英字」をloadする。
877+ setRegbUser104(false);
878+ }
879+ }
880+
881+ private void SelectFileButton_Click(object sender, EventArgs e)
882+ {
883+ // File Open Dialog
884+ string file_name;
885+
886+ OpenFileDialog OF_Dialog = new OpenFileDialog();
887+ OF_Dialog.FileName = string.Empty;
888+ OF_Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
889+ OF_Dialog.Filter =
890+ "nodokaファイル(*.nodoka;*.mayu)|*.nodoka;*.mayu|すべてのファイル(*.*)|*.*";
891+ OF_Dialog.FilterIndex = 1;
892+ OF_Dialog.Title = "include文の引数として指定するファイルを選択してください";
893+ OF_Dialog.RestoreDirectory = true;
894+ OF_Dialog.CheckFileExists = true;
895+ OF_Dialog.CheckPathExists = true;
896+
897+ if (OF_Dialog.ShowDialog() == DialogResult.OK)
898+ {
899+ // file name取得
900+ file_name = Path.GetFileName(OF_Dialog.FileName);
901+
902+ this.Tab2CenterListBox.ClearSelected(); // 選択されているものは解除
903+ // set left_mod
904+ Global_Val.left_mod = file_name;
905+ SetLeftEditBox();
906+ }
907+ }
908+
909+ private void tabPage2_Click(object sender, EventArgs e)
910+ {
911+
912+ }
913+ }
914+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetting.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetting.Designer.cs (revision 228)
@@ -0,0 +1,543 @@
1+namespace nodokaGuiEdit
2+{
3+ partial class FormSetting
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSetting));
32+ this.buttonOK = new System.Windows.Forms.Button();
33+ this.envList = new System.Windows.Forms.DataGridView();
34+ this.name = new System.Windows.Forms.DataGridViewTextBoxColumn();
35+ this.path = new System.Windows.Forms.DataGridViewTextBoxColumn();
36+ this.tabControl1 = new System.Windows.Forms.TabControl();
37+ this.tabPage1 = new System.Windows.Forms.TabPage();
38+ this.checkBox_selectencode = new System.Windows.Forms.CheckBox();
39+ this.label_selectbackcolor = new System.Windows.Forms.Label();
40+ this.label_select = new System.Windows.Forms.Label();
41+ this.label_backcolor = new System.Windows.Forms.Label();
42+ this.check_bcolor = new System.Windows.Forms.CheckBox();
43+ this.button_selectbackcolor = new System.Windows.Forms.Button();
44+ this.button_selectcolor = new System.Windows.Forms.Button();
45+ this.button_backcolorAlt = new System.Windows.Forms.Button();
46+ this.text_fontstyle_reg = new System.Windows.Forms.TextBox();
47+ this.button_backcolor = new System.Windows.Forms.Button();
48+ this.text_fontstyle = new System.Windows.Forms.TextBox();
49+ this.label_fontstyle = new System.Windows.Forms.Label();
50+ this.text_fontsize = new System.Windows.Forms.TextBox();
51+ this.text_font = new System.Windows.Forms.TextBox();
52+ this.button_color = new System.Windows.Forms.Button();
53+ this.button_selectFont = new System.Windows.Forms.Button();
54+ this.checkBox_bold = new System.Windows.Forms.CheckBox();
55+ this.checkBox_fontsize = new System.Windows.Forms.CheckBox();
56+ this.checkBox_filename_caption = new System.Windows.Forms.CheckBox();
57+ this.label_fontcolor = new System.Windows.Forms.Label();
58+ this.checkBox_colum = new System.Windows.Forms.CheckBox();
59+ this.checkBox_windowsize = new System.Windows.Forms.CheckBox();
60+ this.checkBox_position = new System.Windows.Forms.CheckBox();
61+ this.label_fontsize = new System.Windows.Forms.Label();
62+ this.label_font = new System.Windows.Forms.Label();
63+ this.tabPage2 = new System.Windows.Forms.TabPage();
64+ this.button_open = new System.Windows.Forms.Button();
65+ this.label1 = new System.Windows.Forms.Label();
66+ this.label2 = new System.Windows.Forms.Label();
67+ this.label3 = new System.Windows.Forms.Label();
68+ this.label4 = new System.Windows.Forms.Label();
69+ ((System.ComponentModel.ISupportInitialize)(this.envList)).BeginInit();
70+ this.tabControl1.SuspendLayout();
71+ this.tabPage1.SuspendLayout();
72+ this.tabPage2.SuspendLayout();
73+ this.SuspendLayout();
74+ //
75+ // buttonOK
76+ //
77+ this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
78+ this.buttonOK.Location = new System.Drawing.Point(491, 279);
79+ this.buttonOK.Name = "buttonOK";
80+ this.buttonOK.Size = new System.Drawing.Size(99, 23);
81+ this.buttonOK.TabIndex = 1;
82+ this.buttonOK.Text = "OK";
83+ this.buttonOK.UseVisualStyleBackColor = true;
84+ //
85+ // envList
86+ //
87+ this.envList.AllowUserToAddRows = false;
88+ this.envList.AllowUserToDeleteRows = false;
89+ this.envList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
90+ this.envList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
91+ this.name,
92+ this.path});
93+ this.envList.Location = new System.Drawing.Point(15, 25);
94+ this.envList.Name = "envList";
95+ this.envList.ReadOnly = true;
96+ this.envList.RowTemplate.Height = 21;
97+ this.envList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
98+ this.envList.Size = new System.Drawing.Size(543, 150);
99+ this.envList.TabIndex = 10;
100+ this.envList.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.envList_CellContentDoubleClick);
101+ //
102+ // name
103+ //
104+ this.name.HeaderText = "環境変数";
105+ this.name.Name = "name";
106+ this.name.ReadOnly = true;
107+ this.name.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
108+ //
109+ // path
110+ //
111+ this.path.HeaderText = "パス";
112+ this.path.Name = "path";
113+ this.path.ReadOnly = true;
114+ this.path.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
115+ //
116+ // tabControl1
117+ //
118+ this.tabControl1.Controls.Add(this.tabPage1);
119+ this.tabControl1.Controls.Add(this.tabPage2);
120+ this.tabControl1.Location = new System.Drawing.Point(10, 20);
121+ this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
122+ this.tabControl1.Name = "tabControl1";
123+ this.tabControl1.SelectedIndex = 0;
124+ this.tabControl1.Size = new System.Drawing.Size(580, 254);
125+ this.tabControl1.TabIndex = 0;
126+ //
127+ // tabPage1
128+ //
129+ this.tabPage1.Controls.Add(this.checkBox_selectencode);
130+ this.tabPage1.Controls.Add(this.label_selectbackcolor);
131+ this.tabPage1.Controls.Add(this.label_select);
132+ this.tabPage1.Controls.Add(this.label_backcolor);
133+ this.tabPage1.Controls.Add(this.check_bcolor);
134+ this.tabPage1.Controls.Add(this.button_selectbackcolor);
135+ this.tabPage1.Controls.Add(this.button_selectcolor);
136+ this.tabPage1.Controls.Add(this.button_backcolorAlt);
137+ this.tabPage1.Controls.Add(this.text_fontstyle_reg);
138+ this.tabPage1.Controls.Add(this.button_backcolor);
139+ this.tabPage1.Controls.Add(this.text_fontstyle);
140+ this.tabPage1.Controls.Add(this.label_fontstyle);
141+ this.tabPage1.Controls.Add(this.text_fontsize);
142+ this.tabPage1.Controls.Add(this.text_font);
143+ this.tabPage1.Controls.Add(this.button_color);
144+ this.tabPage1.Controls.Add(this.button_selectFont);
145+ this.tabPage1.Controls.Add(this.checkBox_bold);
146+ this.tabPage1.Controls.Add(this.checkBox_fontsize);
147+ this.tabPage1.Controls.Add(this.checkBox_filename_caption);
148+ this.tabPage1.Controls.Add(this.label_fontcolor);
149+ this.tabPage1.Controls.Add(this.checkBox_colum);
150+ this.tabPage1.Controls.Add(this.checkBox_windowsize);
151+ this.tabPage1.Controls.Add(this.checkBox_position);
152+ this.tabPage1.Controls.Add(this.label_fontsize);
153+ this.tabPage1.Controls.Add(this.label_font);
154+ this.tabPage1.Font = new System.Drawing.Font("MS UI Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
155+ this.tabPage1.Location = new System.Drawing.Point(4, 22);
156+ this.tabPage1.Margin = new System.Windows.Forms.Padding(2);
157+ this.tabPage1.Name = "tabPage1";
158+ this.tabPage1.Padding = new System.Windows.Forms.Padding(2);
159+ this.tabPage1.Size = new System.Drawing.Size(572, 228);
160+ this.tabPage1.TabIndex = 0;
161+ this.tabPage1.Text = "表示";
162+ this.tabPage1.UseVisualStyleBackColor = true;
163+ //
164+ // checkBox_selectencode
165+ //
166+ this.checkBox_selectencode.AutoSize = true;
167+ this.checkBox_selectencode.Location = new System.Drawing.Point(340, 93);
168+ this.checkBox_selectencode.Margin = new System.Windows.Forms.Padding(2);
169+ this.checkBox_selectencode.Name = "checkBox_selectencode";
170+ this.checkBox_selectencode.Size = new System.Drawing.Size(199, 17);
171+ this.checkBox_selectencode.TabIndex = 20;
172+ this.checkBox_selectencode.Text = "終了時に文字コード選択を覚える";
173+ this.checkBox_selectencode.UseVisualStyleBackColor = true;
174+ //
175+ // label_selectbackcolor
176+ //
177+ this.label_selectbackcolor.AutoSize = true;
178+ this.label_selectbackcolor.Location = new System.Drawing.Point(16, 196);
179+ this.label_selectbackcolor.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
180+ this.label_selectbackcolor.Name = "label_selectbackcolor";
181+ this.label_selectbackcolor.Size = new System.Drawing.Size(85, 13);
182+ this.label_selectbackcolor.TabIndex = 6;
183+ this.label_selectbackcolor.Text = "選択時背景色";
184+ //
185+ // label_select
186+ //
187+ this.label_select.AutoSize = true;
188+ this.label_select.Location = new System.Drawing.Point(16, 170);
189+ this.label_select.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
190+ this.label_select.Name = "label_select";
191+ this.label_select.Size = new System.Drawing.Size(96, 13);
192+ this.label_select.TabIndex = 5;
193+ this.label_select.Text = "選択時文字の色";
194+ //
195+ // label_backcolor
196+ //
197+ this.label_backcolor.AutoSize = true;
198+ this.label_backcolor.Location = new System.Drawing.Point(16, 146);
199+ this.label_backcolor.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
200+ this.label_backcolor.Name = "label_backcolor";
201+ this.label_backcolor.Size = new System.Drawing.Size(46, 13);
202+ this.label_backcolor.TabIndex = 4;
203+ this.label_backcolor.Text = "背景色";
204+ //
205+ // check_bcolor
206+ //
207+ this.check_bcolor.AutoSize = true;
208+ this.check_bcolor.Location = new System.Drawing.Point(340, 144);
209+ this.check_bcolor.Name = "check_bcolor";
210+ this.check_bcolor.Size = new System.Drawing.Size(99, 17);
211+ this.check_bcolor.TabIndex = 22;
212+ this.check_bcolor.Text = "デフォルトの色";
213+ this.check_bcolor.UseVisualStyleBackColor = true;
214+ this.check_bcolor.CheckStateChanged += new System.EventHandler(this.check_bcolor_CheckStateChanged);
215+ //
216+ // button_selectbackcolor
217+ //
218+ this.button_selectbackcolor.Location = new System.Drawing.Point(118, 192);
219+ this.button_selectbackcolor.Name = "button_selectbackcolor";
220+ this.button_selectbackcolor.Size = new System.Drawing.Size(194, 20);
221+ this.button_selectbackcolor.TabIndex = 15;
222+ this.button_selectbackcolor.Text = "選択時 背景色";
223+ this.button_selectbackcolor.UseVisualStyleBackColor = true;
224+ this.button_selectbackcolor.Click += new System.EventHandler(this.button_selectbackcolor_Click);
225+ //
226+ // button_selectcolor
227+ //
228+ this.button_selectcolor.Location = new System.Drawing.Point(118, 166);
229+ this.button_selectcolor.Name = "button_selectcolor";
230+ this.button_selectcolor.Size = new System.Drawing.Size(194, 20);
231+ this.button_selectcolor.TabIndex = 14;
232+ this.button_selectcolor.Text = "選択時 文字の色";
233+ this.button_selectcolor.UseVisualStyleBackColor = true;
234+ this.button_selectcolor.Click += new System.EventHandler(this.button_selectcolor_Click_1);
235+ //
236+ // button_backcolorAlt
237+ //
238+ this.button_backcolorAlt.Location = new System.Drawing.Point(219, 142);
239+ this.button_backcolorAlt.Name = "button_backcolorAlt";
240+ this.button_backcolorAlt.Size = new System.Drawing.Size(93, 20);
241+ this.button_backcolorAlt.TabIndex = 13;
242+ this.button_backcolorAlt.Text = "奇数行背景色";
243+ this.button_backcolorAlt.UseVisualStyleBackColor = true;
244+ this.button_backcolorAlt.Click += new System.EventHandler(this.button_backcolorAlt_Click);
245+ //
246+ // text_fontstyle_reg
247+ //
248+ this.text_fontstyle_reg.Location = new System.Drawing.Point(325, 180);
249+ this.text_fontstyle_reg.Name = "text_fontstyle_reg";
250+ this.text_fontstyle_reg.ReadOnly = true;
251+ this.text_fontstyle_reg.Size = new System.Drawing.Size(133, 20);
252+ this.text_fontstyle_reg.TabIndex = 23;
253+ this.text_fontstyle_reg.Visible = false;
254+ //
255+ // button_backcolor
256+ //
257+ this.button_backcolor.Location = new System.Drawing.Point(118, 142);
258+ this.button_backcolor.Name = "button_backcolor";
259+ this.button_backcolor.Size = new System.Drawing.Size(93, 20);
260+ this.button_backcolor.TabIndex = 12;
261+ this.button_backcolor.Text = "背景色";
262+ this.button_backcolor.UseVisualStyleBackColor = true;
263+ this.button_backcolor.Click += new System.EventHandler(this.button_backcolor_Click);
264+ //
265+ // text_fontstyle
266+ //
267+ this.text_fontstyle.Location = new System.Drawing.Point(118, 53);
268+ this.text_fontstyle.Name = "text_fontstyle";
269+ this.text_fontstyle.ReadOnly = true;
270+ this.text_fontstyle.Size = new System.Drawing.Size(133, 20);
271+ this.text_fontstyle.TabIndex = 9;
272+ //
273+ // label_fontstyle
274+ //
275+ this.label_fontstyle.AutoSize = true;
276+ this.label_fontstyle.Location = new System.Drawing.Point(15, 57);
277+ this.label_fontstyle.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
278+ this.label_fontstyle.Name = "label_fontstyle";
279+ this.label_fontstyle.Size = new System.Drawing.Size(83, 13);
280+ this.label_fontstyle.TabIndex = 1;
281+ this.label_fontstyle.Text = "フォントスタイル";
282+ //
283+ // text_fontsize
284+ //
285+ this.text_fontsize.Location = new System.Drawing.Point(118, 82);
286+ this.text_fontsize.Name = "text_fontsize";
287+ this.text_fontsize.ReadOnly = true;
288+ this.text_fontsize.Size = new System.Drawing.Size(133, 20);
289+ this.text_fontsize.TabIndex = 10;
290+ //
291+ // text_font
292+ //
293+ this.text_font.Location = new System.Drawing.Point(118, 18);
294+ this.text_font.Name = "text_font";
295+ this.text_font.ReadOnly = true;
296+ this.text_font.Size = new System.Drawing.Size(133, 20);
297+ this.text_font.TabIndex = 7;
298+ //
299+ // button_color
300+ //
301+ this.button_color.Location = new System.Drawing.Point(118, 118);
302+ this.button_color.Name = "button_color";
303+ this.button_color.Size = new System.Drawing.Size(194, 20);
304+ this.button_color.TabIndex = 11;
305+ this.button_color.Text = "文字の色";
306+ this.button_color.UseVisualStyleBackColor = true;
307+ this.button_color.Click += new System.EventHandler(this.button_selectcolor_Click);
308+ //
309+ // button_selectFont
310+ //
311+ this.button_selectFont.Location = new System.Drawing.Point(256, 16);
312+ this.button_selectFont.Margin = new System.Windows.Forms.Padding(2);
313+ this.button_selectFont.Name = "button_selectFont";
314+ this.button_selectFont.Size = new System.Drawing.Size(56, 20);
315+ this.button_selectFont.TabIndex = 8;
316+ this.button_selectFont.Text = "…";
317+ this.button_selectFont.UseVisualStyleBackColor = true;
318+ this.button_selectFont.Click += new System.EventHandler(this.button_selectFont_Click);
319+ //
320+ // checkBox_bold
321+ //
322+ this.checkBox_bold.AutoSize = true;
323+ this.checkBox_bold.Location = new System.Drawing.Point(450, 182);
324+ this.checkBox_bold.Margin = new System.Windows.Forms.Padding(2);
325+ this.checkBox_bold.Name = "checkBox_bold";
326+ this.checkBox_bold.Size = new System.Drawing.Size(128, 17);
327+ this.checkBox_bold.TabIndex = 24;
328+ this.checkBox_bold.Text = "予約語の強調表示";
329+ this.checkBox_bold.UseVisualStyleBackColor = true;
330+ this.checkBox_bold.Visible = false;
331+ //
332+ // checkBox_fontsize
333+ //
334+ this.checkBox_fontsize.AutoSize = true;
335+ this.checkBox_fontsize.Location = new System.Drawing.Point(340, 72);
336+ this.checkBox_fontsize.Margin = new System.Windows.Forms.Padding(2);
337+ this.checkBox_fontsize.Name = "checkBox_fontsize";
338+ this.checkBox_fontsize.Size = new System.Drawing.Size(186, 17);
339+ this.checkBox_fontsize.TabIndex = 19;
340+ this.checkBox_fontsize.Text = "終了時にフォントサイズを覚える";
341+ this.checkBox_fontsize.UseVisualStyleBackColor = true;
342+ //
343+ // checkBox_filename_caption
344+ //
345+ this.checkBox_filename_caption.AutoSize = true;
346+ this.checkBox_filename_caption.Location = new System.Drawing.Point(340, 121);
347+ this.checkBox_filename_caption.Margin = new System.Windows.Forms.Padding(2);
348+ this.checkBox_filename_caption.Name = "checkBox_filename_caption";
349+ this.checkBox_filename_caption.Size = new System.Drawing.Size(166, 17);
350+ this.checkBox_filename_caption.TabIndex = 21;
351+ this.checkBox_filename_caption.Text = "ファイル名を上にも表示する";
352+ this.checkBox_filename_caption.UseVisualStyleBackColor = true;
353+ //
354+ // label_fontcolor
355+ //
356+ this.label_fontcolor.AutoSize = true;
357+ this.label_fontcolor.Location = new System.Drawing.Point(16, 121);
358+ this.label_fontcolor.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
359+ this.label_fontcolor.Name = "label_fontcolor";
360+ this.label_fontcolor.Size = new System.Drawing.Size(57, 13);
361+ this.label_fontcolor.TabIndex = 3;
362+ this.label_fontcolor.Text = "文字の色";
363+ //
364+ // checkBox_colum
365+ //
366+ this.checkBox_colum.AutoSize = true;
367+ this.checkBox_colum.Location = new System.Drawing.Point(340, 52);
368+ this.checkBox_colum.Margin = new System.Windows.Forms.Padding(2);
369+ this.checkBox_colum.Name = "checkBox_colum";
370+ this.checkBox_colum.Size = new System.Drawing.Size(178, 17);
371+ this.checkBox_colum.TabIndex = 18;
372+ this.checkBox_colum.Text = "終了時にカラムサイズを覚える";
373+ this.checkBox_colum.UseVisualStyleBackColor = true;
374+ //
375+ // checkBox_windowsize
376+ //
377+ this.checkBox_windowsize.AutoSize = true;
378+ this.checkBox_windowsize.Location = new System.Drawing.Point(340, 34);
379+ this.checkBox_windowsize.Margin = new System.Windows.Forms.Padding(2);
380+ this.checkBox_windowsize.Name = "checkBox_windowsize";
381+ this.checkBox_windowsize.Size = new System.Drawing.Size(195, 17);
382+ this.checkBox_windowsize.TabIndex = 17;
383+ this.checkBox_windowsize.Text = "終了時にウィンドウサイズを覚える";
384+ this.checkBox_windowsize.UseVisualStyleBackColor = true;
385+ //
386+ // checkBox_position
387+ //
388+ this.checkBox_position.AutoSize = true;
389+ this.checkBox_position.Location = new System.Drawing.Point(340, 16);
390+ this.checkBox_position.Margin = new System.Windows.Forms.Padding(2);
391+ this.checkBox_position.Name = "checkBox_position";
392+ this.checkBox_position.Size = new System.Drawing.Size(144, 17);
393+ this.checkBox_position.TabIndex = 16;
394+ this.checkBox_position.Text = "終了時に位置を覚える";
395+ this.checkBox_position.UseVisualStyleBackColor = true;
396+ //
397+ // label_fontsize
398+ //
399+ this.label_fontsize.AutoSize = true;
400+ this.label_fontsize.Location = new System.Drawing.Point(16, 86);
401+ this.label_fontsize.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
402+ this.label_fontsize.Name = "label_fontsize";
403+ this.label_fontsize.Size = new System.Drawing.Size(101, 13);
404+ this.label_fontsize.TabIndex = 2;
405+ this.label_fontsize.Text = "標準フォントサイズ";
406+ //
407+ // label_font
408+ //
409+ this.label_font.AutoSize = true;
410+ this.label_font.Location = new System.Drawing.Point(16, 22);
411+ this.label_font.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
412+ this.label_font.Name = "label_font";
413+ this.label_font.Size = new System.Drawing.Size(44, 13);
414+ this.label_font.TabIndex = 0;
415+ this.label_font.Text = "フォント";
416+ //
417+ // tabPage2
418+ //
419+ this.tabPage2.Controls.Add(this.label4);
420+ this.tabPage2.Controls.Add(this.label3);
421+ this.tabPage2.Controls.Add(this.label2);
422+ this.tabPage2.Controls.Add(this.button_open);
423+ this.tabPage2.Controls.Add(this.label1);
424+ this.tabPage2.Controls.Add(this.envList);
425+ this.tabPage2.Font = new System.Drawing.Font("MS UI Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
426+ this.tabPage2.Location = new System.Drawing.Point(4, 22);
427+ this.tabPage2.Margin = new System.Windows.Forms.Padding(2);
428+ this.tabPage2.Name = "tabPage2";
429+ this.tabPage2.Padding = new System.Windows.Forms.Padding(2);
430+ this.tabPage2.Size = new System.Drawing.Size(572, 228);
431+ this.tabPage2.TabIndex = 1;
432+ this.tabPage2.Text = "設定ファイル フォルダ";
433+ this.tabPage2.UseVisualStyleBackColor = true;
434+ //
435+ // button_open
436+ //
437+ this.button_open.Location = new System.Drawing.Point(421, 182);
438+ this.button_open.Name = "button_open";
439+ this.button_open.Size = new System.Drawing.Size(137, 23);
440+ this.button_open.TabIndex = 11;
441+ this.button_open.Text = "フォルダを開く";
442+ this.button_open.UseVisualStyleBackColor = true;
443+ this.button_open.Click += new System.EventHandler(this.button_open_Click);
444+ //
445+ // label1
446+ //
447+ this.label1.AutoSize = true;
448+ this.label1.Location = new System.Drawing.Point(13, 10);
449+ this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
450+ this.label1.Name = "label1";
451+ this.label1.Size = new System.Drawing.Size(133, 13);
452+ this.label1.TabIndex = 0;
453+ this.label1.Text = "ホームディレクトリ検索順";
454+ //
455+ // label2
456+ //
457+ this.label2.AutoSize = true;
458+ this.label2.Location = new System.Drawing.Point(18, 182);
459+ this.label2.Name = "label2";
460+ this.label2.Size = new System.Drawing.Size(303, 13);
461+ this.label2.TabIndex = 12;
462+ this.label2.Text = "設定ファイルは、ホームディレクトリ検索順に検索されます。";
463+ //
464+ // label3
465+ //
466+ this.label3.AutoSize = true;
467+ this.label3.Location = new System.Drawing.Point(18, 195);
468+ this.label3.Name = "label3";
469+ this.label3.Size = new System.Drawing.Size(360, 13);
470+ this.label3.TabIndex = 13;
471+ this.label3.Text = "なお、のどかの設定ダイアログにて、フルパスで指定されていた場合には";
472+ //
473+ // label4
474+ //
475+ this.label4.AutoSize = true;
476+ this.label4.Location = new System.Drawing.Point(18, 208);
477+ this.label4.Name = "label4";
478+ this.label4.Size = new System.Drawing.Size(356, 13);
479+ this.label4.TabIndex = 14;
480+ this.label4.Text = "その設定ファイルが置かれたフォルダが一番最初の検索先となります。";
481+ //
482+ // FormSetting
483+ //
484+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
485+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
486+ this.ClientSize = new System.Drawing.Size(611, 306);
487+ this.Controls.Add(this.tabControl1);
488+ this.Controls.Add(this.buttonOK);
489+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
490+ this.Name = "FormSetting";
491+ this.Text = "設定";
492+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormSetting_FormClosed);
493+ ((System.ComponentModel.ISupportInitialize)(this.envList)).EndInit();
494+ this.tabControl1.ResumeLayout(false);
495+ this.tabPage1.ResumeLayout(false);
496+ this.tabPage1.PerformLayout();
497+ this.tabPage2.ResumeLayout(false);
498+ this.tabPage2.PerformLayout();
499+ this.ResumeLayout(false);
500+
501+ }
502+
503+ #endregion
504+
505+ private System.Windows.Forms.Button buttonOK;
506+ private System.Windows.Forms.DataGridView envList;
507+ private System.Windows.Forms.DataGridViewTextBoxColumn name;
508+ private System.Windows.Forms.DataGridViewTextBoxColumn path;
509+ private System.Windows.Forms.TabControl tabControl1;
510+ private System.Windows.Forms.TabPage tabPage1;
511+ private System.Windows.Forms.TabPage tabPage2;
512+ private System.Windows.Forms.Label label1;
513+ private System.Windows.Forms.CheckBox checkBox_colum;
514+ private System.Windows.Forms.CheckBox checkBox_windowsize;
515+ private System.Windows.Forms.CheckBox checkBox_position;
516+ private System.Windows.Forms.Label label_fontsize;
517+ private System.Windows.Forms.Label label_font;
518+ private System.Windows.Forms.Label label_fontcolor;
519+ private System.Windows.Forms.CheckBox checkBox_fontsize;
520+ private System.Windows.Forms.CheckBox checkBox_filename_caption;
521+ private System.Windows.Forms.CheckBox checkBox_bold;
522+ private System.Windows.Forms.Button button_selectFont;
523+ private System.Windows.Forms.Button button_color;
524+ private System.Windows.Forms.Button button_backcolor;
525+ private System.Windows.Forms.TextBox text_fontstyle;
526+ private System.Windows.Forms.Label label_fontstyle;
527+ private System.Windows.Forms.TextBox text_fontsize;
528+ private System.Windows.Forms.TextBox text_font;
529+ private System.Windows.Forms.TextBox text_fontstyle_reg;
530+ private System.Windows.Forms.Button button_backcolorAlt;
531+ private System.Windows.Forms.Button button_selectbackcolor;
532+ private System.Windows.Forms.Button button_selectcolor;
533+ private System.Windows.Forms.CheckBox check_bcolor;
534+ private System.Windows.Forms.Label label_select;
535+ private System.Windows.Forms.Label label_backcolor;
536+ private System.Windows.Forms.Label label_selectbackcolor;
537+ private System.Windows.Forms.CheckBox checkBox_selectencode;
538+ private System.Windows.Forms.Button button_open;
539+ private System.Windows.Forms.Label label4;
540+ private System.Windows.Forms.Label label3;
541+ private System.Windows.Forms.Label label2;
542+ }
543+}
\ No newline at end of file
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetting.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetting.cs (revision 228)
@@ -0,0 +1,547 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Windows.Forms;
9+using Microsoft.Win32; // reg
10+
11+namespace nodokaGuiEdit
12+{
13+ public partial class FormSetting : Form
14+ {
15+ public FormSetting()
16+ {
17+ InitializeComponent();
18+ // 行番号を書くコールバックルーチンの定義
19+ envList.RowPostPaint += new DataGridViewRowPostPaintEventHandler(putLineNumber);
20+
21+ // ホームディレクトリ表示GridViewのフォント指定
22+ envList.ColumnHeadersDefaultCellStyle.Font = new Font("MS UI Gothic", 12);
23+ envList.DefaultCellStyle.Font = new Font("MS ゴシック", 12);
24+ envList.RowHeadersDefaultCellStyle.Font = new Font("MS UI Gothic", 12);
25+
26+
27+ this.envList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
28+
29+ // Controlにデータを設定
30+
31+ // 環境変数の値を取得して表示
32+ setEnvList("NODOKA", 1);
33+ setEnvList("HOME", 2);
34+ setEnvList("USERPROFILE", 2);
35+ setEnvList("HOMEDRIVE HOMEPATH", 3);
36+ setEnvList("のどか実行フォルダ", 4);
37+
38+ // 以前の設定値を取り出して、各コントロールを設定
39+
40+ RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\appletkan\\nodoka");
41+ int readData;
42+
43+ // 終了時に位置を覚える
44+ readData = (int)rk.GetValue("b_position", 0);
45+ checkBox_position.Checked = (readData == 0) ? false : true;
46+
47+ //ウィンドウサイズを覚える
48+ readData = (int)rk.GetValue("b_windowsize", 0);
49+ checkBox_windowsize.Checked = (readData == 0) ? false : true;
50+
51+ //カラムサイズを覚える
52+ readData = (int)rk.GetValue("b_column", 0);
53+ checkBox_colum.Checked = (readData == 0) ? false : true;
54+
55+ //フォントサイズを覚える
56+ readData = (int)rk.GetValue("b_fontsize", 0);
57+ checkBox_fontsize.Checked = (readData == 0) ? false : true;
58+
59+ //予約語の強調表示
60+ readData = (int)rk.GetValue("b_bold", 0);
61+ checkBox_bold.Checked = (readData == 0) ? false : true;
62+
63+ //ファイル名を上に表示する
64+ readData = (int)rk.GetValue("b_filename_caption", 0);
65+ checkBox_filename_caption.Checked = (readData == 0) ? false : true;
66+
67+ //文字コード指定を覚える
68+ readData = (int)rk.GetValue("b_selectencode", 0);
69+ checkBox_selectencode.Checked = (readData == 0) ? false : true;
70+
71+ // フォント名、フォントサイズ、フォントスタイル
72+ text_font.Text = (String)rk.GetValue("s_font", "MS ゴシック");
73+ text_fontsize.Text = rk.GetValue("i_fontsize", 10).ToString();
74+
75+ String tmpFSname = (String)rk.GetValue("s_fontstyle", "Reguler");
76+ FontStyle tmpFS = FontStyle.Regular;
77+ text_fontstyle.Text = "標準";
78+ text_fontstyle_reg.Text = tmpFSname;
79+
80+ if (tmpFSname.IndexOf("Bold") >= 0)
81+ {
82+ tmpFS = FontStyle.Bold;
83+ text_fontstyle.Text = "太字";
84+ }
85+ if (tmpFSname.IndexOf("Italic") >= 0)
86+ {
87+ tmpFS = FontStyle.Italic;
88+ text_fontstyle.Text = "斜体";
89+ }
90+ if (tmpFSname.IndexOf("Bold, Italic") >= 0)
91+ {
92+ tmpFS = FontStyle.Bold | FontStyle.Italic;
93+ text_fontstyle.Text = "太字 斜体";
94+ }
95+
96+ text_font.Font = new Font(text_font.Text, 10, tmpFS);
97+
98+
99+ // 色を変える 1ならデフォルト
100+ readData = (int)rk.GetValue("b_color", 1);
101+ check_bcolor.Checked = (readData == 0) ? false : true;
102+
103+ //色の取得
104+ button_color.ForeColor = Color.FromArgb((int)rk.GetValue("i_color", unchecked((int)(0xff000000)))); // Color.Black
105+ button_backcolor.BackColor = Color.FromArgb((int)rk.GetValue("i_backcolor", unchecked((int)(0xffffffff)))); // Color.White
106+ button_backcolorAlt.BackColor = Color.FromArgb((int)rk.GetValue("i_backcolorAlt", unchecked((int)(0xfff0f8ff)))); // Color.AliceBlue
107+ button_selectcolor.ForeColor = Color.FromArgb((int)rk.GetValue("i_selectcolor", unchecked((int)(0xffffffff)))); // Color.White
108+ button_selectbackcolor.BackColor = Color.FromArgb((int)rk.GetValue("i_selectbackcolor", unchecked((int)(0xff3399ff)))); // Blue Green
109+
110+ // ボタンの残りの色設定
111+ button_color.BackColor = button_backcolor.BackColor;
112+ button_backcolor.ForeColor = button_color.ForeColor;
113+ button_backcolorAlt.ForeColor = button_color.ForeColor;
114+
115+ // 補色はあまり意味がない。
116+ //button_backcolor.ForeColor = Color.FromArgb((int)calc_complementary_color((uint)button_backcolor.BackColor.ToArgb()));
117+ //button_backcolorAlt.ForeColor = Color.FromArgb((int)calc_complementary_color((uint)button_backcolorAlt.BackColor.ToArgb()));
118+
119+ // 選択の場合も同様
120+ button_selectcolor.BackColor = button_selectbackcolor.BackColor;
121+ button_selectbackcolor.ForeColor = button_selectcolor.ForeColor;
122+ //button_selectbackcolor.ForeColor = Color.FromArgb((int)calc_complementary_color((uint)button_selectbackcolor.BackColor.ToArgb()));
123+
124+ }
125+
126+ // 32bitのalpha,RGB値から、補色を求める。なおalpha値はそのまま。
127+ private static uint calc_complementary_color(uint current_color)
128+ {
129+ uint complementary_color = 0;
130+
131+ // alpha値、RGB値を取り出す。
132+ uint alpha = (current_color & 0xff000000); //
133+ uint red = (current_color & 0x00ff0000) >> 16;
134+ uint green = (current_color & 0x0000ff00) >> 8;
135+ uint blue = (current_color & 0x000000ff);
136+
137+ uint[] rgb = { red, green, blue };
138+ uint[] c_rgb = { 0, 0, 0 };
139+
140+ uint min = 255;
141+ uint max = 0;
142+ uint maxmin = 0;
143+ int i = 0;
144+
145+ // 最大、最少を求める
146+ for (i = 0; i < 3; i++)
147+ {
148+ if (rgb[i] > max)
149+ max = rgb[i];
150+
151+ if (rgb[i] < min)
152+ min = rgb[i];
153+ }
154+ maxmin = max + min;
155+
156+ // 最大、最少の合計から、現在値を引く
157+ for (i = 0; i < 3; i++)
158+ {
159+ c_rgb[i] = maxmin - rgb[i];
160+ }
161+
162+ // 32bit値に組み立てる。
163+ complementary_color = alpha | c_rgb[0] << 16 | c_rgb[1] << 8 | c_rgb[2];
164+
165+ MessageBox.Show("current color " + current_color.ToString("X8") + "\ncomplementary color " + complementary_color.ToString("X8"));
166+ return complementary_color;
167+ }
168+
169+ private void setEnvList(string envString, int mode)
170+ {
171+ string viewPath = String.Empty;
172+
173+ switch (mode)
174+ {
175+ case 1:
176+ {
177+ // 1: user env
178+ viewPath = System.Environment.GetEnvironmentVariable(envString, System.EnvironmentVariableTarget.User);
179+
180+ if (viewPath == null)
181+ {
182+ viewPath = "未設定";
183+ }
184+ break;
185+ }
186+
187+ case 2:
188+ {
189+ // 2: system env
190+ viewPath = System.Environment.GetEnvironmentVariable(envString);
191+
192+ if (viewPath == null)
193+ {
194+ viewPath = "未設定";
195+ }
196+ break;
197+ }
198+ case 3:
199+ {
200+ // 3: system env x 2
201+ viewPath = System.Environment.GetEnvironmentVariable(envString.Split(' ')[0])
202+ + System.Environment.GetEnvironmentVariable(envString.Split(' ')[1]);
203+ break;
204+ }
205+
206+ case 4:
207+ {
208+ // for curent running nodoka.exe
209+ RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\appletkan\\nodoka");
210+ viewPath = (string)rk.GetValue("currentPath", "不明");
211+ break;
212+ }
213+
214+ case 5:
215+ {
216+ // for install path
217+ break;
218+ }
219+
220+ }
221+ this.envList.Rows.Add(envString, viewPath);
222+ }
223+
224+ // 行ヘッダーに行番号を書くコールバックルーチン
225+ void putLineNumber(object sender, DataGridViewRowPostPaintEventArgs e)
226+ {
227+
228+ // 行番号描画領域の設定
229+ Rectangle rect = new Rectangle(
230+ e.RowBounds.Location.X,
231+ e.RowBounds.Location.Y,
232+ envList.RowHeadersWidth - 4,
233+ e.RowBounds.Height);
234+
235+ // 行番号の描画
236+ TextRenderer.DrawText(
237+ e.Graphics,
238+ (e.RowIndex + 1).ToString(),
239+ envList.RowHeadersDefaultCellStyle.Font,
240+ rect,
241+ envList.RowHeadersDefaultCellStyle.ForeColor,
242+ TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
243+ }
244+
245+ private void button1_Click(object sender, EventArgs e)
246+ {
247+ // 環境変数NODOKAの設定
248+
249+ Form fSetNODOKA = new FormSetNODOKA();
250+ if (fSetNODOKA.ShowDialog() == DialogResult.OK)
251+ {
252+ // 環境変数として保存
253+ string value = FormSetNODOKA.Global_Val.envString;
254+ this.envList[1, 0].Value = value;
255+ System.Environment.SetEnvironmentVariable("NODOKA", value, System.EnvironmentVariableTarget.User);
256+ }
257+ }
258+
259+ private void combo_font_SelectedIndexChanged(object sender, EventArgs e)
260+ {
261+
262+ }
263+
264+ private void textBox1_TextChanged(object sender, EventArgs e)
265+ {
266+
267+ }
268+
269+ private void button_selectFont_Click(object sender, EventArgs e)
270+ {
271+ FontDialog fontDialog1 = new FontDialog();
272+
273+ fontDialog1.Font = new Font(text_font.Text, Convert.ToInt32(text_fontsize.Text));
274+ fontDialog1.MaxSize = 72;
275+ fontDialog1.MinSize = 8;
276+
277+ fontDialog1.FontMustExist = true;
278+ fontDialog1.ShowColor = false;
279+ fontDialog1.ShowEffects = false;
280+ fontDialog1.ShowHelp = false;
281+ fontDialog1.ShowApply = false;
282+ fontDialog1.ScriptsOnly = false;
283+ fontDialog1.FixedPitchOnly = false;
284+ fontDialog1.AllowScriptChange = false;
285+ fontDialog1.AllowSimulations = true;
286+ fontDialog1.AllowVectorFonts = false;
287+ fontDialog1.AllowVerticalFonts = false;
288+
289+ // ダイアログを表示し、戻り値が [OK] の場合は選択したフォントを textBox1 に適用する
290+ if (fontDialog1.ShowDialog() == DialogResult.OK)
291+ {
292+ text_font.Text = fontDialog1.Font.Name.ToString();
293+ text_font.Font = new Font(fontDialog1.Font.Name.ToString(), 10, fontDialog1.Font.Style);
294+ text_fontsize.Text = Math.Round(fontDialog1.Font.Size, MidpointRounding.AwayFromZero).ToString();
295+
296+ text_fontstyle.Text = "標準";
297+ String tmpFSname = fontDialog1.Font.Style.ToString();
298+ text_fontstyle_reg.Text = tmpFSname;
299+
300+ if (tmpFSname.IndexOf("Bold") >= 0)
301+ {
302+ text_fontstyle.Text = "太字";
303+ }
304+ if (tmpFSname.IndexOf("Italic") >= 0)
305+ {
306+ text_fontstyle.Text = "斜体";
307+ }
308+ if (tmpFSname.IndexOf("Bold, Italic") >= 0)
309+ {
310+ text_fontstyle.Text = "太字 斜体";
311+ }
312+ }
313+
314+ fontDialog1.Dispose();
315+ }
316+
317+ private void FormSetting_FormClosed(object sender, FormClosedEventArgs e)
318+ {
319+ // コントロールの状態を保存する。
320+ RegistryKey rk = Registry.CurrentUser.CreateSubKey("Software\\appletkan\\nodoka");
321+ int saveData;
322+
323+ // 終了時に位置を覚える
324+ saveData = checkBox_position.Checked ? 1 : 0;
325+ rk.SetValue("b_position", saveData);
326+
327+ //ウィンドウサイズを覚える
328+ saveData = checkBox_windowsize.Checked ? 1 : 0;
329+ rk.SetValue("b_windowsize", saveData);
330+
331+ //カラムサイズを覚える
332+ saveData = checkBox_colum.Checked ? 1 : 0;
333+ rk.SetValue("b_column", saveData);
334+
335+ //フォントサイズを覚える
336+ saveData = checkBox_fontsize.Checked ? 1 : 0;
337+ rk.SetValue("b_fontsize", saveData);
338+
339+ //予約語の強調表示
340+ saveData = checkBox_bold.Checked ? 1 : 0;
341+ rk.SetValue("b_bold", saveData);
342+
343+ //ファイル名を上に表示する
344+ saveData = checkBox_filename_caption.Checked ? 1 : 0;
345+ rk.SetValue("b_filename_caption", saveData);
346+
347+ //フォント名、フォントサイズ、フォントスタイル
348+ rk.SetValue("s_font", text_font.Text);
349+ rk.SetValue("i_fontsize", Convert.ToInt32(text_fontsize.Text));
350+ rk.SetValue("s_fontstyle", text_fontstyle_reg.Text);
351+
352+ //デフォルトカラー
353+ saveData = check_bcolor.Checked ? 1 : 0;
354+ rk.SetValue("b_color", saveData);
355+
356+ //各色設定
357+ rk.SetValue("i_color", button_color.ForeColor.ToArgb());
358+ rk.SetValue("i_backcolor", button_color.BackColor.ToArgb());
359+ rk.SetValue("i_backcolorAlt", button_backcolorAlt.BackColor.ToArgb());
360+ rk.SetValue("i_selectcolor", button_selectcolor.ForeColor.ToArgb());
361+ rk.SetValue("i_selectbackcolor", button_selectcolor.BackColor.ToArgb());
362+
363+ //終了時に文字コード指定を覚える
364+ rk.SetValue("b_selectencode", checkBox_selectencode.Checked ? 1 : 0);
365+
366+ }
367+
368+ private void button_selectcolor_Click(object sender, EventArgs e)
369+ {
370+ if (check_bcolor.Checked != true)
371+ {
372+
373+ // 文字の色
374+ ColorDialog colorDialog1 = new ColorDialog();
375+ colorDialog1.Color = button_color.ForeColor;
376+ colorDialog1.AllowFullOpen = true;
377+ colorDialog1.FullOpen = false;
378+ colorDialog1.AnyColor = true;
379+ colorDialog1.SolidColorOnly = false;
380+ colorDialog1.CustomColors = new int[] { 0xfff8f0, 0xff9933 };
381+ colorDialog1.ShowHelp = false;
382+
383+ if (colorDialog1.ShowDialog() == DialogResult.OK)
384+ {
385+ button_color.ForeColor = colorDialog1.Color;
386+ button_backcolor.ForeColor = button_color.ForeColor;
387+ button_backcolorAlt.ForeColor = button_color.ForeColor;
388+ }
389+
390+ colorDialog1.Dispose();
391+ }
392+ }
393+
394+ private void button_backcolor_Click(object sender, EventArgs e)
395+ {
396+ if (check_bcolor.Checked != true)
397+ {
398+ // バックカラーの設定
399+ ColorDialog colorDialog1 = new ColorDialog();
400+ colorDialog1.Color = button_color.BackColor;
401+ colorDialog1.AllowFullOpen = true;
402+ colorDialog1.FullOpen = false;
403+ colorDialog1.AnyColor = true;
404+ colorDialog1.SolidColorOnly = false;
405+ colorDialog1.CustomColors = new int[] { 0xfff8f0, 0xff9933 };
406+ colorDialog1.ShowHelp = false;
407+
408+ if (colorDialog1.ShowDialog() == DialogResult.OK)
409+ {
410+ button_color.BackColor = colorDialog1.Color;
411+ button_backcolor.BackColor = button_color.BackColor;
412+ }
413+
414+ colorDialog1.Dispose();
415+ }
416+ }
417+
418+ private void button_backcolorAlt_Click(object sender, EventArgs e)
419+ {
420+ if (check_bcolor.Checked != true)
421+ {
422+ // オルタネートバックカラー
423+ ColorDialog colorDialog1 = new ColorDialog();
424+ colorDialog1.Color = button_backcolorAlt.BackColor;
425+ colorDialog1.AllowFullOpen = true;
426+ colorDialog1.FullOpen = false;
427+ colorDialog1.AnyColor = true;
428+ colorDialog1.SolidColorOnly = false;
429+ colorDialog1.CustomColors = new int[] { 0xfff8f0, 0xff9933 };
430+ colorDialog1.ShowHelp = false;
431+
432+ if (colorDialog1.ShowDialog() == DialogResult.OK)
433+ {
434+ button_backcolorAlt.BackColor = colorDialog1.Color;
435+ }
436+
437+ colorDialog1.Dispose();
438+ }
439+ }
440+
441+ private void button_selectcolor_Click_1(object sender, EventArgs e)
442+ {
443+ if (check_bcolor.Checked != true)
444+ {
445+
446+ // 選択時の文字色
447+ ColorDialog colorDialog1 = new ColorDialog();
448+ colorDialog1.Color = button_selectcolor.ForeColor;
449+ colorDialog1.AllowFullOpen = true;
450+ colorDialog1.FullOpen = false;
451+ colorDialog1.AnyColor = true;
452+ colorDialog1.SolidColorOnly = false;
453+ colorDialog1.CustomColors = new int[] { 0xfff8f0, 0xff9933 };
454+ colorDialog1.ShowHelp = false;
455+
456+ if (colorDialog1.ShowDialog() == DialogResult.OK)
457+ {
458+ button_selectcolor.ForeColor = colorDialog1.Color;
459+ button_selectbackcolor.ForeColor = button_selectcolor.ForeColor;
460+ }
461+
462+ colorDialog1.Dispose();
463+ }
464+ }
465+
466+ private void button_selectbackcolor_Click(object sender, EventArgs e)
467+ {
468+ if (check_bcolor.Checked != true)
469+ {
470+
471+ // 選択時の背景色
472+ ColorDialog colorDialog1 = new ColorDialog();
473+ colorDialog1.Color = button_selectcolor.BackColor;
474+ colorDialog1.AllowFullOpen = true;
475+ colorDialog1.FullOpen = false;
476+ colorDialog1.AnyColor = true;
477+ colorDialog1.SolidColorOnly = false;
478+ colorDialog1.CustomColors = new int[] { 0xfff8f0, 0xff9933 };
479+ colorDialog1.ShowHelp = false;
480+
481+ if (colorDialog1.ShowDialog() == DialogResult.OK)
482+ {
483+ button_selectcolor.BackColor = colorDialog1.Color;
484+ button_selectbackcolor.BackColor = button_selectcolor.BackColor;
485+ }
486+
487+ colorDialog1.Dispose();
488+ }
489+ }
490+
491+ private void check_bcolor_CheckStateChanged(object sender, EventArgs e)
492+ {
493+ // 値を取得して、☑されたならばデフォルト値に戻す。
494+ // 色を変える 1ならデフォルト
495+
496+ // ボタン自体の Enabledは 1でもFalseにしない。表示色が変わるから。
497+ if (check_bcolor.Checked)
498+ {
499+ //色の取得
500+ button_color.ForeColor = Color.FromArgb(unchecked((int)(0xff000000))); // Color.Black
501+ button_backcolor.BackColor = Color.FromArgb(unchecked((int)(0xffffffff))); // Color.White
502+ button_backcolorAlt.BackColor = Color.FromArgb(unchecked((int)(0xfff0f8ff))); // Color.AliceBlue
503+ button_selectcolor.ForeColor = Color.FromArgb(unchecked((int)(0xffffffff))); // Color.White
504+ button_selectbackcolor.BackColor = Color.FromArgb(unchecked((int)(0xff3399ff))); // Blue Green
505+
506+ // ボタンの残りの色設定
507+ button_color.BackColor = button_backcolor.BackColor;
508+ button_backcolor.ForeColor = button_color.ForeColor;
509+ button_backcolorAlt.ForeColor = button_color.ForeColor;
510+ button_selectcolor.BackColor = button_selectbackcolor.BackColor;
511+ button_selectbackcolor.ForeColor = button_selectcolor.ForeColor;
512+
513+ }
514+ }
515+
516+ private void envList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
517+ {
518+ // セルがダブルクリックされたら、そのフォルダを開く
519+ int currentRow = -1;
520+ string folder_name = String.Empty;
521+
522+ try
523+ {
524+ currentRow = envList.SelectedRows[0].Index;
525+ if (currentRow >= 0)
526+ {
527+ folder_name = envList[1, currentRow].Value.ToString();
528+ if (folder_name != "未設定" && folder_name != "不明" && folder_name != String.Empty)
529+ {
530+ System.Diagnostics.Process.Start(folder_name);
531+ }
532+ }
533+ }
534+
535+ catch
536+ {
537+ // フォルダが存在しない場合などはここにくる。
538+ MessageBox.Show("フォルダが存在しません。", "のどかGuiEdit", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
539+ }
540+ }
541+
542+ private void button_open_Click(object sender, EventArgs e)
543+ {
544+ envList_CellContentDoubleClick(sender, null);
545+ }
546+ }
547+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormMain.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormMain.Designer.cs (revision 228)
@@ -0,0 +1,979 @@
1+namespace nodokaGuiEdit
2+{
3+ partial class FormMain
4+ {
5+ /// <summary>
6+ /// 必要なデザイナー変数です。
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// 使用中のリソースをすべてクリーンアップします。
12+ /// </summary>
13+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows フォーム デザイナーで生成されたコード
24+
25+ /// <summary>
26+ /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
27+ /// コード エディターで変更しないでください。
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.components = new System.ComponentModel.Container();
32+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
33+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
34+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
35+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
36+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
37+ this.toolStripStatusLabel_FileName = new System.Windows.Forms.ToolStripStatusLabel();
38+ this.toolStripStatusLabel_encode = new System.Windows.Forms.ToolStripStatusLabel();
39+ this.toolStripSaveStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
40+ this.toolStripStatusLabel_debug = new System.Windows.Forms.ToolStripStatusLabel();
41+ this.toolStripStatusReadOnly = new System.Windows.Forms.ToolStripStatusLabel();
42+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
43+ this.toolStripMenuItemFile = new System.Windows.Forms.ToolStripMenuItem();
44+ this.NewNToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
45+ this.OpenOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
46+ this.ReloadRToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
47+ this.ReadOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
48+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
49+ this.SaveCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
50+ this.SaveAsWToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
51+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
52+ this.PrintAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
53+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
54+ this.ToolStripMenuItemExit = new System.Windows.Forms.ToolStripMenuItem();
55+ this.EditEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
56+ this.UnDoUToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
57+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
58+ this.InserttoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
59+ this.WizardtoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
60+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
61+ this.ReWizardtoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
62+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
63+ this.CutCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
64+ this.CopyCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
65+ this.PastePToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
66+ this.DeleteDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
67+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
68+ this.FindToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
69+ this.FindNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
70+ this.ReplaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
71+ this.JumpJToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
72+ this.SettingSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
73+ this.AutoSaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
74+ this.OptionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
75+ this.HelpHToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
76+ this.ViewHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
77+ this.AboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
78+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
79+ this.toolStripNewButton1 = new System.Windows.Forms.ToolStripButton();
80+ this.toolStripOpenButton = new System.Windows.Forms.ToolStripButton();
81+ this.toolStripSaveButton = new System.Windows.Forms.ToolStripButton();
82+ this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
83+ this.toolStripNewWizardButton = new System.Windows.Forms.ToolStripButton();
84+ this.toolStripReWizardButton = new System.Windows.Forms.ToolStripButton();
85+ this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
86+ this.toolStripUndoButton = new System.Windows.Forms.ToolStripButton();
87+ this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
88+ this.toolStripCopyButton = new System.Windows.Forms.ToolStripButton();
89+ this.toolStripCutButton = new System.Windows.Forms.ToolStripButton();
90+ this.toolStripPasteButton = new System.Windows.Forms.ToolStripButton();
91+ this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
92+ this.toolStripInsertButton = new System.Windows.Forms.ToolStripButton();
93+ this.toolStripDeleteButton = new System.Windows.Forms.ToolStripButton();
94+ this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
95+ this.FontSmallButton = new System.Windows.Forms.ToolStripButton();
96+ this.fontStandardButton = new System.Windows.Forms.ToolStripButton();
97+ this.fontLergeButton = new System.Windows.Forms.ToolStripButton();
98+ this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
99+ this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
100+ this.combo_encode = new System.Windows.Forms.ToolStripComboBox();
101+ this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
102+ this.toolStripButtonSetting = new System.Windows.Forms.ToolStripButton();
103+ this.panel1 = new System.Windows.Forms.Panel();
104+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
105+ this.LineComment = new System.Windows.Forms.DataGridViewCheckBoxColumn();
106+ this.LineCaption = new System.Windows.Forms.DataGridViewTextBoxColumn();
107+ this.LineLeft = new System.Windows.Forms.DataGridViewTextBoxColumn();
108+ this.LineRight = new System.Windows.Forms.DataGridViewTextBoxColumn();
109+ this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
110+ this.cutContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
111+ this.copyContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
112+ this.pasteContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
113+ this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
114+ this.insertContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
115+ this.deleteContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
116+ this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
117+ this.newWizardContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
118+ this.reWizardContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
119+ this.includeファイルを開くToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
120+ this.statusStrip1.SuspendLayout();
121+ this.menuStrip1.SuspendLayout();
122+ this.toolStrip1.SuspendLayout();
123+ this.panel1.SuspendLayout();
124+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
125+ this.contextMenuStrip1.SuspendLayout();
126+ this.SuspendLayout();
127+ //
128+ // statusStrip1
129+ //
130+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
131+ this.toolStripStatusLabel_FileName,
132+ this.toolStripStatusLabel_encode,
133+ this.toolStripSaveStatusLabel,
134+ this.toolStripStatusLabel_debug,
135+ this.toolStripStatusReadOnly});
136+ this.statusStrip1.Location = new System.Drawing.Point(0, 337);
137+ this.statusStrip1.Name = "statusStrip1";
138+ this.statusStrip1.Size = new System.Drawing.Size(619, 23);
139+ this.statusStrip1.TabIndex = 2;
140+ this.statusStrip1.Text = "statusStrip1";
141+ this.statusStrip1.Click += new System.EventHandler(this.statusStrip1_Click);
142+ //
143+ // toolStripStatusLabel_FileName
144+ //
145+ this.toolStripStatusLabel_FileName.Name = "toolStripStatusLabel_FileName";
146+ this.toolStripStatusLabel_FileName.Size = new System.Drawing.Size(67, 18);
147+ this.toolStripStatusLabel_FileName.Text = "File Name";
148+ //
149+ // toolStripStatusLabel_encode
150+ //
151+ this.toolStripStatusLabel_encode.Name = "toolStripStatusLabel_encode";
152+ this.toolStripStatusLabel_encode.Size = new System.Drawing.Size(89, 18);
153+ this.toolStripStatusLabel_encode.Text = "Encode_name";
154+ //
155+ // toolStripSaveStatusLabel
156+ //
157+ this.toolStripSaveStatusLabel.Name = "toolStripSaveStatusLabel";
158+ this.toolStripSaveStatusLabel.Size = new System.Drawing.Size(75, 18);
159+ this.toolStripSaveStatusLabel.Text = "SaveStatus";
160+ //
161+ // toolStripStatusLabel_debug
162+ //
163+ this.toolStripStatusLabel_debug.Name = "toolStripStatusLabel_debug";
164+ this.toolStripStatusLabel_debug.Size = new System.Drawing.Size(0, 18);
165+ //
166+ // toolStripStatusReadOnly
167+ //
168+ this.toolStripStatusReadOnly.Name = "toolStripStatusReadOnly";
169+ this.toolStripStatusReadOnly.Size = new System.Drawing.Size(0, 18);
170+ //
171+ // menuStrip1
172+ //
173+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
174+ this.toolStripMenuItemFile,
175+ this.EditEToolStripMenuItem,
176+ this.SettingSToolStripMenuItem,
177+ this.HelpHToolStripMenuItem});
178+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
179+ this.menuStrip1.Name = "menuStrip1";
180+ this.menuStrip1.Size = new System.Drawing.Size(619, 26);
181+ this.menuStrip1.TabIndex = 0;
182+ this.menuStrip1.Text = "menuStrip1";
183+ this.menuStrip1.Click += new System.EventHandler(this.menuStrip1_Click);
184+ //
185+ // toolStripMenuItemFile
186+ //
187+ this.toolStripMenuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
188+ this.NewNToolStripMenuItem,
189+ this.OpenOToolStripMenuItem,
190+ this.ReloadRToolStripMenuItem,
191+ this.ReadOnlyToolStripMenuItem,
192+ this.toolStripSeparator1,
193+ this.SaveCToolStripMenuItem,
194+ this.SaveAsWToolStripMenuItem,
195+ this.toolStripSeparator2,
196+ this.PrintAToolStripMenuItem,
197+ this.toolStripSeparator3,
198+ this.ToolStripMenuItemExit});
199+ this.toolStripMenuItemFile.Name = "toolStripMenuItemFile";
200+ this.toolStripMenuItemFile.Size = new System.Drawing.Size(85, 22);
201+ this.toolStripMenuItemFile.Text = "ファイル(&F)";
202+ //
203+ // NewNToolStripMenuItem
204+ //
205+ this.NewNToolStripMenuItem.Name = "NewNToolStripMenuItem";
206+ this.NewNToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
207+ this.NewNToolStripMenuItem.Text = "新規(&N)";
208+ this.NewNToolStripMenuItem.Click += new System.EventHandler(this.NewNToolStripMenuItem_Click);
209+ //
210+ // OpenOToolStripMenuItem
211+ //
212+ this.OpenOToolStripMenuItem.Name = "OpenOToolStripMenuItem";
213+ this.OpenOToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
214+ this.OpenOToolStripMenuItem.Text = "開く(&O)";
215+ this.OpenOToolStripMenuItem.Click += new System.EventHandler(this.OpenOToolStripMenuItem_Click);
216+ //
217+ // ReloadRToolStripMenuItem
218+ //
219+ this.ReloadRToolStripMenuItem.Name = "ReloadRToolStripMenuItem";
220+ this.ReloadRToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
221+ this.ReloadRToolStripMenuItem.Text = "再読み込み(&R)";
222+ this.ReloadRToolStripMenuItem.Click += new System.EventHandler(this.ReloadRToolStripMenuItem_Click);
223+ //
224+ // ReadOnlyToolStripMenuItem
225+ //
226+ this.ReadOnlyToolStripMenuItem.Name = "ReadOnlyToolStripMenuItem";
227+ this.ReadOnlyToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
228+ this.ReadOnlyToolStripMenuItem.Text = "再読み込み 読み込み専用(&Q)";
229+ this.ReadOnlyToolStripMenuItem.Click += new System.EventHandler(this.ReadOnlyToolStripMenuItem_Click);
230+ //
231+ // toolStripSeparator1
232+ //
233+ this.toolStripSeparator1.Name = "toolStripSeparator1";
234+ this.toolStripSeparator1.Size = new System.Drawing.Size(228, 6);
235+ this.toolStripSeparator1.Click += new System.EventHandler(this.toolStripSeparator1_Click);
236+ //
237+ // SaveCToolStripMenuItem
238+ //
239+ this.SaveCToolStripMenuItem.Name = "SaveCToolStripMenuItem";
240+ this.SaveCToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
241+ this.SaveCToolStripMenuItem.Text = "上書き保存(&S)";
242+ this.SaveCToolStripMenuItem.Click += new System.EventHandler(this.SaveCToolStripMenuItem_Click);
243+ //
244+ // SaveAsWToolStripMenuItem
245+ //
246+ this.SaveAsWToolStripMenuItem.Name = "SaveAsWToolStripMenuItem";
247+ this.SaveAsWToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
248+ this.SaveAsWToolStripMenuItem.Text = "名前を付けて保存(&A)";
249+ this.SaveAsWToolStripMenuItem.Click += new System.EventHandler(this.SaveAsWToolStripMenuItem_Click);
250+ //
251+ // toolStripSeparator2
252+ //
253+ this.toolStripSeparator2.Name = "toolStripSeparator2";
254+ this.toolStripSeparator2.Size = new System.Drawing.Size(228, 6);
255+ //
256+ // PrintAToolStripMenuItem
257+ //
258+ this.PrintAToolStripMenuItem.Enabled = false;
259+ this.PrintAToolStripMenuItem.Name = "PrintAToolStripMenuItem";
260+ this.PrintAToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
261+ this.PrintAToolStripMenuItem.Text = "印刷(&P)";
262+ this.PrintAToolStripMenuItem.Click += new System.EventHandler(this.PrintAToolStripMenuItem_Click);
263+ //
264+ // toolStripSeparator3
265+ //
266+ this.toolStripSeparator3.Name = "toolStripSeparator3";
267+ this.toolStripSeparator3.Size = new System.Drawing.Size(228, 6);
268+ //
269+ // ToolStripMenuItemExit
270+ //
271+ this.ToolStripMenuItemExit.Name = "ToolStripMenuItemExit";
272+ this.ToolStripMenuItemExit.Size = new System.Drawing.Size(231, 22);
273+ this.ToolStripMenuItemExit.Text = "終了(&X)";
274+ this.ToolStripMenuItemExit.Click += new System.EventHandler(this.ToolStripMenuItemExit_Click);
275+ //
276+ // EditEToolStripMenuItem
277+ //
278+ this.EditEToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
279+ this.UnDoUToolStripMenuItem,
280+ this.toolStripSeparator4,
281+ this.InserttoolStripMenuItem,
282+ this.WizardtoolStripMenuItem,
283+ this.toolStripSeparator7,
284+ this.ReWizardtoolStripMenuItem,
285+ this.toolStripSeparator6,
286+ this.CutCToolStripMenuItem,
287+ this.CopyCToolStripMenuItem,
288+ this.PastePToolStripMenuItem,
289+ this.DeleteDToolStripMenuItem,
290+ this.toolStripSeparator5,
291+ this.FindToolStripMenuItem,
292+ this.FindNextToolStripMenuItem,
293+ this.ReplaceToolStripMenuItem,
294+ this.JumpJToolStripMenuItem});
295+ this.EditEToolStripMenuItem.Name = "EditEToolStripMenuItem";
296+ this.EditEToolStripMenuItem.Size = new System.Drawing.Size(61, 22);
297+ this.EditEToolStripMenuItem.Text = "編集(&E)";
298+ //
299+ // UnDoUToolStripMenuItem
300+ //
301+ this.UnDoUToolStripMenuItem.Enabled = false;
302+ this.UnDoUToolStripMenuItem.Name = "UnDoUToolStripMenuItem";
303+ this.UnDoUToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
304+ this.UnDoUToolStripMenuItem.Text = "元に戻す(&U)";
305+ this.UnDoUToolStripMenuItem.Click += new System.EventHandler(this.UnDoUToolStripMenuItem_Click);
306+ //
307+ // toolStripSeparator4
308+ //
309+ this.toolStripSeparator4.Name = "toolStripSeparator4";
310+ this.toolStripSeparator4.Size = new System.Drawing.Size(179, 6);
311+ //
312+ // InserttoolStripMenuItem
313+ //
314+ this.InserttoolStripMenuItem.Name = "InserttoolStripMenuItem";
315+ this.InserttoolStripMenuItem.Size = new System.Drawing.Size(182, 22);
316+ this.InserttoolStripMenuItem.Text = "挿入(&I)";
317+ this.InserttoolStripMenuItem.Click += new System.EventHandler(this.InserttoolStripMenuItem_Click);
318+ //
319+ // WizardtoolStripMenuItem
320+ //
321+ this.WizardtoolStripMenuItem.Name = "WizardtoolStripMenuItem";
322+ this.WizardtoolStripMenuItem.Size = new System.Drawing.Size(182, 22);
323+ this.WizardtoolStripMenuItem.Text = "挿入ウィザード(&W)";
324+ this.WizardtoolStripMenuItem.Click += new System.EventHandler(this.WizardtoolStripMenuItem_Click);
325+ //
326+ // toolStripSeparator7
327+ //
328+ this.toolStripSeparator7.Name = "toolStripSeparator7";
329+ this.toolStripSeparator7.Size = new System.Drawing.Size(179, 6);
330+ //
331+ // ReWizardtoolStripMenuItem
332+ //
333+ this.ReWizardtoolStripMenuItem.Name = "ReWizardtoolStripMenuItem";
334+ this.ReWizardtoolStripMenuItem.Size = new System.Drawing.Size(182, 22);
335+ this.ReWizardtoolStripMenuItem.Text = "再ウィザード(&R)";
336+ this.ReWizardtoolStripMenuItem.Click += new System.EventHandler(this.ReWizardtoolStripMenuItem_Click);
337+ //
338+ // toolStripSeparator6
339+ //
340+ this.toolStripSeparator6.Name = "toolStripSeparator6";
341+ this.toolStripSeparator6.Size = new System.Drawing.Size(179, 6);
342+ //
343+ // CutCToolStripMenuItem
344+ //
345+ this.CutCToolStripMenuItem.Name = "CutCToolStripMenuItem";
346+ this.CutCToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
347+ this.CutCToolStripMenuItem.Text = "切り取り(&T)";
348+ this.CutCToolStripMenuItem.Click += new System.EventHandler(this.CutCToolStripMenuItem_Click);
349+ //
350+ // CopyCToolStripMenuItem
351+ //
352+ this.CopyCToolStripMenuItem.Name = "CopyCToolStripMenuItem";
353+ this.CopyCToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
354+ this.CopyCToolStripMenuItem.Text = "コピー(&C)";
355+ this.CopyCToolStripMenuItem.Click += new System.EventHandler(this.CopyCToolStripMenuItem_Click);
356+ //
357+ // PastePToolStripMenuItem
358+ //
359+ this.PastePToolStripMenuItem.Name = "PastePToolStripMenuItem";
360+ this.PastePToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
361+ this.PastePToolStripMenuItem.Text = "貼り付け(&P)";
362+ this.PastePToolStripMenuItem.Click += new System.EventHandler(this.PastePToolStripMenuItem_Click);
363+ //
364+ // DeleteDToolStripMenuItem
365+ //
366+ this.DeleteDToolStripMenuItem.Name = "DeleteDToolStripMenuItem";
367+ this.DeleteDToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
368+ this.DeleteDToolStripMenuItem.Text = "削除(&L)";
369+ this.DeleteDToolStripMenuItem.Click += new System.EventHandler(this.DeleteDToolStripMenuItem_Click);
370+ //
371+ // toolStripSeparator5
372+ //
373+ this.toolStripSeparator5.Name = "toolStripSeparator5";
374+ this.toolStripSeparator5.Size = new System.Drawing.Size(179, 6);
375+ //
376+ // FindToolStripMenuItem
377+ //
378+ this.FindToolStripMenuItem.Enabled = false;
379+ this.FindToolStripMenuItem.Name = "FindToolStripMenuItem";
380+ this.FindToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
381+ this.FindToolStripMenuItem.Text = "検索(&F)";
382+ this.FindToolStripMenuItem.Click += new System.EventHandler(this.FindToolStripMenuItem_Click);
383+ //
384+ // FindNextToolStripMenuItem
385+ //
386+ this.FindNextToolStripMenuItem.Enabled = false;
387+ this.FindNextToolStripMenuItem.Name = "FindNextToolStripMenuItem";
388+ this.FindNextToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
389+ this.FindNextToolStripMenuItem.Text = "次を検索(&N)";
390+ this.FindNextToolStripMenuItem.Click += new System.EventHandler(this.FindNextToolStripMenuItem_Click);
391+ //
392+ // ReplaceToolStripMenuItem
393+ //
394+ this.ReplaceToolStripMenuItem.Enabled = false;
395+ this.ReplaceToolStripMenuItem.Name = "ReplaceToolStripMenuItem";
396+ this.ReplaceToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
397+ this.ReplaceToolStripMenuItem.Text = "置換(&R)";
398+ this.ReplaceToolStripMenuItem.Click += new System.EventHandler(this.ReplaceToolStripMenuItem_Click);
399+ //
400+ // JumpJToolStripMenuItem
401+ //
402+ this.JumpJToolStripMenuItem.Enabled = false;
403+ this.JumpJToolStripMenuItem.Name = "JumpJToolStripMenuItem";
404+ this.JumpJToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
405+ this.JumpJToolStripMenuItem.Text = "行へ移動(&G)";
406+ this.JumpJToolStripMenuItem.Click += new System.EventHandler(this.JumpJToolStripMenuItem_Click);
407+ //
408+ // SettingSToolStripMenuItem
409+ //
410+ this.SettingSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
411+ this.AutoSaveToolStripMenuItem,
412+ this.OptionToolStripMenuItem});
413+ this.SettingSToolStripMenuItem.Name = "SettingSToolStripMenuItem";
414+ this.SettingSToolStripMenuItem.Size = new System.Drawing.Size(62, 22);
415+ this.SettingSToolStripMenuItem.Text = "設定(&S)";
416+ //
417+ // AutoSaveToolStripMenuItem
418+ //
419+ this.AutoSaveToolStripMenuItem.CheckOnClick = true;
420+ this.AutoSaveToolStripMenuItem.Name = "AutoSaveToolStripMenuItem";
421+ this.AutoSaveToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
422+ this.AutoSaveToolStripMenuItem.Text = "自動保存";
423+ this.AutoSaveToolStripMenuItem.Click += new System.EventHandler(this.AutoSaveToolStripMenuItem_Click);
424+ //
425+ // OptionToolStripMenuItem
426+ //
427+ this.OptionToolStripMenuItem.Name = "OptionToolStripMenuItem";
428+ this.OptionToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
429+ this.OptionToolStripMenuItem.Text = "オプション";
430+ this.OptionToolStripMenuItem.Click += new System.EventHandler(this.OptionToolStripMenuItem_Click);
431+ //
432+ // HelpHToolStripMenuItem
433+ //
434+ this.HelpHToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
435+ this.ViewHelpToolStripMenuItem,
436+ this.AboutToolStripMenuItem});
437+ this.HelpHToolStripMenuItem.Name = "HelpHToolStripMenuItem";
438+ this.HelpHToolStripMenuItem.Size = new System.Drawing.Size(75, 22);
439+ this.HelpHToolStripMenuItem.Text = "ヘルプ(&H)";
440+ //
441+ // ViewHelpToolStripMenuItem
442+ //
443+ this.ViewHelpToolStripMenuItem.Name = "ViewHelpToolStripMenuItem";
444+ this.ViewHelpToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
445+ this.ViewHelpToolStripMenuItem.Text = "ヘルプ";
446+ this.ViewHelpToolStripMenuItem.Click += new System.EventHandler(this.ViewHelpToolStripMenuItem_Click);
447+ //
448+ // AboutToolStripMenuItem
449+ //
450+ this.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem";
451+ this.AboutToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
452+ this.AboutToolStripMenuItem.Text = "のどかGuiEditについて";
453+ this.AboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItem_Click);
454+ //
455+ // toolStrip1
456+ //
457+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
458+ this.toolStripNewButton1,
459+ this.toolStripOpenButton,
460+ this.toolStripSaveButton,
461+ this.toolStripSeparator9,
462+ this.toolStripNewWizardButton,
463+ this.toolStripReWizardButton,
464+ this.toolStripSeparator10,
465+ this.toolStripUndoButton,
466+ this.toolStripSeparator11,
467+ this.toolStripCopyButton,
468+ this.toolStripCutButton,
469+ this.toolStripPasteButton,
470+ this.toolStripSeparator8,
471+ this.toolStripInsertButton,
472+ this.toolStripDeleteButton,
473+ this.toolStripSeparator14,
474+ this.FontSmallButton,
475+ this.fontStandardButton,
476+ this.fontLergeButton,
477+ this.toolStripSeparator15,
478+ this.toolStripLabel1,
479+ this.combo_encode,
480+ this.toolStripSeparator16,
481+ this.toolStripButtonSetting});
482+ this.toolStrip1.Location = new System.Drawing.Point(0, 26);
483+ this.toolStrip1.Name = "toolStrip1";
484+ this.toolStrip1.Size = new System.Drawing.Size(619, 25);
485+ this.toolStrip1.TabIndex = 1;
486+ this.toolStrip1.Text = "toolStrip1";
487+ this.toolStrip1.Click += new System.EventHandler(this.toolStrip1_Click);
488+ //
489+ // toolStripNewButton1
490+ //
491+ this.toolStripNewButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
492+ this.toolStripNewButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripNewButton1.Image")));
493+ this.toolStripNewButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
494+ this.toolStripNewButton1.Name = "toolStripNewButton1";
495+ this.toolStripNewButton1.Size = new System.Drawing.Size(23, 22);
496+ this.toolStripNewButton1.Text = "新規";
497+ this.toolStripNewButton1.Click += new System.EventHandler(this.toolStripNewButton1_Click);
498+ //
499+ // toolStripOpenButton
500+ //
501+ this.toolStripOpenButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
502+ this.toolStripOpenButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripOpenButton.Image")));
503+ this.toolStripOpenButton.ImageTransparentColor = System.Drawing.Color.Magenta;
504+ this.toolStripOpenButton.Name = "toolStripOpenButton";
505+ this.toolStripOpenButton.Size = new System.Drawing.Size(23, 22);
506+ this.toolStripOpenButton.Text = "開く";
507+ this.toolStripOpenButton.Click += new System.EventHandler(this.toolStripOpenButton_Click);
508+ //
509+ // toolStripSaveButton
510+ //
511+ this.toolStripSaveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
512+ this.toolStripSaveButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSaveButton.Image")));
513+ this.toolStripSaveButton.ImageTransparentColor = System.Drawing.Color.Magenta;
514+ this.toolStripSaveButton.Name = "toolStripSaveButton";
515+ this.toolStripSaveButton.Size = new System.Drawing.Size(23, 22);
516+ this.toolStripSaveButton.Text = "保存";
517+ this.toolStripSaveButton.Click += new System.EventHandler(this.toolStripSaveButton_Click);
518+ //
519+ // toolStripSeparator9
520+ //
521+ this.toolStripSeparator9.Name = "toolStripSeparator9";
522+ this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25);
523+ //
524+ // toolStripNewWizardButton
525+ //
526+ this.toolStripNewWizardButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
527+ this.toolStripNewWizardButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripNewWizardButton.Image")));
528+ this.toolStripNewWizardButton.ImageTransparentColor = System.Drawing.Color.Magenta;
529+ this.toolStripNewWizardButton.Name = "toolStripNewWizardButton";
530+ this.toolStripNewWizardButton.Size = new System.Drawing.Size(23, 22);
531+ this.toolStripNewWizardButton.Text = "挿入ウィザード";
532+ this.toolStripNewWizardButton.Click += new System.EventHandler(this.toolStripNewWizardButton_Click);
533+ //
534+ // toolStripReWizardButton
535+ //
536+ this.toolStripReWizardButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
537+ this.toolStripReWizardButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripReWizardButton.Image")));
538+ this.toolStripReWizardButton.ImageTransparentColor = System.Drawing.Color.Magenta;
539+ this.toolStripReWizardButton.Name = "toolStripReWizardButton";
540+ this.toolStripReWizardButton.Size = new System.Drawing.Size(23, 22);
541+ this.toolStripReWizardButton.Text = "再ウィザード";
542+ this.toolStripReWizardButton.Click += new System.EventHandler(this.toolStripReWizardButton_Click);
543+ //
544+ // toolStripSeparator10
545+ //
546+ this.toolStripSeparator10.Name = "toolStripSeparator10";
547+ this.toolStripSeparator10.Size = new System.Drawing.Size(6, 25);
548+ //
549+ // toolStripUndoButton
550+ //
551+ this.toolStripUndoButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
552+ this.toolStripUndoButton.Enabled = false;
553+ this.toolStripUndoButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripUndoButton.Image")));
554+ this.toolStripUndoButton.ImageTransparentColor = System.Drawing.Color.Magenta;
555+ this.toolStripUndoButton.Name = "toolStripUndoButton";
556+ this.toolStripUndoButton.Size = new System.Drawing.Size(23, 22);
557+ this.toolStripUndoButton.Text = "やり直し";
558+ this.toolStripUndoButton.Click += new System.EventHandler(this.toolStripUndoButton_Click);
559+ //
560+ // toolStripSeparator11
561+ //
562+ this.toolStripSeparator11.Name = "toolStripSeparator11";
563+ this.toolStripSeparator11.Size = new System.Drawing.Size(6, 25);
564+ //
565+ // toolStripCopyButton
566+ //
567+ this.toolStripCopyButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
568+ this.toolStripCopyButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripCopyButton.Image")));
569+ this.toolStripCopyButton.ImageTransparentColor = System.Drawing.Color.Magenta;
570+ this.toolStripCopyButton.Name = "toolStripCopyButton";
571+ this.toolStripCopyButton.Size = new System.Drawing.Size(23, 22);
572+ this.toolStripCopyButton.Text = "コピー";
573+ this.toolStripCopyButton.Click += new System.EventHandler(this.toolStripCopyButton_Click);
574+ //
575+ // toolStripCutButton
576+ //
577+ this.toolStripCutButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
578+ this.toolStripCutButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripCutButton.Image")));
579+ this.toolStripCutButton.ImageTransparentColor = System.Drawing.Color.Magenta;
580+ this.toolStripCutButton.Name = "toolStripCutButton";
581+ this.toolStripCutButton.Size = new System.Drawing.Size(23, 22);
582+ this.toolStripCutButton.Text = "切り取り";
583+ this.toolStripCutButton.Click += new System.EventHandler(this.toolStripCutButton_Click);
584+ //
585+ // toolStripPasteButton
586+ //
587+ this.toolStripPasteButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
588+ this.toolStripPasteButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripPasteButton.Image")));
589+ this.toolStripPasteButton.ImageTransparentColor = System.Drawing.Color.Magenta;
590+ this.toolStripPasteButton.Name = "toolStripPasteButton";
591+ this.toolStripPasteButton.Size = new System.Drawing.Size(23, 22);
592+ this.toolStripPasteButton.Text = "貼り付け";
593+ this.toolStripPasteButton.Click += new System.EventHandler(this.toolStripPasteButton_Click);
594+ //
595+ // toolStripSeparator8
596+ //
597+ this.toolStripSeparator8.Name = "toolStripSeparator8";
598+ this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25);
599+ //
600+ // toolStripInsertButton
601+ //
602+ this.toolStripInsertButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
603+ this.toolStripInsertButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripInsertButton.Image")));
604+ this.toolStripInsertButton.ImageTransparentColor = System.Drawing.Color.Magenta;
605+ this.toolStripInsertButton.Name = "toolStripInsertButton";
606+ this.toolStripInsertButton.Size = new System.Drawing.Size(23, 22);
607+ this.toolStripInsertButton.Text = "挿入";
608+ this.toolStripInsertButton.Click += new System.EventHandler(this.toolStripInsertButton_Click);
609+ //
610+ // toolStripDeleteButton
611+ //
612+ this.toolStripDeleteButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
613+ this.toolStripDeleteButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDeleteButton.Image")));
614+ this.toolStripDeleteButton.ImageTransparentColor = System.Drawing.Color.Magenta;
615+ this.toolStripDeleteButton.Name = "toolStripDeleteButton";
616+ this.toolStripDeleteButton.Size = new System.Drawing.Size(23, 22);
617+ this.toolStripDeleteButton.Text = "削除";
618+ this.toolStripDeleteButton.Click += new System.EventHandler(this.toolStripDeleteButton_Click);
619+ //
620+ // toolStripSeparator14
621+ //
622+ this.toolStripSeparator14.Name = "toolStripSeparator14";
623+ this.toolStripSeparator14.Size = new System.Drawing.Size(6, 25);
624+ //
625+ // FontSmallButton
626+ //
627+ this.FontSmallButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
628+ this.FontSmallButton.Image = ((System.Drawing.Image)(resources.GetObject("FontSmallButton.Image")));
629+ this.FontSmallButton.ImageTransparentColor = System.Drawing.Color.Magenta;
630+ this.FontSmallButton.Name = "FontSmallButton";
631+ this.FontSmallButton.Size = new System.Drawing.Size(23, 22);
632+ this.FontSmallButton.Text = "フォントサイズ縮小";
633+ this.FontSmallButton.Click += new System.EventHandler(this.FontSmallButton_Click);
634+ //
635+ // fontStandardButton
636+ //
637+ this.fontStandardButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
638+ this.fontStandardButton.Image = ((System.Drawing.Image)(resources.GetObject("fontStandardButton.Image")));
639+ this.fontStandardButton.ImageTransparentColor = System.Drawing.Color.Magenta;
640+ this.fontStandardButton.Name = "fontStandardButton";
641+ this.fontStandardButton.Size = new System.Drawing.Size(23, 22);
642+ this.fontStandardButton.Text = "フォントサイズ標準";
643+ this.fontStandardButton.Click += new System.EventHandler(this.fontStandardButton_Click);
644+ //
645+ // fontLergeButton
646+ //
647+ this.fontLergeButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
648+ this.fontLergeButton.Image = ((System.Drawing.Image)(resources.GetObject("fontLergeButton.Image")));
649+ this.fontLergeButton.ImageTransparentColor = System.Drawing.Color.Magenta;
650+ this.fontLergeButton.Name = "fontLergeButton";
651+ this.fontLergeButton.Size = new System.Drawing.Size(23, 22);
652+ this.fontLergeButton.Text = "フォントサイズ拡大";
653+ this.fontLergeButton.Click += new System.EventHandler(this.fontLergeButton_Click);
654+ //
655+ // toolStripSeparator15
656+ //
657+ this.toolStripSeparator15.Name = "toolStripSeparator15";
658+ this.toolStripSeparator15.Size = new System.Drawing.Size(6, 25);
659+ //
660+ // toolStripLabel1
661+ //
662+ this.toolStripLabel1.Name = "toolStripLabel1";
663+ this.toolStripLabel1.Size = new System.Drawing.Size(68, 22);
664+ this.toolStripLabel1.Text = "文字コード";
665+ //
666+ // combo_encode
667+ //
668+ this.combo_encode.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
669+ this.combo_encode.Name = "combo_encode";
670+ this.combo_encode.Size = new System.Drawing.Size(121, 25);
671+ this.combo_encode.SelectedIndexChanged += new System.EventHandler(this.combo_encode_SelectedIndexChanged);
672+ //
673+ // toolStripSeparator16
674+ //
675+ this.toolStripSeparator16.Name = "toolStripSeparator16";
676+ this.toolStripSeparator16.Size = new System.Drawing.Size(6, 25);
677+ //
678+ // toolStripButtonSetting
679+ //
680+ this.toolStripButtonSetting.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
681+ this.toolStripButtonSetting.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonSetting.Image")));
682+ this.toolStripButtonSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
683+ this.toolStripButtonSetting.Name = "toolStripButtonSetting";
684+ this.toolStripButtonSetting.Size = new System.Drawing.Size(23, 22);
685+ this.toolStripButtonSetting.Click += new System.EventHandler(this.toolStripButtonSetting_Click);
686+ //
687+ // panel1
688+ //
689+ this.panel1.Controls.Add(this.dataGridView1);
690+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
691+ this.panel1.Location = new System.Drawing.Point(0, 51);
692+ this.panel1.Name = "panel1";
693+ this.panel1.Size = new System.Drawing.Size(619, 286);
694+ this.panel1.TabIndex = 3;
695+ //
696+ // dataGridView1
697+ //
698+ this.dataGridView1.AllowUserToResizeRows = false;
699+ this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
700+ this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders;
701+ this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
702+ dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
703+ dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
704+ dataGridViewCellStyle4.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
705+ dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
706+ dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
707+ dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
708+ dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
709+ this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
710+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
711+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
712+ this.LineComment,
713+ this.LineCaption,
714+ this.LineLeft,
715+ this.LineRight});
716+ dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
717+ dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
718+ dataGridViewCellStyle5.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
719+ dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
720+ dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
721+ dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
722+ dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
723+ this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
724+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
725+ this.dataGridView1.Location = new System.Drawing.Point(0, 0);
726+ this.dataGridView1.Name = "dataGridView1";
727+ dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
728+ dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
729+ dataGridViewCellStyle6.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
730+ dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
731+ dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
732+ dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
733+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
734+ this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
735+ this.dataGridView1.RowTemplate.Height = 21;
736+ this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
737+ this.dataGridView1.Size = new System.Drawing.Size(619, 286);
738+ this.dataGridView1.TabIndex = 0;
739+ this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
740+ this.dataGridView1.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentDoubleClick);
741+ this.dataGridView1.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellValueChanged);
742+ this.dataGridView1.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.dataGridView1_EditingControlShowing);
743+ this.dataGridView1.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.dataGridView1_RowPrePaint);
744+ this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyDown);
745+ //
746+ // LineComment
747+ //
748+ this.LineComment.FillWeight = 16F;
749+ this.LineComment.HeaderText = "コメント";
750+ this.LineComment.MinimumWidth = 32;
751+ this.LineComment.Name = "LineComment";
752+ this.LineComment.Resizable = System.Windows.Forms.DataGridViewTriState.True;
753+ //
754+ // LineCaption
755+ //
756+ this.LineCaption.HeaderText = "説明(キャプション)";
757+ this.LineCaption.Name = "LineCaption";
758+ this.LineCaption.Resizable = System.Windows.Forms.DataGridViewTriState.True;
759+ this.LineCaption.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
760+ //
761+ // LineLeft
762+ //
763+ this.LineLeft.FillWeight = 50F;
764+ this.LineLeft.HeaderText = "▼";
765+ this.LineLeft.Name = "LineLeft";
766+ this.LineLeft.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
767+ //
768+ // LineRight
769+ //
770+ this.LineRight.FillWeight = 50F;
771+ this.LineRight.HeaderText = "▼";
772+ this.LineRight.Name = "LineRight";
773+ this.LineRight.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
774+ //
775+ // contextMenuStrip1
776+ //
777+ this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
778+ this.cutContextMenuItem,
779+ this.copyContextMenuItem,
780+ this.pasteContextMenuItem,
781+ this.toolStripSeparator12,
782+ this.insertContextMenuItem,
783+ this.deleteContextMenuItem,
784+ this.toolStripSeparator13,
785+ this.newWizardContextMenuItem,
786+ this.reWizardContextMenuItem,
787+ this.includeファイルを開くToolStripMenuItem});
788+ this.contextMenuStrip1.Name = "contextMenuStrip1";
789+ this.contextMenuStrip1.Size = new System.Drawing.Size(201, 192);
790+ //
791+ // cutContextMenuItem
792+ //
793+ this.cutContextMenuItem.Name = "cutContextMenuItem";
794+ this.cutContextMenuItem.Size = new System.Drawing.Size(200, 22);
795+ this.cutContextMenuItem.Text = "切り取り";
796+ this.cutContextMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
797+ //
798+ // copyContextMenuItem
799+ //
800+ this.copyContextMenuItem.Name = "copyContextMenuItem";
801+ this.copyContextMenuItem.Size = new System.Drawing.Size(200, 22);
802+ this.copyContextMenuItem.Text = "コピー";
803+ this.copyContextMenuItem.Click += new System.EventHandler(this.copyContextMenuItem_Click);
804+ //
805+ // pasteContextMenuItem
806+ //
807+ this.pasteContextMenuItem.Name = "pasteContextMenuItem";
808+ this.pasteContextMenuItem.Size = new System.Drawing.Size(200, 22);
809+ this.pasteContextMenuItem.Text = "貼り付け";
810+ this.pasteContextMenuItem.Click += new System.EventHandler(this.pasteContextMenuItem_Click);
811+ //
812+ // toolStripSeparator12
813+ //
814+ this.toolStripSeparator12.Name = "toolStripSeparator12";
815+ this.toolStripSeparator12.Size = new System.Drawing.Size(197, 6);
816+ //
817+ // insertContextMenuItem
818+ //
819+ this.insertContextMenuItem.Name = "insertContextMenuItem";
820+ this.insertContextMenuItem.Size = new System.Drawing.Size(200, 22);
821+ this.insertContextMenuItem.Text = "挿入";
822+ this.insertContextMenuItem.Click += new System.EventHandler(this.insertContextMenuItem_Click);
823+ //
824+ // deleteContextMenuItem
825+ //
826+ this.deleteContextMenuItem.Name = "deleteContextMenuItem";
827+ this.deleteContextMenuItem.Size = new System.Drawing.Size(200, 22);
828+ this.deleteContextMenuItem.Text = "削除";
829+ this.deleteContextMenuItem.Click += new System.EventHandler(this.deleteContextMenuItem_Click);
830+ //
831+ // toolStripSeparator13
832+ //
833+ this.toolStripSeparator13.Name = "toolStripSeparator13";
834+ this.toolStripSeparator13.Size = new System.Drawing.Size(197, 6);
835+ //
836+ // newWizardContextMenuItem
837+ //
838+ this.newWizardContextMenuItem.Name = "newWizardContextMenuItem";
839+ this.newWizardContextMenuItem.Size = new System.Drawing.Size(200, 22);
840+ this.newWizardContextMenuItem.Text = "挿入ウィザード";
841+ this.newWizardContextMenuItem.Click += new System.EventHandler(this.newWizardContextMenuItem_Click);
842+ //
843+ // reWizardContextMenuItem
844+ //
845+ this.reWizardContextMenuItem.Name = "reWizardContextMenuItem";
846+ this.reWizardContextMenuItem.Size = new System.Drawing.Size(200, 22);
847+ this.reWizardContextMenuItem.Text = "再ウィザード";
848+ this.reWizardContextMenuItem.Click += new System.EventHandler(this.reWizardContextMenuItem_Click);
849+ //
850+ // includeファイルを開くToolStripMenuItem
851+ //
852+ this.includeファイルを開くToolStripMenuItem.Name = "includeファイルを開くToolStripMenuItem";
853+ this.includeファイルを開くToolStripMenuItem.Size = new System.Drawing.Size(200, 22);
854+ this.includeファイルを開くToolStripMenuItem.Text = "includeファイルを開く";
855+ this.includeファイルを開くToolStripMenuItem.Click += new System.EventHandler(this.openIncludeFile);
856+ //
857+ // FormMain
858+ //
859+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
860+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
861+ this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
862+ this.ClientSize = new System.Drawing.Size(619, 360);
863+ this.Controls.Add(this.panel1);
864+ this.Controls.Add(this.toolStrip1);
865+ this.Controls.Add(this.statusStrip1);
866+ this.Controls.Add(this.menuStrip1);
867+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
868+ this.MainMenuStrip = this.menuStrip1;
869+ this.Name = "FormMain";
870+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
871+ this.Text = "のどかGuiEdit";
872+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_Closing);
873+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed);
874+ this.Load += new System.EventHandler(this.Form1_Load);
875+ this.Shown += new System.EventHandler(this.FormMain_Shown);
876+ this.Click += new System.EventHandler(this.FormMain_Click);
877+ this.statusStrip1.ResumeLayout(false);
878+ this.statusStrip1.PerformLayout();
879+ this.menuStrip1.ResumeLayout(false);
880+ this.menuStrip1.PerformLayout();
881+ this.toolStrip1.ResumeLayout(false);
882+ this.toolStrip1.PerformLayout();
883+ this.panel1.ResumeLayout(false);
884+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
885+ this.contextMenuStrip1.ResumeLayout(false);
886+ this.ResumeLayout(false);
887+ this.PerformLayout();
888+
889+ }
890+
891+ #endregion
892+
893+ private System.Windows.Forms.StatusStrip statusStrip1;
894+ private System.Windows.Forms.MenuStrip menuStrip1;
895+ private System.Windows.Forms.ToolStrip toolStrip1;
896+ private System.Windows.Forms.Panel panel1;
897+ private System.Windows.Forms.DataGridView dataGridView1;
898+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel_FileName;
899+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemFile;
900+ private System.Windows.Forms.ToolStripMenuItem NewNToolStripMenuItem;
901+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
902+ private System.Windows.Forms.ToolStripMenuItem SaveCToolStripMenuItem;
903+ private System.Windows.Forms.ToolStripMenuItem SaveAsWToolStripMenuItem;
904+ private System.Windows.Forms.ToolStripMenuItem PrintAToolStripMenuItem;
905+ private System.Windows.Forms.ToolStripMenuItem EditEToolStripMenuItem;
906+ private System.Windows.Forms.ToolStripMenuItem SettingSToolStripMenuItem;
907+ private System.Windows.Forms.ToolStripMenuItem AutoSaveToolStripMenuItem;
908+ private System.Windows.Forms.ToolStripMenuItem OptionToolStripMenuItem;
909+ private System.Windows.Forms.ToolStripMenuItem HelpHToolStripMenuItem;
910+ private System.Windows.Forms.ToolStripMenuItem AboutToolStripMenuItem;
911+ private System.Windows.Forms.ToolStripMenuItem ViewHelpToolStripMenuItem;
912+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
913+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
914+ private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItemExit;
915+ private System.Windows.Forms.ToolStripMenuItem UnDoUToolStripMenuItem;
916+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
917+ private System.Windows.Forms.ToolStripMenuItem CutCToolStripMenuItem;
918+ private System.Windows.Forms.ToolStripMenuItem CopyCToolStripMenuItem;
919+ private System.Windows.Forms.ToolStripMenuItem PastePToolStripMenuItem;
920+ private System.Windows.Forms.ToolStripMenuItem DeleteDToolStripMenuItem;
921+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
922+ private System.Windows.Forms.ToolStripMenuItem FindToolStripMenuItem;
923+ private System.Windows.Forms.ToolStripMenuItem FindNextToolStripMenuItem;
924+ private System.Windows.Forms.ToolStripMenuItem ReplaceToolStripMenuItem;
925+ private System.Windows.Forms.ToolStripMenuItem JumpJToolStripMenuItem;
926+ private System.Windows.Forms.ToolStripMenuItem InserttoolStripMenuItem;
927+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
928+ private System.Windows.Forms.ToolStripMenuItem WizardtoolStripMenuItem;
929+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
930+ private System.Windows.Forms.ToolStripMenuItem ReWizardtoolStripMenuItem;
931+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel_encode;
932+ private System.Windows.Forms.ToolStripButton toolStripNewButton1;
933+ private System.Windows.Forms.ToolStripButton toolStripOpenButton;
934+ private System.Windows.Forms.ToolStripButton toolStripSaveButton;
935+ private System.Windows.Forms.ToolStripButton toolStripNewWizardButton;
936+ private System.Windows.Forms.ToolStripButton toolStripReWizardButton;
937+ private System.Windows.Forms.ToolStripButton toolStripUndoButton;
938+ private System.Windows.Forms.ToolStripButton toolStripCopyButton;
939+ private System.Windows.Forms.ToolStripButton toolStripCutButton;
940+ private System.Windows.Forms.ToolStripButton toolStripPasteButton;
941+ private System.Windows.Forms.ToolStripStatusLabel toolStripSaveStatusLabel;
942+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
943+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
944+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
945+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
946+ private System.Windows.Forms.ToolStripButton toolStripInsertButton;
947+ private System.Windows.Forms.ToolStripButton toolStripDeleteButton;
948+ private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
949+ private System.Windows.Forms.ToolStripMenuItem cutContextMenuItem;
950+ private System.Windows.Forms.ToolStripMenuItem copyContextMenuItem;
951+ private System.Windows.Forms.ToolStripMenuItem pasteContextMenuItem;
952+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
953+ private System.Windows.Forms.ToolStripMenuItem insertContextMenuItem;
954+ private System.Windows.Forms.ToolStripMenuItem deleteContextMenuItem;
955+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
956+ private System.Windows.Forms.ToolStripMenuItem newWizardContextMenuItem;
957+ private System.Windows.Forms.ToolStripMenuItem reWizardContextMenuItem;
958+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
959+ private System.Windows.Forms.ToolStripButton FontSmallButton;
960+ private System.Windows.Forms.ToolStripButton fontStandardButton;
961+ private System.Windows.Forms.ToolStripButton fontLergeButton;
962+ private System.Windows.Forms.ToolStripMenuItem ReloadRToolStripMenuItem;
963+ private System.Windows.Forms.ToolStripMenuItem includeファイルを開くToolStripMenuItem;
964+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel_debug;
965+ private System.Windows.Forms.DataGridViewCheckBoxColumn LineComment;
966+ private System.Windows.Forms.DataGridViewTextBoxColumn LineCaption;
967+ private System.Windows.Forms.DataGridViewTextBoxColumn LineLeft;
968+ private System.Windows.Forms.DataGridViewTextBoxColumn LineRight;
969+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
970+ private System.Windows.Forms.ToolStripButton toolStripButtonSetting;
971+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
972+ private System.Windows.Forms.ToolStripComboBox combo_encode;
973+ private System.Windows.Forms.ToolStripLabel toolStripLabel1;
974+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusReadOnly;
975+ private System.Windows.Forms.ToolStripMenuItem OpenOToolStripMenuItem;
976+ private System.Windows.Forms.ToolStripMenuItem ReadOnlyToolStripMenuItem;
977+ }
978+}
979+
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetNODOKA.Designer.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSetNODOKA.Designer.cs (revision 228)
@@ -0,0 +1,140 @@
1+namespace nodokaGuiEdit
2+{
3+ partial class FormSetNODOKA
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.button1 = new System.Windows.Forms.Button();
32+ this.button2 = new System.Windows.Forms.Button();
33+ this.label1 = new System.Windows.Forms.Label();
34+ this.label2 = new System.Windows.Forms.Label();
35+ this.textBox1 = new System.Windows.Forms.TextBox();
36+ this.textBox2 = new System.Windows.Forms.TextBox();
37+ this.Getbutton = new System.Windows.Forms.Button();
38+ this.SuspendLayout();
39+ //
40+ // button1
41+ //
42+ this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
43+ this.button1.Location = new System.Drawing.Point(273, 278);
44+ this.button1.Margin = new System.Windows.Forms.Padding(4);
45+ this.button1.Name = "button1";
46+ this.button1.Size = new System.Drawing.Size(100, 29);
47+ this.button1.TabIndex = 0;
48+ this.button1.Text = "OK";
49+ this.button1.UseVisualStyleBackColor = true;
50+ //
51+ // button2
52+ //
53+ this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
54+ this.button2.Location = new System.Drawing.Point(165, 278);
55+ this.button2.Margin = new System.Windows.Forms.Padding(4);
56+ this.button2.Name = "button2";
57+ this.button2.Size = new System.Drawing.Size(100, 29);
58+ this.button2.TabIndex = 1;
59+ this.button2.Text = "キャンセル";
60+ this.button2.UseVisualStyleBackColor = true;
61+ //
62+ // label1
63+ //
64+ this.label1.AutoSize = true;
65+ this.label1.Location = new System.Drawing.Point(41, 51);
66+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
67+ this.label1.Name = "label1";
68+ this.label1.Size = new System.Drawing.Size(174, 15);
69+ this.label1.TabIndex = 2;
70+ this.label1.Text = "現在の環境変数 NODOKA";
71+ //
72+ // label2
73+ //
74+ this.label2.AutoSize = true;
75+ this.label2.Location = new System.Drawing.Point(41, 131);
76+ this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
77+ this.label2.Name = "label2";
78+ this.label2.Size = new System.Drawing.Size(189, 15);
79+ this.label2.TabIndex = 3;
80+ this.label2.Text = "変更後の環境変数 NODOKA";
81+ //
82+ // textBox1
83+ //
84+ this.textBox1.Location = new System.Drawing.Point(41, 70);
85+ this.textBox1.Margin = new System.Windows.Forms.Padding(4);
86+ this.textBox1.Name = "textBox1";
87+ this.textBox1.ReadOnly = true;
88+ this.textBox1.Size = new System.Drawing.Size(295, 22);
89+ this.textBox1.TabIndex = 4;
90+ //
91+ // textBox2
92+ //
93+ this.textBox2.Location = new System.Drawing.Point(41, 152);
94+ this.textBox2.Margin = new System.Windows.Forms.Padding(4);
95+ this.textBox2.Name = "textBox2";
96+ this.textBox2.Size = new System.Drawing.Size(295, 22);
97+ this.textBox2.TabIndex = 5;
98+ //
99+ // Getbutton
100+ //
101+ this.Getbutton.Location = new System.Drawing.Point(237, 184);
102+ this.Getbutton.Margin = new System.Windows.Forms.Padding(4);
103+ this.Getbutton.Name = "Getbutton";
104+ this.Getbutton.Size = new System.Drawing.Size(100, 29);
105+ this.Getbutton.TabIndex = 6;
106+ this.Getbutton.Text = "参照";
107+ this.Getbutton.UseVisualStyleBackColor = true;
108+ this.Getbutton.Click += new System.EventHandler(this.Getbutton_Click);
109+ //
110+ // FormSetNODOKA
111+ //
112+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
113+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
114+ this.ClientSize = new System.Drawing.Size(379, 328);
115+ this.Controls.Add(this.Getbutton);
116+ this.Controls.Add(this.textBox2);
117+ this.Controls.Add(this.textBox1);
118+ this.Controls.Add(this.label2);
119+ this.Controls.Add(this.label1);
120+ this.Controls.Add(this.button2);
121+ this.Controls.Add(this.button1);
122+ this.Margin = new System.Windows.Forms.Padding(4);
123+ this.Name = "FormSetNODOKA";
124+ this.Text = "環境変数 NODOKA";
125+ this.ResumeLayout(false);
126+ this.PerformLayout();
127+
128+ }
129+
130+ #endregion
131+
132+ private System.Windows.Forms.Button button1;
133+ private System.Windows.Forms.Button button2;
134+ private System.Windows.Forms.Label label1;
135+ private System.Windows.Forms.Label label2;
136+ private System.Windows.Forms.TextBox textBox1;
137+ private System.Windows.Forms.TextBox textBox2;
138+ private System.Windows.Forms.Button Getbutton;
139+ }
140+}
\ No newline at end of file
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSplash.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/FormSplash.cs (revision 228)
@@ -0,0 +1,103 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Drawing;
5+using System.Linq;
6+using System.Reflection;
7+using System.Windows.Forms;
8+
9+namespace nodokaGuiEdit
10+{
11+ partial class FormSplash : Form
12+ {
13+ public FormSplash()
14+ {
15+ InitializeComponent();
16+ this.Text = String.Format("{0} のバージョン情報", AssemblyTitle);
17+ this.labelProductName.Text = AssemblyProduct;
18+ this.labelVersion.Text = String.Format("バージョン {0}", AssemblyVersion);
19+ this.labelCopyright.Text = AssemblyCopyright;
20+ this.labelCompanyName.Text = AssemblyCompany;
21+ }
22+
23+ #region アセンブリ属性アクセサー
24+
25+ public string AssemblyTitle
26+ {
27+ get
28+ {
29+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
30+ if (attributes.Length > 0)
31+ {
32+ AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
33+ if (titleAttribute.Title != "")
34+ {
35+ return titleAttribute.Title;
36+ }
37+ }
38+ return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
39+ }
40+ }
41+
42+ public string AssemblyVersion
43+ {
44+ get
45+ {
46+ return Assembly.GetExecutingAssembly().GetName().Version.ToString();
47+ }
48+ }
49+
50+ public string AssemblyDescription
51+ {
52+ get
53+ {
54+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
55+ if (attributes.Length == 0)
56+ {
57+ return "";
58+ }
59+ return ((AssemblyDescriptionAttribute)attributes[0]).Description;
60+ }
61+ }
62+
63+ public string AssemblyProduct
64+ {
65+ get
66+ {
67+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
68+ if (attributes.Length == 0)
69+ {
70+ return "";
71+ }
72+ return ((AssemblyProductAttribute)attributes[0]).Product;
73+ }
74+ }
75+
76+ public string AssemblyCopyright
77+ {
78+ get
79+ {
80+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
81+ if (attributes.Length == 0)
82+ {
83+ return "";
84+ }
85+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
86+ }
87+ }
88+
89+ public string AssemblyCompany
90+ {
91+ get
92+ {
93+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
94+ if (attributes.Length == 0)
95+ {
96+ return "";
97+ }
98+ return ((AssemblyCompanyAttribute)attributes[0]).Company;
99+ }
100+ }
101+ #endregion
102+ }
103+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Program.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/Program.cs (revision 228)
@@ -0,0 +1,29 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Windows.Forms;
5+using System.Threading;
6+
7+namespace nodokaGuiEdit
8+{
9+ static class Program
10+ {
11+ /// <summary>
12+ /// アプリケーションのメイン エントリ ポイントです。
13+ /// </summary>
14+ [STAThread]
15+ static void Main()
16+ {
17+ Application.EnableVisualStyles();
18+ Application.SetCompatibleTextRenderingDefault(false);
19+
20+ FormSplash fs = new FormSplash();
21+ fs.Show();
22+ fs.Refresh();
23+ Thread.Sleep(3000);
24+ fs.Close();
25+
26+ Application.Run(new FormMain());
27+ }
28+ }
29+}
--- GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/define.cs (nonexistent)
+++ GuiEdit/branches/GuiEdit_1.03/GuiEdit/nodokaGuiEdit/define.cs (revision 228)
@@ -0,0 +1,70 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Windows.Forms;
6+
7+namespace nodokaGuiEdit
8+{
9+ public partial class commandWizard : Form
10+ {
11+ static public string[] mode_list = { "keymap", "key", "mod", "window", "include", "def option", "def key", "ohter" };
12+ static string[] mode_name = { "キーマップの設定", "キーバインドの設定", "モディファイヤの設定", "(未実装)ウィンドウの設定", "設定ファイル読み込み", "(未実装)オプション設定", "(未実装)キーの設定", "その他一般" };
13+ static string[] mods_list = { "Shift", "Ctrl", "Alt", "Win", "IME ON", "IME変換中",
14+ "Mod0", "Mod1", "Mod2", "Mod3", "Mod4", "Mod5", "Mod6", "Mod7", "Mod8", "Mod9",
15+ "Lock0", "Lock1", "Lock2", "Lock3", "Lock4", "Lock5", "Lock6", "Lock7", "Lock8", "Lock9" };
16+ static string[] mods_text = { "S-", "C-", "A-", "W-", "IL-", "IC-",
17+ "M0-", "M1-","M2-","M3-","M4-","M5-","M6-","M7-","M8-","M9-",
18+ "L0-", "L1-", "L2-", "L3-", "L4-", "L5-", "L6-", "L7-", "L8-", "L9-" };
19+ static string[] key_cat109 = { "英字", "数字", "記号", "特殊キー", "モディファイヤ", "IME関連", "Fn", "カーソル", "テンキ―" };
20+ static string[] key_cat104 = { "英字", "数字", "記号", "特殊キー", "モディファイヤ", "Fn", "カーソル", "テンキ―" };
21+ static string[][] key_109 = {
22+ new[] { "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "J ", "K ", "L ", "M ", "N ", "O ", "P ", "Q ", "R ", "S ", "T ", "U ", "V ", "W ", "X ", "Y ", "Z " },
23+ new[] { "_0 ", "_1 ", "_2 ", "_3 ", "_4 ", "_5 ", "_6 ", "_7 ", "_8 ", "_9 " },
24+ new[] { "Minus -", "Caret ^", "Yen \\", "Atmark @", "OpenBracket [", "CloseBracket ]", "Semicolon ;", "Colon :",
25+ "Space ", "Comma ,", "Period .", "Slash /", "BackSlash \" },
26+ new[] { "Esc ", "Tab ", "Enter ", "Insert ", "Del ", "BackSpace ", "Home ", "End ", "PageUp ", "PageDown ", "Apps ", "PrintScreen ", "Scroll ", "Pause ", "SysRq ", "NumLock ", "Break " },
27+ new[] { "LShift ", "RShift ", "LCtrl ", "RCtrl ", "LAlt ", "RAlt ", "LWin ", "RWin " },
28+ new[] { "半角/全角 ", "英数 ", "無変換 ", "変換 ", "ひらがな " },
29+ new[] { "F1 ", "F2 ", "F3 ", "F4 ", "F5 ", "F6 ", "F7 ", "F8 ", "F9 ", "F10 ", "F11 ", "F12 " },
30+ new[] { "Up ↑", "Left ←", "Right →", "Down ↓"},
31+ new[] { "Num0 ", "Num1 ", "Num2 ", "Num3 ", "Num4 ", "Num5 ", "Num6 ", "Num7 ", "Num8 ", "Num9 ", "NumMinus -", "NumPlus +", "NumAsterisk *", "NumPeriod .", "NumSlash /", "NumEnter " },
32+ };
33+ static string[][] key_104 = {
34+ new[] { "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "J ", "K ", "L ", "M ", "N ", "O ", "P ", "Q ", "R ", "S ", "T ", "U ", "V ", "W ", "X ", "Y ", "Z " },
35+ new[] { "_0 ", "_1 ", "_2 ", "_3 ", "_4 ", "_5 ", "_6 ", "_7 ", "_8 ", "_9 "},
36+ new[] { "Minus -", "Equal =", "OpenBracket [", "CloseBracket ]", "Colon :", "Quote '", "Backquote `",
37+ "Space ", "Comma ,", "Period .", "Slash /", "BackSlash \", },
38+ new[] { "Esc ", "Tab ", "Enter ", "Caps ", "Insert ", "Del ", "BackSpace ", "Home ", "End ", "PageUp ", "PageDown ", "Apps ", "PrintScreen ", "Scroll ", "Pause ", "SysRq ", "NumLock ", "Break " },
39+ new[] { "LShift ", "RShift ", "LCtrl ", "RCtrl ", "LAlt ", "RAlt ", "LWin ", "RWin " },
40+ new[] { "F1 ", "F2 ", "F3 ", "F4 ", "F5 ", "F6 ", "F7 ", "F8 ", "F9 ", "F10 ", "F11 ", "F12 " },
41+ new[] { "Up ↑", "Left ←", "Right →", "Down ↓"},
42+ new[] { "Num0 ", "Num1 ", "Num2 ", "Num3 ", "Num4 ", "Num5 ", "Num6 ", "Num7 ", "Num8 ", "Num9 ", "NumMinus -", "NumPlus +", "NumAsterisk *", "NumPeriod .", "NumSlash /", "NumEnter " },
43+ };
44+ static string[] modifier = { "shift", "control", "alt", "windows", "mod0", "mod1", "mod2", "mod3", "mod4", "mod5", "mod6", "mod7", "mod8", "mod9" };
45+ static string[] modifier_mode_name = { "追加 +", "削除 -", "設定" };
46+ static string[] modifier_mode = { "+", "-", "" };
47+ static string[] modifier_cat_name = { "真 !", "OneShot !!", "OneShot R !!!", "無し" };
48+ static string[] modifier_cat = { "!", "!!", "!!!", "" };
49+ static string[] keymapGlobal = { "Global" };
50+ static string[] includeFileList = { "109.nodoka", "104.nodoka", "104on109.nodoka", "109on104.nodoka", "default.nodoka", "default2.nodoka", "emacsedit.nodoka" };
51+
52+ public class Global_Val
53+ {
54+ // グローバル変数の宣言
55+ static public string caption;
56+ static public string leftString;
57+ static public string rightString;
58+ static public int commandNumber;
59+ static public bool firstView;
60+ static public bool reWizardFirst;
61+ static public string aster; // *
62+ static public string left_mod; // modifier
63+ static public string left_key; // key
64+ static public string right_mod; // modifier
65+ static public string right_key; // key
66+ static public bool status; // DialogResult.OKの代わり
67+ }
68+
69+ }
70+}
Show on old repository browser