Commit e85a68d1 authored by tsuji's avatar tsuji

Update GetADocGUI.exe

parent f189bc32
......@@ -22,6 +22,12 @@
<setting name="checkbox3Setting" serializeAs="String">
<value>False</value>
</setting>
<setting name="savePathSetting" serializeAs="String">
<value />
</setting>
<setting name="argPathSetting" serializeAs="String">
<value />
</setting>
</GetADoc.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
......@@ -36,5 +36,8 @@
<CheckBox x:Name="SepaDocCheckbox" Content="分割ドキュメント" Grid.Row="3" Margin="4.333,9.667,8.667,-16.333" Panel.ZIndex="2" Grid.Column="2" Height="66" VerticalAlignment="Top" GotFocus="DeleteCompLabel"/>
<TextBox x:Name="allBox" TextWrapping="Wrap" Grid.ColumnSpan="4" Grid.RowSpan="4" Opacity="0" Cursor="Arrow" Margin="0,0,0.333,-0.333"/>
<Label x:Name="CompletedLabel" Content="作成が完了しました!" Grid.Column="2" HorizontalAlignment="Left" Margin="51.333,32,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="139" Visibility="Hidden" FontWeight="Bold" Foreground="#FFD70B0B"/>
<CheckBox x:Name="MyPathCheckbox" Content="保存Path" Margin="5,46,33,0" Panel.ZIndex="2" Height="17" VerticalAlignment="Top" GotFocus="DeleteCompLabel" Grid.Column="1" Click="MyPathClick"/>
<Label x:Name="SavePathLabel" Content="Pathが未登録です&#xD;&#xA;これから出力するPathを登録します" HorizontalAlignment="Left" Margin="83,28,0,0" VerticalAlignment="Top" Width="185" Visibility="Hidden" FontWeight="Bold" Foreground="#FFD70B0B" Grid.Column="1" Grid.ColumnSpan="3"/>
<Label x:Name="SavedLabel" Content="保存Pathを更新しました" HorizontalAlignment="Left" Margin="83,40,0,0" VerticalAlignment="Top" Width="185" Visibility="Hidden" FontWeight="Bold" Foreground="#FFD70B0B" Grid.Column="1" Grid.ColumnSpan="3"/>
</Grid>
</Window>
......@@ -30,17 +30,53 @@ namespace GetADoc
InitializeComponent();
//デフォルトに前回の設定を表示
FolderPathBox.Text = Properties.Settings.Default.box1Setting;
ScreenCheckbox.IsChecked = Properties.Settings.Default.checkbox1Setting;
IconCheckbox.IsChecked = Properties.Settings.Default.checkbox2Setting;
SepaDocCheckbox.IsChecked = Properties.Settings.Default.checkbox3Setting;
//Pathの初期設定(引数指定で起動していれば引数のpath、指定していなければ前回の値)
string[] argPathBox = Environment.GetCommandLineArgs();
if (argPathBox.Length == 2)
{
FolderPathBox.Text = argPathBox[1];//第一引数を入力
}
else
{
FolderPathBox.Text = Properties.Settings.Default.box1Setting;//前回の値を入力
}
//保存PathはデフォルトOFF
MyPathCheckbox.IsChecked = false;
//ドラッグ&ドロップイベントの追加
allBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
allBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
FolderPathBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
FolderPathBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
}
//保存Pathのチェックボックスをクリックする(ONにする)と登録したPahtをTextBoxに表示
private void MyPathClick(object sender, RoutedEventArgs e)
{
//ONにしたとき
if(MyPathCheckbox.IsChecked == true)
{
FolderPathBox.Text = Properties.Settings.Default.savePathSetting;
if (FolderPathBox.Text == "")
{
SavePathLabel.Visibility = Visibility.Visible;
}
}
//OFFにしたとき
if (MyPathCheckbox.IsChecked == false)
{
SavePathLabel.Visibility = Visibility.Hidden;
FolderPathBox.Text = Properties.Settings.Default.box1Setting;
}
}
//フォルダ指定のためにファイルをドラッグ
private void textBox_PreviewDragOver(object sender, System.Windows.DragEventArgs e)
......@@ -143,7 +179,7 @@ namespace GetADoc
|| Directory.Exists(System.IO.Path.Combine(filePath, "Sub_First")) || Directory.Exists(System.IO.Path.Combine(filePath, "Sub_Second")))
{
MessageBoxResult OverwriteADoc = CustomMsgBox.Show(mainWindow, "これから生成するファイルと同名のファイルが既に存在します" +
"\n既存のファイルを上書きしますか?",
"\n既存のファイルを上書きしますか?" + "\n(Imageフォルダ内のファイルは維持されます)",
"指定したフォルダに既存のファイルが存在します",
MessageBoxButton.YesNo, MessageBoxImage.None);
if (OverwriteADoc == MessageBoxResult.Yes)
......@@ -160,7 +196,12 @@ namespace GetADoc
//バッチファイルの実行
RunBatch.runBatch(IconFlag, SCREENFlag, SepaFlag, fileName, filePath);
//保存Pathのラベルが表示されていれば、表示を隠す
if (SavePathLabel.Visibility == Visibility.Visible)
{
SavePathLabel.Visibility = Visibility.Hidden;
}
//処理の完了を知らせるラベルを表示
CompletedLabel.Visibility = Visibility.Visible;
......@@ -169,6 +210,15 @@ namespace GetADoc
Properties.Settings.Default.checkbox1Setting = ((bool)ScreenCheckbox.IsChecked);
Properties.Settings.Default.checkbox2Setting = ((bool)IconCheckbox.IsChecked);
Properties.Settings.Default.checkbox3Setting = ((bool)SepaDocCheckbox.IsChecked);
//保存PahtがTrueなら、そのときTextBoxに記載されているPathを保存
if (MyPathCheckbox.IsChecked == true)
{
Properties.Settings.Default.savePathSetting = FolderPathBox.Text;
SavedLabel.Visibility = Visibility.Visible;
}
Properties.Settings.Default.Save();
}
......@@ -176,6 +226,7 @@ namespace GetADoc
private void DeleteCompLabel(object sender, RoutedEventArgs e)
{
CompletedLabel.Visibility = Visibility.Hidden;
SavedLabel.Visibility = Visibility.Hidden;
}
}
}
......
......@@ -51,5 +51,5 @@ using System.Windows;
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
......@@ -70,5 +70,29 @@ namespace GetADoc.Properties {
this["checkbox3Setting"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string savePathSetting {
get {
return ((string)(this["savePathSetting"]));
}
set {
this["savePathSetting"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string argPathSetting {
get {
return ((string)(this["argPathSetting"]));
}
set {
this["argPathSetting"] = value;
}
}
}
}
......@@ -14,5 +14,11 @@
<Setting Name="checkbox3Setting" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="savePathSetting" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="argPathSetting" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
No preview for this file type
......@@ -22,6 +22,12 @@
<setting name="checkbox3Setting" serializeAs="String">
<value>False</value>
</setting>
<setting name="savePathSetting" serializeAs="String">
<value />
</setting>
<setting name="argPathSetting" serializeAs="String">
<value />
</setting>
</GetADoc.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment