#=============================================== # TkCSVView #=============================================== package TkCSVView; use TkPlotModule; @ISA = qw(TkPlotModule); #公開したいサブルーチン #@EXPORT = qw(DelSpace Reduce01 MakePath RegExpQuote); use strict; use Tk::JPEG; use Utils; use CSV; use Tk; use Tk::Balloon; use MyTk::Dialog; use MyTk::MyFrame; use MyTk::MyLabFrame; use MyTk::MyLabel; use MyTk::MyEntry; use MyTk::MyListbox; use MyTk::MyBrowseEntry; use MyTk::MyText; use MyTk::MyButton; use MyTk::MyMenubutton; use MyTk::MyCanvas; use MyTk::GraphFrameArray; use GraphData; use Sci::Science; use Sci::Material; my $pi = Sci::pi(); my $kB = Sci::kB(); my $c = Sci::c(); my $e = Sci::e(); my $e0 = Sci::e0(); my $me = Sci::me(); my $mp = Sci::mp(); my $mn = Sci::mn(); my $h = Sci::h(); my $hbar = Sci::hbar(); my $material = new Material; #============================================================ # 変数等取得関数 #============================================================ sub FileType { return shift->{FileType}; } sub SetFileType { my ($this,$t)=@_; return $this->{FileType} = $t; } sub FileName { return shift->{FileName}; } sub SetFileName { my ($this,$f)=@_; return $this->{FileName} = $f; } sub SetDataArray { my ($this, $da)=@_; return $this->{DataArray} = $da; } sub DataArray { return shift->{DataArray}; } sub GetColor { return shift->{Color}; } sub ColorMapImage { return shift->{ColorMapImage}; } sub SetColorMapImage { my ($this,$m)=@_; return shift->{ColorMapImage} = $m; } #============================================================ # コンストラクタ、デストラクタ #============================================================ sub new { my ($module, $app) = @_; # my ($module, $app, $canvas) = @_; my $this = {}; bless $this; $this->SetApplication($app); # $this->SetCanvas($canvas); return $this; } sub DESTROY { my $this = shift; #print "App: ", $this->App()->{PrevFile}, "\n"; # $this->App()->{PrevFile} = $this->{CSVFileEntry}->GetText(); # $App->SaveSetting(); $this->SUPER::DESTROY(@_); } #============================================================ # 継承クラスで定義しなおす関数 #============================================================ sub CreateLeftFrame { my ($this, $ConfigSide, @args) = @_; # return $this->SUPER::CreateLeftFrame(); return undef; } sub CreateSelectFilePane { my ($this) = @_; # return $this->SUPER::CreateSelectFilePane(); return undef; } sub CreateFileContentPane { return undef; } sub CreateWidgets { my ($this) = @_; my $App = $this->App(); my $args = $App->Args(); my $mw = $this->mw(); $this->SUPER::CreateWidgets(); #=================================================== # Iniファイル読み込み #=================================================== my $Style = $this->App()->Args()->GetGetArg("style"); $this->App()->AddIniFileVariable("\\$Style\\Interval", "Interval", 3); $this->App()->AddIniFileVariable("\\$Style\\PrevFile", "PrevFile", ""); $this->App()->ReadSetting(); my $path = $this->App()->Args()->GetGetArg(0); $App->{PrevFile} = $path if(defined $path); #=================================================== # TFTペインを作製 #=================================================== my $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{CSVFileEntry} = &MakeChooseFileEntry($this, $Frame, 'CSV', 'CSV:', '&Choose', \$App->{PrevFile}, \&ChooseFile); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{ChooseXListBox} = $Frame->MyBrowseEntry( -label => "X:", -state => "readonly", -takefocus => 1, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseXListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "X", $this->{ChooseXListBox}]); $this->{ChooseY1ListBox} = $Frame->MyBrowseEntry( -label => "Y1:", -state => "readonly", -takefocus => 1, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseY2ListBox} = $Frame->MyBrowseEntry( -label => "Y2:", -state => "readonly", -takefocus => 1, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{ChooseY3ListBox} = $Frame->MyBrowseEntry( -label => "Y3:", -state => "readonly", -takefocus => 1, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseY4ListBox} = $Frame->MyBrowseEntry( -label => "Y4:", -state => "readonly", -takefocus => 1, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseY1ListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "Y1", $this->{ChooseY1ListBox}]); $this->{ChooseY2ListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "Y2", $this->{ChooseY2ListBox}]); $this->{ChooseY3ListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "Y3", $this->{ChooseY3ListBox}]); $this->{ChooseY4ListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "Y4", $this->{ChooseY4ListBox}]); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{ChooseXScaleListBox} = $Frame->MyBrowseEntry( -label => "X scale:", -state => "readonly", -takefocus => 1, -Selections => ["x", "-x", "log(x)", "log(|x|)", "ln(x)", "ln(|x|)", "1/x"], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseYScaleListBox} = $Frame->MyBrowseEntry( -label => "Y scale:", -state => "readonly", -takefocus => 1, -Selections => ["x", "-x", "log(x)", "log(|x|)", "ln(x)", "ln(|x|)", "1/x"], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseXScaleListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "XScale", $this->{ChooseXScaleListBox}]); $this->{ChooseYScaleListBox}->configure(-browsecmd => [\&SelChangeListBox, $this, "YScale", $this->{ChooseYScaleListBox}]); # $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); my $ent = $this->MakeLabelEntry($Frame, "Interval", "Interval:", \$this->App()->{Interval}, "%d", 10, "s", 0, 0, 'normal'); $Frame->bind($ent, '', [\&EntryFocusedOut, $this, 'FocusOut', "Interval"]); $this->{UpdateButton} = $Frame->MyButton( -text => "Update", -takefocus => 1, -command => [\&ButtonPressed, $this, 'RButtonDown', 'Update'], )->pack(-side => 'left'); #ツールバーのOpenボタンをファイル読み込みにバインドする $mw->{OpenButton}->configure( -command => [ \&ChooseFile, $this, "CSV", $this->{CSVFileEntry} ], ) if($mw->{OpenButton}); #Replotボタンを再バインドする # $mw->{ReplotButton}->configure( # -command => [ \&Draw, $this ], # ) if($mw->{ReplotButton}); #Refleshボタンを再バインドする # $mw->{RefleshButton}->configure( # -command => sub { $this->Draw(); }, #mw()->RefleshCanvas(1); }, # ) if($mw->{RefleshButton}); $mw->bind($Frame, '', [\&BindFunc, $this, "Visibility"]); $mw->bind($Frame, '', [\&BindFunc, $this, "Expose"]); #$mw->bind('all', '', [\&BindFunc, $this, "Map"]); #$mw->bind($this->{UpdateButton}, '', [\&BindFunc, $this, "Configure"]); #$mw->bind($this->{UpdateButton}, '', [\&BindFunc, $this, "Gravity"]); #$mw->bind('all', '', [\&CheckLogin, Ev('K'), 0]); #$mw->bind($ent, '', [\&CheckLogin, 'Enter', 1]); #$mw->bind($ent, '', [\&CheckLogin, 'Leave', 1]); #$mw->bind($ent, '', [\&CheckLogin, 'Property', 1]); #$mw->bind($ent, '', [\&CheckLogin, 'FocusIn', 1]); #$mw->bind($ent, '', [\&CheckLogin, 'FocusOut', 1]); # my $geo = $mw->App()->IniFile()->GetString("Window", "geometry", ''); # my ($h) = ($geo =~ /x(\d+)/); # $h -= 20; # $geo =~ s/x(\d+)/x$h/; # $mw->SetGeometry($geo); #print "this-$this, mw=$mw\n"; # $mw->bind('' => sub { # $mw->Canvas()->bind('' => sub { # my $Now = time(); # return if(defined $this->{PrevTime} and $Now - $this->{PrevTime} < 10); # $this->{PrevTime} = time(); # $mw->App()->IniFile()->WriteString("Window", "geometry", $mw->geometry()); # $mw->App()->SaveSetting(); # } ); } sub CreateWindow { my ($this, $mw) = @_; my $App = $this->App(); my $ret = $App->CreateWindow($mw); # 引数の処理 my $filepath = $this->GetGetArg(0); if($filepath) { my $ret = $this->ReadFile($filepath); if(!$ret) { $this->App()->print("Error: Can not read [$filepath].\n"); # $this->{CSVFileEntry}->SetText(''); $this->{CSVFileEntry}->SetText($filepath); } else { $this->{CSVFileEntry}->SetText($filepath); # $this->Draw(); $this->mw()->after(1, sub { $this->Draw(); }); } } # $App->FreeWin32Console(); } sub CheckArguments { my ($this) = @_; # my $filepath = $this->GetGetArg(0); } sub BindFunc { my ($widget, $this, $event) = @_; #print "w=$widget, this=$this, $event\n"; if($event eq 'Visibility') { #起動後、初めてウィジェットが表示されたとき } elsif($event eq 'Expose') { $this->IntervalFunc(1, 1); } } sub ButtonPressed { my ($this, $event, $type) = @_; #print "$event $type\n"; if($type eq 'Update') { $this->IntervalFunc(1, 0); my $curpath = $this->{CSVFileEntry}->GetTitle(); my $writedate = Utils::GetWriteDate($curpath); #print "path: [$curpath:$writedate]\n"; $this->{FileWriteDate} = $writedate; my $ret = $this->ReadFile($curpath, 0); return undef unless($ret); $this->Draw(); #print "Draw\n"; } } sub EntryFocusedOut { my ($obj, $this, $event, $type) = @_; #print "obj=$obj, this=$this, $event, $type\n"; if($event eq 'FocusOut') { if($type eq 'Interval') { $this->IntervalFunc(1, 1); } } for(my $i = 0 ; $i < @{$this->{pEntryArray}} ; $i++) { $this->{pEntryArray}->[$i]->Update(); } } sub SelChangeListBox { my ($this, $type, $lb) = @_; #print "this=$this, type=$type, lb=$lb\n"; # my $s = $lb->GetText(); $this->AssignGraphData(); # $this->IntervalFunc(1, 1); } sub MakeLabelEntry { my ($this, $Frame, $name, $label1, $pVariable, $format, $EntryWidth, $label2, $row, $column, $state) = @_; $state = 'normal' if(!defined $state); #print "Frame=$Frame name=$name,$label1,$format,$label2\n"; $$pVariable = Utils::DelSpace(sprintf($format, $$pVariable)); # $Frame->MyLabel(-text => $label1)->grid(-row => $row, -column => 3*$column+0, -columnspan => 1, -sticky => 'e' ); $Frame->MyLabel(-text => $label1)->pack(-side => 'left'); my $ent = $Frame->MyEntry( -name => $name, -width => $EntryWidth, # -text => $val, -textvariable => $pVariable, -state => $state, -format => $format, # )->grid(-row => $row, -column => 3*$column+1, -columnspan => 1, -sticky => 'e' ); )->pack(-side => 'left'); # $Frame->MyLabel(-text => $label2)->grid(-row => $row, -column => 3*$column+2, -columnspan => 1, -sticky => 'w' ); $Frame->MyLabel(-text => $label2)->pack(-side => 'left'); # $ent->bind('', [\&EntryFocusedOut, $this, 'FocusOut', $name]); $this->{pEntryArray} = [] if(!$this->{pEntryArray}); push(@{$this->{pEntryArray}}, $ent); return $this->{"${name}Entry"} = $ent; } sub MakeChooseFileEntry { my ($this, $Frame, $name, $Label, $ButtonLabel, $pVariable, $pFunction) = @_; #print "p=$pVariable: $$pVariable\n"; $Frame->MyLabel(-text => $Label)->pack(-side => 'left'); $this->{"${name}FileEntry"} = $Frame->MyEntry( -takefocus => 1, -textvariable => $pVariable )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); #print "e[${name}FileEntry]: ", $this->{"${name}FileEntry"}, "\n"; $this->{"${name}FileEntry"}->focus(); $this->{"${name}FilePathButton"} = $Frame->MyButton( -text => $ButtonLabel, -takefocus => 1, -command => [$pFunction, $this, $name, $this->{"${name}FileEntry"}], )->pack(-side => 'left'); #print "e=${name}FileEntry\n"; return $this->{"${name}FileEntry"}; } #=================================================== # データ処理 #=================================================== sub ChooseFile { my ($this, $type, $widget) = @_; #print "this=$this, type=$type, widget=$widget\n"; my $App = $this->App(); my $canvas = $this->Canvas(); my $mw = $this->mw(); my $dir = ''; unless($widget) { $dir = $this->App()->{'WorkDir'}; chdir($dir); } my $fmask = '*.csv'; my $defstr = ''; my $message = 'Choose a CSV file'; my $filepath = Dialog::OpenFileDialog($mw, 'open', $fmask, $defstr, $message, $dir); if($filepath) { my $DirPath = $this->SetWorkDir($filepath); if($widget) { $widget->SetText($filepath); } } my $ret = $this->ReadFile($filepath); return undef unless($ret); $this->Draw(); $this->IntervalFunc(1, 0); return $ret; } sub ReadFile { my ($this, $filepath, $UpdateAll) = @_; $UpdateAll = 1 if(!defined $UpdateAll); my $App = $this->App(); #print "type=$type\n"; $this->{FilePath} = $filepath; my ($nData, $pLabelArray, @pDataArray) = CSV::GetArraysFromFile($filepath, 0); if(!defined $nData) { # $App->print("Error: Can not read [$filepath].\n"); return $this->{FilePath} = undef; } $this->{pLabelArray} = $pLabelArray; $this->{ppDataArray} = \@pDataArray; $this->{nDataArray} = @$pLabelArray; $this->{FileWriteDate} = Utils::GetWriteDate($filepath); print "WriteDate: $this->{FileWriteDate}\n"; my $idxXsel = -1; my $idxY1sel = -1; my $idxY2sel = -1; my $idxY3sel = -1; my $idxY4sel = -1; $idxXsel = $this->{ChooseXListBox}->GetCurSel(); $this->{ChooseXListBox}->DeleteAllItem(); $idxY1sel = $this->{ChooseY1ListBox}->GetCurSel(); $this->{ChooseY1ListBox}->DeleteAllItem(); $idxY2sel = $this->{ChooseY1ListBox}->GetCurSel(); $this->{ChooseY2ListBox}->DeleteAllItem(); $idxY3sel = $this->{ChooseY1ListBox}->GetCurSel(); $this->{ChooseY3ListBox}->DeleteAllItem(); $idxY4sel = $this->{ChooseY1ListBox}->GetCurSel(); $this->{ChooseY4ListBox}->DeleteAllItem(); if($UpdateAll) { $idxXsel = 0 if($idxXsel < 0); $idxY1sel = 1 if($idxY1sel < 0); $idxY2sel = 2 if($idxY2sel < 0); $idxY3sel = 3 if($idxY3sel < 0); $idxY4sel = 4 if($idxY4sel < 0); } for(my $i = 0 ; $i < @$pLabelArray ; $i++) { $this->{ChooseXListBox}->AddItem($pLabelArray->[$i]); $this->{ChooseY1ListBox}->AddItem($pLabelArray->[$i]); $this->{ChooseY2ListBox}->AddItem($pLabelArray->[$i]); $this->{ChooseY3ListBox}->AddItem($pLabelArray->[$i]); $this->{ChooseY4ListBox}->AddItem($pLabelArray->[$i]); } $this->{ChooseY2ListBox}->AddItem("None"); $this->{ChooseY3ListBox}->AddItem("None"); $this->{ChooseY4ListBox}->AddItem("None"); $this->{ChooseXListBox}->SetCurSel($idxXsel); $this->{ChooseY1ListBox}->SetCurSel($idxY1sel); $this->{ChooseY2ListBox}->SetCurSel("None"); #$idxY2sel); $this->{ChooseY3ListBox}->SetCurSel("None"); #$idxY3sel); $this->{ChooseY4ListBox}->SetCurSel("None"); #$idxY4sel); $this->CreateGraphFrame(); $this->AssignGraphData(); $this->App()->SaveSetting(); return $filepath; } sub IntervalFunc { my ($this, $UpdateTimer, $UpdateDraw) = @_; $this->mw()->update(); $UpdateTimer = 1 if(!defined $UpdateTimer); $UpdateDraw = 1 if(!defined $UpdateDraw); #print "After [$this->App()->{Interval} s].\n"; if($UpdateTimer) { $this->{TimerId}->cancel() if($this->{TimerId}); if($this->App()->{Interval} > 0) { $this->{TimerId} = $this->mw()->after($this->App()->{Interval}*1000, sub { &IntervalFunc($this); }); } } if($UpdateDraw and $this->App()->{Interval} > 0) { my $prevpath = $this->{FilePath}; $prevpath = '' if(!$prevpath); my $curpath = $this->{CSVFileEntry}->GetTitle(); my $writedate = Utils::GetWriteDate($curpath); #print "path: [$prevpath:$this->{FileWriteDate}] [$curpath:$writedate]\n"; if($curpath) { if(uc $prevpath ne uc $curpath) { $this->{FileWriteDate} = $writedate; my $ret = $this->ReadFile($curpath); return undef unless($ret); $this->Draw(); } elsif($this->{FileWriteDate} < $writedate) { $this->{FileWriteDate} = $writedate; my $ret = $this->ReadFile($curpath, 0); return undef unless($ret); $this->Draw(); } } } $this->mw()->update(); } sub CreateGraphFrame { my ($this, $canvas, $TargetData) = @_; $canvas = $this->Canvas(); my $App = $this->App(); my $font = $App->{'GraphFrameFont'}; my @font = split(/,/, $font) if($font); my $w = $canvas->width(); my $h = $canvas->height(); my $GraphFrameArray = $this->{'GraphFrameArray'} = new GraphFrameArray($this->mw()); $GraphFrameArray->SetCanvasSize($w, $h); $GraphFrameArray->AddGraphFrame(); my $GraphFrame0 = $GraphFrameArray->GetGraphFrame(0); my $FramePosStr0 = $App->{"GraphFrame0Position"}; my $XScale0 = $GraphFrame0->GetXScale(0); my $YScale0 = $GraphFrame0->GetYScale(0); $GraphFrame0->SetPositionByStr($FramePosStr0); my $XTitle = $this->{ChooseXListBox}->GetTitle(); my $YTitle = $this->{ChooseY1ListBox}->GetTitle(); $GraphFrame0->SetXCaption($XTitle); $GraphFrame0->SetYCaption($YTitle); $XScale0->SetScaleStringVisible(1); $XScale0->SetCaptionVisible(1); $GraphFrame0->SetViewRange(0, 0, 1, 1); } sub AssignGraphData { my ($this, $ResetViewRange) = @_; $ResetViewRange = 1 if(!defined $ResetViewRange); my $GraphFrameArray = $this->GetGraphFrameArray(); my $GraphFrame0 = $GraphFrameArray->GetGraphFrame(0); $GraphFrame0->ClearAllData(); my $pLabelArray = $this->{pLabelArray}; my $ppDataArray = $this->{ppDataArray}; my $idxXsel = $this->{ChooseXListBox}->GetCurSel(); my $idxY1sel = $this->{ChooseY1ListBox}->GetCurSel(); my $idxY2sel = $this->{ChooseY2ListBox}->GetCurSel(); my $idxY3sel = $this->{ChooseY3ListBox}->GetCurSel(); my $idxY4sel = $this->{ChooseY4ListBox}->GetCurSel(); #print "id=$idxXsel,$idxY1sel,$idxY2sel,$idxY3sel,$idxY4sel\n"; #print "LB=", $this->{ChooseXListBox}, ", ", $this->{ChooseYListBox}, "\n"; #print "idx=$idxXsel, $idxYsel\n"; return if($idxXsel < 0 or $idxY1sel < 0); my $pX = $ppDataArray->[$idxXsel]; my ($pY1, $pY2, $pY3, $pY4); $pY1 = $ppDataArray->[$idxY1sel] if($idxY1sel >= 0 and $idxY1sel < $this->{nDataArray}); $pY2 = $ppDataArray->[$idxY2sel] if($idxY2sel >= 0 and $idxY2sel < $this->{nDataArray}); $pY3 = $ppDataArray->[$idxY3sel] if($idxY3sel >= 0 and $idxY3sel < $this->{nDataArray}); $pY4 = $ppDataArray->[$idxY4sel] if($idxY4sel >= 0 and $idxY4sel < $this->{nDataArray}); return if(!$pX or !$pY1); my $nData = @$pX; my $XTitle = $this->{ChooseXListBox}->GetTitle(); my $Y1Title = $this->{ChooseY1ListBox}->GetTitle(); my $Y2Title = $this->{ChooseY2ListBox}->GetTitle(); my $Y3Title = $this->{ChooseY3ListBox}->GetTitle(); my $Y4Title = $this->{ChooseY4ListBox}->GetTitle(); my $nData0 = $GraphFrame0->AddGraphData($pX, $pY1, 1, "black", "", 6, "red", 0, "red", "XAutoSkip", $XTitle, $Y1Title) if($pY1 and $Y1Title ne 'None'); $GraphFrame0->AddGraphData($pX, $pY2, 1, "red", "", 6, "red", 0, "red", "XAutoSkip", $XTitle, $Y2Title) if($pY2 and $Y2Title ne 'None'); $GraphFrame0->AddGraphData($pX, $pY3, 1, "blue", "", 6, "red", 0, "red", "XAutoSkip", $XTitle, $Y3Title) if($pY3 and $Y3Title ne 'None'); $GraphFrame0->AddGraphData($pX, $pY4, 1, "cyan", "", 6, "red", 0, "red", "XAutoSkip", $XTitle, $Y4Title) if($pY4 and $Y4Title ne 'None'); $GraphFrame0->SetYScalePlotType('x'); if($ResetViewRange) { $GraphFrame0->CalMinMax(); $GraphFrame0->AdjustViewRange(0.05, 0.05, 0.05, 0.05); } } sub Draw { my ($this, $canvas, $TargetData) = @_; my $mw = $this->mw(); $canvas = $this->Canvas() if(!$canvas); # my $FileType = $this->FileType(); my $App = $this->App(); my $font = $App->{'GraphFrameFont'}; my @font = split(/,/, $font) if($font); my $GraphFrameArray = $this->GetGraphFrameArray(); return unless($GraphFrameArray); $canvas->ClearAll(); $mw->RefleshCanvas(); if($font) { $canvas->SetFont(\@font); $GraphFrameArray->SetFont(\@font); } my $w = $canvas->width(); my $h = $canvas->height(); $GraphFrameArray->SetCanvasSize($w, $h); $this->mw()->WriteStatusBar("Drawing CSV File..."); $mw->Balloon()->detach($canvas); my $XScale = $this->{ChooseXScaleListBox}->GetText(); my $YScale = $this->{ChooseYScaleListBox}->GetText(); my $GraphFrame = $GraphFrameArray->GetGraphFrame(0); if($GraphFrame) { #print "X: $XScale, $YScale\n"; $GraphFrame->SetScalePlotType("X", $XScale) if(defined $XScale); $GraphFrame->SetScalePlotType("Y", $YScale) if(defined $YScale); } $GraphFrameArray->Draw($canvas); $this->mw()->WriteStatusBar("Finish Drawing CSV File."); } # Iniファイルの設定、読み込み sub ConfigureIniFileVariables { my ($this) = @_; my $App = $this->App(); my $Args = $App->Args(); my $Style = $Args->GetGetArg("style"); $Style = "General" unless($Style); $App->ConfigureIniFileVariables(); $App->AddIniFileVariable("\\$Style\\PrevFile", "PrevFile", ""); # 必要に応じてIniFileの設定を変え、読み込む # 以前の読み込みの後で変数が変更されている可能性がある場合は、 # SaveSetting()を呼び出す # $App->SaveSetting(); # $App->AddIniFileVariable("\\$Style\\WorkDir", "WorkDir"); # $App->ConfigureIniFileVariables(); # $App->ReadSetting(); } 1;