#=============================================== # TkFittingCommon2 #=============================================== package TkFittingCommon2; use TkFittingCommon; @ISA = qw(TkFittingCommon); #use TkPlotModule; #@ISA = qw(TkPlotModule); #公開したいサブルーチン #@EXPORT = qw(DelSpace Reduce01 MakePath RegExpQuote); use strict; #============================================================ # 変数等取得関数 #============================================================ #============================================================ # コンストラクタ、デストラクタ #============================================================ #呼び出されることはない sub new { my ($class, $App, @a) = @_; my $self = TkFittingCommon->new($App, @a); my $this = bless $self, $class; return $this; } sub DESTROY { my $this = shift; $this->SUPER::DESTROY(@_); } #============================================================ # 継承クラスで定義しなおす関数 #============================================================ sub MakeNumbersListBoxes { my ($this, $MainFrame, $EntryWidth, $piFilmLayer, $piLorentz, $piDrude, $piStepBG, $piGaussLorentz, $pIsBuildPaneArray, $pIsBuildNumberBrowseEntry) = @_; my $ChildFrame = $MainFrame->MyFrame(); for(my $j = 0 ; $j < @$pIsBuildNumberBrowseEntry ; $j++) { if($pIsBuildNumberBrowseEntry->[$j] eq 'nFilmLayer') { $ChildFrame->{NFilmLayerListBox} = $MainFrame->{NFilmLayerListBox} = $ChildFrame->MyBrowseEntry( -label => "Film Layers:", -state => "readonly", -takefocus => 1, -width => 2, -Selections => [qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)], -SelIndex => $$piFilmLayer, )->pack(-side => 'left'); $ChildFrame->{NFilmLayerListBox}->configure( -browsecmd => sub { $$piFilmLayer = $ChildFrame->{NFilmLayerListBox}->GetText(); # + 0; $this->RefreshMainPane($EntryWidth, @_); $this->RefreshLayersPane($EntryWidth, @_); $this->RefreshMiscParamConditionPane($EntryWidth, @_); } ); } elsif($pIsBuildNumberBrowseEntry->[$j] eq 'nLorentz') { $ChildFrame->{NLorentzListBox} = $MainFrame->{NLorentzListBox} = $ChildFrame->MyBrowseEntry( -label => "Lorentz functions:", -state => "readonly", -takefocus => 1, -width => 2, -Selections => [qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)], -SelIndex => $$piLorentz, )->pack(-side => 'left'); $ChildFrame->{NLorentzListBox}->configure( -browsecmd => sub { $$piLorentz = $ChildFrame->{NLorentzListBox}->GetText(); # + 0; $this->RefreshMainPane($EntryWidth, @_); $this->RefreshLorentzParamConditionPane($EntryWidth, @_); } ); } elsif($pIsBuildNumberBrowseEntry->[$j] eq 'nDrude') { $ChildFrame->{NDrudeListBox} = $MainFrame->{NDrudeListBox} = $ChildFrame->MyBrowseEntry( -label => "Drude functions:", -state => "readonly", -takefocus => 1, -width => 2, -Selections => [qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)], -SelIndex => $$piDrude, )->pack(-side => 'left'); $ChildFrame->{NDrudeListBox}->configure( -browsecmd => sub { $$piDrude = $ChildFrame->{NDrudeListBox}->GetText(); # + 0; $this->RefreshMainPane($EntryWidth, @_); $this->RefreshDrudeParamConditionPane($EntryWidth, @_); } ); } elsif($pIsBuildNumberBrowseEntry->[$j] eq 'nPESStepBG') { $ChildFrame->{NStepBGListBox} = $MainFrame->{NStepBGListBox} = $ChildFrame->MyBrowseEntry( -label => "Step BGs:", -state => "readonly", -takefocus => 1, -width => 2, -Selections => [qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)], -SelIndex => $$piStepBG, )->pack(-side => 'left'); $ChildFrame->{NStepBGListBox}->configure( -browsecmd => sub { $$piStepBG = $ChildFrame->{NStepBGListBox}->GetText(); # + 0; $this->RefreshMainPane($EntryWidth, @_); # $this->RefreshDrudeParamConditionPane($EntryWidth, @_); } ); } elsif($pIsBuildNumberBrowseEntry->[$j] eq 'nGaussLorentz') { $ChildFrame->{NGaussLorentzListBox} = $MainFrame->{NGaussLorentzListBox} = $ChildFrame->MyBrowseEntry( -label => "Gauss-Lorentz functions:", -state => "readonly", -takefocus => 1, -width => 2, -Selections => [qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)], -SelIndex => $$piGaussLorentz, )->pack(-side => 'left'); $ChildFrame->{NGaussLorentzListBox}->configure( -browsecmd => sub { #print "CT1[$this->{ini}->{ConductionType}]\n"; $$piGaussLorentz = $ChildFrame->{NGaussLorentzListBox}->GetText(); # + 0; $this->RefreshMainPane($EntryWidth, @_); # $this->RefreshDrudeParamConditionPane($EntryWidth, @_); #print "CT2[$this->{ini}->{ConductionType}]\n"; } ); } } return $ChildFrame; } sub MakeNotebookPanes { my ($this, $mw, $EntryWidth, $piFilmLayer, $piLorentz, $piDrude, $piStepBG, $piGaussLorentz, $pIsBuildPaneArray, $pIsBuildNumberBrowseEntry, @args) = @_; if(!defined $pIsBuildNumberBrowseEntry) { ($this, $mw, $EntryWidth, $piFilmLayer, $piLorentz, $piDrude, $pIsBuildPaneArray, $pIsBuildNumberBrowseEntry, @args) = @_; $piStepBG = \$this->{ini}->{nStepBG}; $piGaussLorentz = \$this->{ini}->{nGL}; } my $TabWidth = 100; my $nb = $mw->NoteBook()->pack(-fill => 'both', -expand => 'yes'); my $ChildFrame = $nb; for(my $i = 0 ; $i < @$pIsBuildPaneArray ; $i++) { if($pIsBuildPaneArray->[$i] eq 'Main') { $ChildFrame->{MainPage} = $nb->add("Main", -label => 'Main', -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{MainPaneFrame} = $ChildFrame->{MainPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildMainPane($ChildFrame->{MainPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'Layers') { $ChildFrame->{LayersPage} = $nb->add("Layers", -label => 'Layers', -justify => 'left', -wraplength => $TabWidth); # my $ChildFrame1 = $ChildFrame->{LayersPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); my $ChildFrame1 = $ChildFrame->{LayersPage}->MyLabFrame( -label => '# of Functions', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $Frame = $this->MakeNumbersListBoxes($ChildFrame1, $EntryWidth, $piFilmLayer, $piLorentz, $piDrude, $piStepBG, $piGaussLorentz, $pIsBuildPaneArray, $pIsBuildNumberBrowseEntry); $Frame->pack(-anchor => 'nw', -fill => 'x'); $this->mw()->{NFilmLayerListBox} = $Frame->{NFilmLayerListBox}; $this->mw()->{NLorentzListBox} = $Frame->{NLorentzListBox}; $this->mw()->{NDrudeListBox} = $Frame->{NDrudeListBox}; $this->mw()->{NStepBGListBox} = $Frame->{NStepBGListBox}; $this->mw()->{NGaussLorentzListBox} = $Frame->{NGaussLorentzListBox}; $ChildFrame->{LayersPaneFrame} = $ChildFrame->{LayersPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildLayersPane($ChildFrame->{LayersPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'Setup') { $ChildFrame->{SetupPage} = $nb->add("Setup", -label => 'Setup', -justify => 'left', -wraplength => $TabWidth); # my $ChildFrame1 = $ChildFrame->{SetupPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); my $ChildFrame1 = $ChildFrame->{SetupPage}->MyLabFrame( -label => '# of Functions', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $Frame = $this->MakeNumbersListBoxes($ChildFrame1, $EntryWidth, $piFilmLayer, $piLorentz, $piDrude, $piStepBG, $piGaussLorentz, $pIsBuildPaneArray, $pIsBuildNumberBrowseEntry); $Frame->pack(-anchor => 'nw', -fill => 'x'); $this->mw()->{NFilmLayerListBox} = $Frame->{NFilmLayerListBox}; $this->mw()->{NLorentzListBox} = $Frame->{NLorentzListBox}; $this->mw()->{NDrudeListBox} = $Frame->{NDrudeListBox}; $this->mw()->{NStepBGListBox} = $Frame->{NStepBGListBox}; $this->mw()->{NGaussLorentzListBox} = $Frame->{NGaussLorentzListBox}; $ChildFrame->{SetupPaneFrame} = $ChildFrame->{SetupPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildSetupPane($ChildFrame->{SetupPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'LSQ') { $ChildFrame->{LSQPage} = $nb->add("LSQ", -label => 'LSQ', -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{LSQPaneFrame} = $ChildFrame->{LSQPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildLSQPane($ChildFrame->{LSQPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'Misc') { $ChildFrame->{MiscParamConditionPage} = $nb->add("Misc Params", -label => "Common", -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{MiscParamConditionPaneFrame} = $ChildFrame->{MiscParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildMiscParamConditionPane($ChildFrame->{MiscParamConditionPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'Lorentz') { $ChildFrame->{LorentzParamConditionPage} = $nb->add("Lorentz Params", -label => "Lorentz", -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{LorentzParamConditionPaneFrame} = $ChildFrame->{LorentzParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildLorentzParamConditionPane($ChildFrame->{LorentzParamConditionPaneFrame}, $EntryWidth); } elsif($pIsBuildPaneArray->[$i] eq 'Drude') { $ChildFrame->{DrudeParamConditionPage} = $nb->add("Drude Params", -label => "Drude", -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{DrudeParamConditionPaneFrame} = $ChildFrame->{DrudeParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildDrudeParamConditionPane($ChildFrame->{DrudeParamConditionPaneFrame}, $EntryWidth); } else { my $s = $pIsBuildPaneArray->[$i]; $ChildFrame->{"${s}Page"} = $nb->add($s, -label => $s, -justify => 'left', -wraplength => $TabWidth); $ChildFrame->{"${s}PaneFrame"} = $ChildFrame->{"${s}Page"}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); no strict; my $func = "Build${s}Pane"; $this->$func($ChildFrame->{"${s}PaneFrame"}, $EntryWidth); use strict; } } return $ChildFrame; } sub RefreshPane { my ($this, $key, $EntryWidth, @a) = @_; return if(!defined $this->mw()->{NoteBook}->{"${key}PaneFrame"}); $this->mw()->{NoteBook}->{"${key}PaneFrame"}->destroy(); $this->mw()->{NoteBook}->{"${key}PaneFrame"} = $this->mw()->{NoteBook}->{"${key}Page"}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); #my $ini = $this->{ini}; #my %ini0 = %$ini; #print "CT1c[$this->{ini}->{ConductionType}]\n"; my $funcname = "Build${key}Pane"; no strict; $this->$funcname($this->mw()->{NoteBook}->{"${key}PaneFrame"}, $EntryWidth); use strict; #%$ini = %ini0; #print "CT1d[$this->{ini}->{ConductionType}]\n"; } sub RefreshMainPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("Main", $EntryWidth, @a); return if(!defined $this->mw()->{NoteBook}->{MainPaneFrame}); $this->mw()->{NoteBook}->{MainPaneFrame}->destroy(); $this->mw()->{NoteBook}->{MainPaneFrame} = $this->mw()->{NoteBook}->{MainPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildMainPane($this->mw()->{NoteBook}->{MainPaneFrame}, $EntryWidth); } sub RefreshLayersPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("Layers", $EntryWidth, @a); return if(!defined $this->mw()->{NoteBook}->{LayersPaneFrame}); $this->mw()->{NoteBook}->{LayersPaneFrame}->destroy(); $this->mw()->{NoteBook}->{LayersPaneFrame} = $this->mw()->{NoteBook}->{LayersPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildLayersPane($this->mw()->{NoteBook}->{LayersPaneFrame}, $EntryWidth); } sub RefreshViewRangePane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("ViewRange", $EntryWidth, @a); } sub RefreshSetupPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("Setup", $EntryWidth, @a); } sub RefreshMiscParamConditionPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("MiscParamCondition", $EntryWidth, @a); return if(!defined $this->mw()->{NoteBook}->{LorentzParamConditionPaneFrame}); $this->mw()->{NoteBook}->{MiscParamConditionPaneFrame}->destroy(); $this->mw()->{NoteBook}->{MiscParamConditionPaneFrame} = $this->mw()->{NoteBook}->{MiscParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildMiscParamConditionPane($this->mw()->{NoteBook}->{MiscParamConditionPaneFrame}, $EntryWidth); } sub RefreshLorentzParamConditionPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("LorentzParamCondition", $EntryWidth, @a); return if(!defined $this->mw()->{NoteBook}->{LorentzParamConditionPaneFrame}); $this->mw()->{NoteBook}->{LorentzParamConditionPaneFrame}->destroy(); $this->mw()->{NoteBook}->{LorentzParamConditionPaneFrame} = $this->mw()->{NoteBook}->{LorentzParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildLorentzParamConditionPane($this->mw()->{NoteBook}->{LorentzParamConditionPaneFrame}, $EntryWidth); } sub RefreshDrudeParamConditionPane { my ($this, $EntryWidth, @a) = @_; return $this->RefreshPane("DrudeParamCondition", $EntryWidth, @a); return if(!defined $this->mw()->{NoteBook}->{DrudeParamConditionPaneFrame}); $this->mw()->{NoteBook}->{DrudeParamConditionPaneFrame}->destroy(); $this->mw()->{NoteBook}->{DrudeParamConditionPaneFrame} = $this->mw()->{NoteBook}->{DrudeParamConditionPage}->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->BuildDrudeParamConditionPane($this->mw()->{NoteBook}->{DrudeParamConditionPaneFrame}, $EntryWidth); } sub BuildGraphFramePane { my ($this, $MainFrame, $EntryWidth) = @_; my $App = $this->App(); my $IniFile = $App->IniFile(); my $Style = $App->Args()->GetGetArg("style"); $Style = "General" unless($Style); # my @PositionStr; for(my $i = 0 ; ; $i++) { # $PositionStr[$i] = $IniFile->GetString($Style, "GraphFrame${i}_Position", ''); # my $FramePosStr0 = $App->{"GraphFrame${i}Position"}; # last if($PositionStr[$i] eq ''); last if(!$App->{"GraphFrame${i}Position"}); #print "pos$i=$pos\n"; my $i1 = $i + 1; my $Frame = $MainFrame->MyFrame()->pack(-fill => 'x'); $Frame->MyLabel(-text => "GraphFrame$i:")->pack(-side => 'left'); $Frame->MyEntry( # -name => $name, # -width => $EntryWidth, -textvariable => \$App->{"GraphFrame${i}Position"}, #\$PositionStr[$i], -state => 'normal', -format => '%s', -takefocus => 1, )->pack(-side => 'left', -fill => 'x'); } my $Frame = $MainFrame->MyFrame()->pack(-fill => 'x'); $Frame->MyButton( -text => 'Save', -takefocus => 1, -command => sub { $App->SaveSetting(); $this->CreateGraphFrame(undef, undef, 1); $this->RePlot(1); #print "G=", $App->{GraphFrame0Position}, "\n"; }, )->pack(-side => 'left'); } sub BuildSetupPane { my ($this, $MainFrame, $EntryWidth) = @_; my $width = 50; my $ChildFrame = $MainFrame->MyLabFrame( -label => 'External Programs', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $Frame = $this->MakeSetupOptionFrame($ChildFrame, $width); $Frame->pack(-expand => 'yes', -fill => 'x'); } sub BuildLorentzParamConditionPane { my ($this, $MainFrame, $EntryWidth) = @_; return if($this->{ini}->{nLorentz} == 0); my $Frame = $MainFrame->MyLabFrame( -label => 'Lorentz parameters', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $row = 1; $this->MakeParameterConditionHeading($Frame, 0, 0); for(my $i = 0 ; $i < $this->{ini}->{nLorentz} ; $i++) { my $i1 = $i + 1; $this->MakeParameterConditionColumn($Frame, "E0${i1}", "E0[${i1}]:", "%12.6g", 2.64, 0, 0.1, 0.0, '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "Ne${i1}", "Ne[${i1}]:", "%12.6g", 2e26, 0, 1e26, 0.0, '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "G${i1}", "G[${i1}]:", "%12.6g", 0.5, 0, 0.1, 0.0, '', $EntryWidth, $row++); } } sub BuildDrudeParamConditionPane { my ($this, $MainFrame, $EntryWidth) = @_; return if($this->{ini}->{nDrude} == 0); my $Frame = $MainFrame->MyLabFrame( -label => 'Drude parameters', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $row = 1; $this->MakeParameterConditionHeading($Frame, 0, 0); for(my $i = 0 ; $i < $this->{ini}->{nDrude} ; $i++) { my $i1 = $i + 1; $this->MakeParameterConditionColumn($Frame, "DrudeEp${i1}", "Ep[${i1}]:", "%12.6g", 0.0, 0, 0.1, 0.0, '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "Drudetau${i1}", "tau[${i1}]:", "%12.6g", 1.0e-14, 0, 1.0e-15, 0.0, '', $EntryWidth, $row++); } } sub BuildGaussLorentzPane { my ($this, $MainFrame, $EntryWidth) = @_; return if($this->{ini}->{nLorentz} == 0); my $Frame = $MainFrame->MyLabFrame( -label => 'Gauss-Lorentz parameters', -labelside => 'acrosstop', )->pack(-side => 'top', -fill => 'x'); my $row = 1; $this->MakeParameterConditionHeading($Frame, 0, 0); my $nGL = ($this->{ini}->{nGL} > 5)? $this->{ini}->{nGL} : 5; for(my $i = 0 ; $i < $nGL ; $i++) { my $i1 = $i; $this->MakeParameterConditionColumn($Frame, "GLE0${i1}", "E0[${i1}]:", "%12.6g", 0.0, 0, 0.1, '', '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "GLC0${i1}", "C0[${i1}]:", "%12.6g", 0.0, 0, 1000, 0.0, '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "GLWL${i1}", "WL[${i1}]:", "%12.6g", 0.3, 0, 0.1, 0.0, '', $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "GLGFraction${i1}", "GaussF[${i1}]:", "%12.6g", 1.0, 0, 0.1, 0.0, 1.0, $EntryWidth, $row++); $this->MakeParameterConditionColumn($Frame, "GLGWRatio${i1}", "WRatio[${i1}]:", "%12.6g", 1.0, 0, 0.1, 0.0, '', $EntryWidth, $row++); } } sub MakeDrudePane { my ($this, $Frame, $EntryWidth, $nDrude, @args) = @_; return $Frame->MyFrame() if($nDrude == 0); my $ChildFrame = $Frame->MyLabFrame( -label => "Drude", -labelside => 'acrosstop', )->pack(-anchor => 'nw'); for(my $i = 0 ; $i < $nDrude ; $i++) { my $i1 = $i + 1; $this->MakeCheckEntry($ChildFrame, "DrudeEp${i1}", "Ep:", $this->{dini}->pVariable("DrudeEp${i1}check", 0), $this->{ini}->pVariable("DrudeEp${i1}", 0.0), "%12.6g", $EntryWidth, "eV", $i, 1); $this->MakeCheckEntry($ChildFrame, "Drudetau${i1}", "tau:", $this->{dini}->pVariable("Drudetau${i1}check", 0), $this->{ini}->pVariable("Drudetau${i1}", 1.0e-14), "%12.6g", $EntryWidth, "s", $i, 2); } return $ChildFrame; } sub MakeLorentzPane { my ($this, $Frame, $EntryWidth, $nLorentz, @args) = @_; return $Frame->MyFrame() if($nLorentz == 0); my $ChildFrame = $Frame->MyLabFrame( -label => "Lorentz", -labelside => 'acrosstop', )->pack(-anchor => 'nw'); for(my $i = 0 ; $i < $nLorentz ; $i++) { my $i1 = $i + 1; $this->MakeCheckEntry($ChildFrame, "E0${i1}", "E0:", $this->{dini}->pVariable("E0${i1}check", 0), $this->{ini}->pVariable("E0${i1}", 2.64), "%12.6g", $EntryWidth, "eV", $i, 0); $this->MakeCheckEntry($ChildFrame, "Ne${i1}", "Ne:", $this->{dini}->pVariable("Ne${i1}check", 0), $this->{ini}->pVariable("Ne${i1}", 0.0), "%12.6g", $EntryWidth, "m-3", $i, 1); $this->MakeCheckEntry($ChildFrame, "G${i1}", "G:", $this->{dini}->pVariable("G${i1}check", 0), $this->{ini}->pVariable("G${i1}", 2.64), "%12.6g", $EntryWidth, "eV", $i, 2); } return $ChildFrame; } sub MakeUrbachPane { my ($this, $Frame, $EntryWidth, @args) = @_; my $ChildFrame = $Frame->MyLabFrame( -label => 'Urbach tail', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeCheckEntry($ChildFrame, "UrbachE0", "E0:", $this->{dini}->pVariable('UrbachE0check', 0) , $this->{ini}->pVariable('UrbachE0', 3.2), "%12.6g", $EntryWidth, "eV", 0, 0); $this->MakeCheckEntry($ChildFrame, "UrbachEu", "Eu:", $this->{dini}->pVariable('UrbachEucheck', 0) , $this->{ini}->pVariable('UrbachEu', 0.1), "%12.6g", $EntryWidth, "eV", 0, 1); return $ChildFrame; } sub MakeTaucPane { my ($this, $Frame, $EntryWidth, @args) = @_; my $ChildFrame = $Frame->MyLabFrame( -label => 'Tauc model', -labelside => 'acrosstop', )->pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); $this->MakeCheckEntry($ChildFrame, "TaucEg", "Eg:", $this->{dini}->pVariable('TaucEgcheck', 0) , $this->{ini}->pVariable('TaucEg', 3.0 ), "%12.6g", $EntryWidth, "eV", 0, 0); $this->MakeCheckEntry($ChildFrame, "TaucA", "A:", $this->{dini}->pVariable('TaucAcheck', 0) , $this->{ini}->pVariable('TaucA', 0.0), "%12.6g", $EntryWidth, "", 0, 1); $this->MakeCheckEntry($ChildFrame, "Taucn", "n:", $this->{dini}->pVariable('Taucncheck', 0) , $this->{ini}->pVariable('Taucn', 2.0), "%12.6g", $EntryWidth, "", 0, 2); return $ChildFrame; } sub MakeDielectricBackgroundPane { my ($this, $Frame, $EntryWidth, @args) = @_; my $ChildFrame = $Frame->MyLabFrame( -label => 'Dielectric background', -labelside => 'acrosstop', )->pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); $this->MakeCheckEntry($ChildFrame, "e1inf", "e1:", $this->{dini}->pVariable('e1infcheck', 1) , $this->{ini}->pVariable('e1inf', 0.155), "%12.6g", $EntryWidth, "e0", 0, 0); $this->MakeCheckEntry($ChildFrame, "e2inf", "e2:", $this->{dini}->pVariable('e2infcheck', 0) , $this->{ini}->pVariable('e2inf', 0.0 ), "%12.6g", $EntryWidth, "e0", 0, 1); $this->MakeCheckEntry($ChildFrame, "Caucy2", "Caucy2:", $this->{dini}->pVariable('Caucy2check', 0) , $this->{ini}->pVariable('Caucy2', 0.0), "%12.6g", $EntryWidth, "", 1, 0); $this->MakeCheckEntry($ChildFrame, "Caucy4", "Caucy4:", $this->{dini}->pVariable('Caucy4check', 0) , $this->{ini}->pVariable('Caucy4', 0.0), "%12.6g", $EntryWidth, "", 1, 1); return $ChildFrame; } sub MakeLSQPanes { my ($this, $Frame, $EntryWidth, $FrameLabel, $pFramesArray, $pMethodArray, $pFitToArray, $pFittingRangeArray, $pFittingConditionArray, @args) = @_; $EntryWidth = 12 if(!defined $EntryWidth); $FrameLabel = 'Fitting' if(!defined $FrameLabel); $pFramesArray = [qw(LSQMethod FitTo FittingRange FittingConditions)] if(!defined $pFramesArray); $pMethodArray = ['Amoeba::Simplex', 'PDL::Simplex', 'ModifiedNewton'] if(!defined $pFittingConditionArray); $pFitToArray = ['RT', 'T', 'R', 'alpha'] if(!defined $pFitToArray); $pFittingRangeArray = ['FitXMin', 'Emin:', 'FitXMax', 'Emax:', 'nSkipData', 'nSkip:'] if(!defined $pFittingRangeArray); $pFittingConditionArray = ['EPS', 'EPS:', 'nMaxIter', 'MaxIter:', 'nSaveSpectraInterval', 'SaveIntvl:'] if(!defined $pFittingConditionArray); my %MakeComponents; foreach my $key (@$pFramesArray) { $MakeComponents{$key} = 1; } my $ChildFrame = $Frame->MyFrame(); my $ChildFrame1 = $ChildFrame->MyLabFrame( -label => $FrameLabel, -labelside => 'acrosstop', )->pack(-anchor => 'nw', -fill => 'x'); my $ChildFrame2; if($MakeComponents{LSQMethod} or $MakeComponents{FitTo}) { $ChildFrame2 = $ChildFrame1->MyFrame()->pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); } if($MakeComponents{LSQMethod}) { $ChildFrame->{LSQMethodListBox} = $ChildFrame2->MyBrowseEntry( -variable => $this->{ini}->pVariable("Method", 'Amoeba::Simplex'), -label => "LSQ Method:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => $pMethodArray, -SelIndex => 0, -browsecmd => [\&SelChangeListBox, $this, "LSQMethod", $this->{LSQMethodListBox}], )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); } if($MakeComponents{FitTo}) { $ChildFrame->{FitToListBox} = $ChildFrame2->MyBrowseEntry( -variable => $this->{ini}->pVariable("FitTo", ''), -label => "Fit to:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => $pFitToArray, -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); } if($MakeComponents{FittingRange} or $MakeComponents{FittingConditions}) { $ChildFrame2 = $ChildFrame1->MyFrame()->pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); } if($MakeComponents{FittingRange}) { my ($XMinVar, $XMinLabel, $XMaxVar, $XMaxLabel, $nSkipVar, $nSkipLabel) = @$pFittingRangeArray; $Frame = $ChildFrame2->MyFrame()->pack(-anchor => 'nw', -expand => 'yes'); $this->MakeFittingRangeFrame($Frame, $XMinVar, $XMinLabel, $this->{ini}->pVariable($XMinVar, ''), "%s", "", $XMaxVar, $XMaxLabel, $this->{ini}->pVariable($XMaxVar, ''), "%s", "", $nSkipVar, $nSkipLabel, $this->{ini}->pVariable($nSkipVar, 2), "%d", "", $EntryWidth); } if($MakeComponents{FittingConditions}) { my ($EPSVar, $EPSLabel, $nMaxIterVar, $nMaxIterLabel, $nSaveIntervalVar, $nSaveIntervalLabel) = @$pFittingConditionArray; $Frame = $ChildFrame2->MyFrame()->pack(-anchor => 'nw', -expand => 'yes'); $this->MakeLabelEntry($Frame, $EPSVar, $EPSLabel, $this->{ini}->pVariable('EPS', 1.0e-5), "%12.4g", $EntryWidth, "", 0, 0); $this->MakeLabelEntry($Frame, $nMaxIterVar, $nMaxIterLabel, $this->{ini}->pVariable('nMaxIter', 1000), "%d", $EntryWidth, "", 0, 1); $this->MakeLabelEntry($Frame, $nSaveIntervalVar, $nSaveIntervalLabel, $this->{ini}->pVariable('nSaveSpectraInterval', 10), "%d", $EntryWidth, "", 0, 2); } return $ChildFrame; } sub ChooseAFile { my ($this, $name, $mode, $fmask, $defstr, $message, $widget, $Option) = @_; my $dir = ''; unless($widget) { $dir = $this->App()->{WorkDir}; chdir($dir); } my $filepath = Dialog::OpenFileDialog($this->mw(), 'open', $fmask, $defstr, $message, $dir); return undef if(!defined $filepath or $filepath eq ''); my $DirPath = $this->SetWorkDir($filepath); $widget->SetText($filepath) if($widget); return $filepath; } sub ChooseFile { #action = 'open'; #'save' #fmask = '*.csv;*.spe;*.jel;*.asp;*.smo;*isa;*.ref;*.pal;*.bef;*.aft;*.prm'; my ($this, $action, $fmask, $Option, $name, $Frame) = @_; print "TkFittingCommon2::ChooseFile: a=$action, f=$fmask, n=$name, F=$Frame, o=$Option\n"; my $App = $this->App(); my $canvas = $this->Canvas(); my $mw = $this->mw(); my $Entry = $Frame->{PathEntry}; my $filepath = $this->ChooseAFile($name, $action, $fmask, '', "Choose file", $Entry, $Option); return undef if(!defined $filepath or $filepath eq ''); my $ret; if($Option eq 'ChooseParameterFile') { $ret = $this->ReadParameterFile($filepath, 1, $Frame); } elsif($Option =~ /ChooseSample.*File/i) { $ret = $this->ReadSampleDataFile($filepath, 1, $Frame); } elsif($Option =~ /ChooseSubstrateFile/i) { $ret = $this->ReadSubstrateDataFile($filepath, 1, $Frame); } return undef unless($ret); $this->CreateGraphFrame() if(!$this->GetGraphFrameArray()); return $ret; } sub EditFile { my ($this, $Option, $name, $Frame) = @_; #print "O=$Option n=$name, F=$Frame, pe=$Frame->{PathEntry}\n"; my $Editor = $this->App()->{EditorPath}; my $File = $Frame->{PathEntry}->GetText(); my $command = "$Editor $File"; # system($command); Deps::ExecBackground($command); } sub MakeLabelEntryByPack { my ($this, $Frame, $name, $label1, $pVariable, $format, $EntryWidth, $label2, $state) = @_; $state = 'normal' if(!defined $state); #print "Frame=$Frame name=$name,$label1,$format,$label2, ($row, $column) st=$state\n"; $$pVariable = Utils::DelSpace(sprintf($format, $$pVariable)); $Frame->MyLabel(-text => $label1)->pack(-side => 'left'); my $ent = $Frame->MyEntry( -name => $name, -width => $EntryWidth, # -text => $val, -textvariable => $pVariable, -state => $state, -format => $format, )->pack(-side => 'left'); $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 MakeLabelEntry { my ($this, $Frame, $name, $label1, $pVariable, $format, $EntryWidth, $label2, $row, $column, $state) = @_; #print "name=$name, pVariable=$pVariable, v=$$pVariable, format=$format\n"; #print "Frame=$Frame name=$name,$label1,$format,$label2, ($row, $column) st=$state\n"; $state = 'normal' if(!defined $state); if(!$pVariable) { $this->{$name} = ''; $pVariable = \{$this->{$name}}; } $$pVariable = Utils::DelSpace(sprintf($format, $$pVariable)) if($pVariable and $$pVariable); # my $ChildFrame = $Frame->MyFrame()->grid(-row => 0, -column => 0, -sticky => 'e'); #pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); my @a = ( -name => $name, # -text => $val, -textvariable => $pVariable, -state => $state, -format => $format, -takefocus => 1, ); if(defined $EntryWidth) { @a = (@a, -width => $EntryWidth); } my $ChildFrame = $Frame; $ChildFrame->{Label1} = $ChildFrame->MyLabel(-text => $label1); $ChildFrame->{Entry} = $Frame->MyEntry(@a); $ChildFrame->{Label2} = $ChildFrame->MyLabel(-text => $label2); $ChildFrame->{Label1}->grid(-row => $row, -column => 3*$column+0, -columnspan => 1, -sticky => 'e' ); $ChildFrame->{Entry}->grid( -row => $row, -column => 3*$column+1, -columnspan => 1, -sticky => 'e' ); $ChildFrame->{Label2}->grid(-row => $row, -column => 3*$column+2, -columnspan => 1, -sticky => 'w' ); $ChildFrame->{Label2}->bind('', [ sub { $this->EntryFocusedIn(@_); }, 'FocusIn', $name]); $ChildFrame->{Label2}->bind('', [ sub { $this->EntryFocusedOut(@_); }, 'FocusOut', $name]); $this->{pEntryArray} = [] if(!$this->{pEntryArray}); push(@{$this->{pEntryArray}}, $ChildFrame->{Entry}); return $ChildFrame; #$this->{"${name}Entry"} = $ent; } sub MakeCheckEntry { my ($this, $Frame, $name, $label1, $pCheckVariable, $pVariable, $format, $EntryWidth, $label2, $row, $column, $state) = @_; my $Synchronize; $state = 'normal' if(!defined $state); if($state =~ /sync.*\s+norm/i) { $state = 'normal'; $Synchronize = 1; } elsif($state =~ /sync.*\s+rev/i) { $state = 'normal'; $Synchronize = -1; } #print "name=$name p=$pVariable,$$pVariable form=$format check: $pCheckVariable, $$pCheckVariable f=$format\n"; $$pVariable = Utils::DelSpace(sprintf($format, $$pVariable)); # my $ChildFrame = $Frame->MyFrame()->grid(-row => 0, -column => 0, -sticky => 'e'); #pack(-anchor => 'nw', -expand => 'yes', -fill => 'x'); my $ChildFrame = $Frame; my $ButtonLabel = "${name}Button"; my $EntryLabel = "${name}Entry"; $this->{$ButtonLabel} = $ChildFrame->{Button} = $ChildFrame->MyCheckbutton( -text => $label1, -variable => $pCheckVariable, -onvalue => 1, -offvalue => 0, -indicatoron => 'no', -takefocus => 1, )->grid(-row => $row, -column => 3*$column+0, -columnspan => 1, -sticky => 'e' ); $this->{$ButtonLabel}->{status} = $$pCheckVariable; # $button->configure(-command => sub { print "$label1 is pressed [", $button->GetText(), "]\n"; }); $this->{$EntryLabel} = $ChildFrame->{Entry} = $ChildFrame->MyEntry( -name => $name, -width => $EntryWidth, # -text => $val, -textvariable => $pVariable, -state => $state, -format => $format, -takefocus => 1, )->grid(-row => $row, -column => 3*$column+1, -columnspan => 1, -sticky => 'e' ); $ChildFrame->MyLabel(-text => $label2)->grid(-row => $row, -column => 3*$column+2, -columnspan => 1, -sticky => 'w' ); # $ChildFrame->{Entry}->bind('', [\&EntryFocusedIn, $this, 'FocusIn', $name]); # $ChildFrame->{Entry}->bind('', [\&EntryFocusedOut, $this, 'FocusOut', $name]); $ChildFrame->{Entry}->bind('', [ sub { $this->EntryFocusedIn(@_); }, 'FocusIn', $name]); $ChildFrame->{Entry}->bind('', [ sub { $this->EntryFocusedOut(@_); }, 'FocusOut', $name]); #print "Labels: $ButtonLabel, $EntryLabel\n"; if(defined $Synchronize) { my $onstr = 'disabled'; my $offstr = 'normal'; if($Synchronize < 0) { $onstr = 'normal'; $offstr = 'disabled'; if(!$this->{$ButtonLabel}->{status}) { $this->{$EntryLabel}->configure(-state => 'disabled'); } } else { if($this->{$ButtonLabel}->{status}) { $this->{$EntryLabel}->configure(-state => 'disabled'); } } $this->{$ButtonLabel}->configure( -command => sub { if($$pCheckVariable) { # if($this->{$ButtonLabel}->{status}) { #print "button: $ButtonLabel: stat=", $this->{$ButtonLabel}->{status}, ",$$pCheckVariable str=$offstr\n"; $this->{$ButtonLabel}->{status} = 1; $this->{$EntryLabel}->configure(-state => $onstr); } else { #print "button2: $ButtonLabel: stat=", $this->{$ButtonLabel}->{status}, ",$$pCheckVariable str=$onstr\n"; $this->{$ButtonLabel}->{status} = 0; $this->{$EntryLabel}->configure(-state => $offstr); } } ); } $this->{pEntryArray} = [] if(!$this->{pEntryArray}); push(@{$this->{pEntryArray}}, $ChildFrame->{Entry}); # return $this->{"${name}Button"} = $button; # return $ChildFrame->{Entry}; #$this->{"${name}Entry"} = $ent; return $ChildFrame; } sub SaveParameterFile { my ($this, $Option, $filepath, $name, $Frame) = @_; $filepath = $Frame->{PathEntry}->GetText() if($filepath eq ''); $this->{ini}->{Method} = $this->{ChooseLSQMethodListBox}->GetText() if($this->{ChooseLSQMethodListBox}); $this->{ini}->{FitTo} = $this->{ChooseFitToListBox}->GetText() if($this->{ChooseFitToListBox}); $this->{ini}->{LayerModel} = $this->{ChooseLayerModelListBox}->GetText() if($this->{ChooseLayerModelListBox}); $this->{ini}->{Model} = $this->{ChooseModelListBox}->GetText() if($this->{ChooseModelListBox}); $this->{ini}->{X} = $this->{XListBox}->GetText() if($this->{ChooseXListBox}); $this->{ini}->{Y} = $this->{YListBox}->GetText() if($this->{ChooseYListBox}); $this->{ini}->{X1} = $this->{X1ListBox}->GetText() if($this->{ChooseX1ListBox}); $this->{ini}->{Y1} = $this->{Y1ListBox}->GetText() if($this->{ChooseY1ListBox}); $this->{ini}->{Y2} = $this->{Y2ListBox}->GetText() if($this->{ChooseY2ListBox}); if(!defined $filepath or $filepath eq '') { $filepath = $this->{ini}->{Sample1CSVFile}; $filepath = $this->{ini}->{SampleCSVFile} if(!defined $filepath or $filepath eq ''); $filepath = $this->{ini}->{SubstrateCSVFile} if(!defined $filepath or $filepath eq ''); $filepath = 'save.prm' if(!defined $filepath or $filepath eq ''); $filepath =~ s/\.csv$/\.prm/i; $filepath = Deps::ExtractFileName($filepath); $filepath = $this->ChooseSaveFile($filepath, '*.prm'); if($filepath) { my $ext = Deps::ExtractExtention($filepath); if(!defined $ext or $ext eq '') { $filepath = Deps::ReplaceExtension($filepath, ".prm"); } $this->{ini}->{ParameterFile} = $filepath; } else { return; } } $this->{ini}->SetIniFile($filepath, undef, 1); $this->App()->print("\nSaveParameterFile to [$filepath]\n"); $this->ComposeParameters($this->{dini}, $this->{ini}); $this->{ini}->WriteAll(); $this->DecomposeParameters($this->{ini}, $this->{dini}); } sub MakeChooseFileEntry { # $pDataLabelList: ['X', 'Y1', 'Y2'] my ($this, $Frame, $name, $Label, $pVariable, $ButtonLabel, $ChooseCommand, $UseSaveButton, $SaveCommand, $UseEditButton, $EditCommand, $pDataLabelList) = @_; $pDataLabelList = [] if(!defined $pDataLabelList); my $ChildFrame = $Frame->MyFrame(); my $ChildFrame1 = $ChildFrame->MyFrame()->pack(-side => 'top', -expand => 'yes', -fill => 'x'); $ChildFrame->{TopLabel} = $ChildFrame1->MyLabel(-text => $Label)->pack(-side => 'left'); $ChildFrame->{PathEntry} = $ChildFrame1->MyEntry( -takefocus => 1, -textvariable => $pVariable )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $ChildFrame->{PathEntry}->focus(); $ChildFrame->{PathButton} = $ChildFrame1->MyButton( -text => $ButtonLabel, -takefocus => 1, -command => sub { &$ChooseCommand($name, $ChildFrame); }, )->pack(-side => 'left', -fill => 'x'); if($UseSaveButton) { $ChildFrame->{SaveButton} = $ChildFrame1->MyButton( -text => '&Save', -takefocus => 1, -command => sub { &$SaveCommand($name, $ChildFrame); }, )->pack(-side => 'left', -fill => 'x'); } if($UseEditButton) { $ChildFrame->{EditButton} = $ChildFrame1->MyButton( -text => 'ed', -takefocus => 1, -command => sub { &$EditCommand($name, $ChildFrame); }, )->pack(-side => 'left', -fill => 'x'); } if(defined $pDataLabelList and @$pDataLabelList > 0) { my $ChildFrame2 = $ChildFrame->MyFrame()->pack(-side => 'top', -expand => 'yes', -fill => 'x'); $ChildFrame2->MyLabel(-text => " ")->pack(-side => 'left', -expand => 'no', -fill => 'x'); for(my $i = 0 ; $i < @$pDataLabelList ; $i++) { my $key = $pDataLabelList->[$i]; $ChildFrame->{"${key}ListBox"} = $ChildFrame2->MyBrowseEntry( -variable => $this->{ini}->pVariable("$name$key", ''), -label => "$key:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $ChildFrame->{"${key}ListBox"}->configure(-browsecmd => [\&SelChangeListBox, $this, $key, $this->{"${key}ListBox"}]); } } return $ChildFrame; } sub MakeCheckbutton { my ($this, $Frame, $name, $Label, $pVariable, $OnValue, $OffValue) = @_; $OnValue = 1 if(!defined $OnValue); $OffValue = 0 if(!defined $OffValue); $this->{"${name}Checkbutton"} = $Frame->MyCheckbutton( -text => $Label, -variable => $pVariable, -onvalue => $OnValue, -offvalue => $OffValue, )->pack(-side => 'left'); return $this->{"${name}Checkbutton"}; } sub MakeParameterConditionHeading { my ($this, $Frame, $row, $column) = @_; $column = 0 if(!defined $column); $Frame->MyLabel(-text => 'Variable')->grid(-row => $row, -column => $column+0, -columnspan => 1, -sticky => 'w' ); $Frame->MyLabel(-text => 'value')->grid( -row => $row, -column => $column+1, -columnspan => 2, -sticky => 'w' ); $Frame->MyLabel(-text => 'scale')->grid( -row => $row, -column => $column+3, -columnspan => 1, -sticky => 'w' ); $Frame->MyLabel(-text => 'min')->grid( -row => $row, -column => $column+4, -columnspan => 1, -sticky => 'w' ); $Frame->MyLabel(-text => 'max')->grid( -row => $row, -column => $column+5, -columnspan => 1, -sticky => 'w' ); } sub MakeParameterConditionColumn { my ($this, $Frame, $VarName, $Label, $format, $VarDefault, $CheckDefault, $ScaleDefault, $MinDefault, $MaxDefault, $EntryWidth, $row, $state) = @_; $state = 'normal' if(!defined $state); #print "$VarName: $CheckDefault\n"; $this->MakeCheckEntry($Frame, $VarName, $Label, $this->{dini}->pVariable("${VarName}check", $CheckDefault), $this->{ini}->pVariable($VarName, $VarDefault), $format, $EntryWidth, '', $row, 0); $Frame->MyEntry( -name => $VarName, -width => $EntryWidth-4, -textvariable => $this->{dini}->pVariable("${VarName}scale", $ScaleDefault), -format => $format, -takefocus => 1, -state => $state )->grid(-row => $row, -column => 3, -columnspan => 1, -sticky => 'e' ); $Frame->MyEntry( -name => $VarName, -width => $EntryWidth-2, -textvariable => $this->{dini}->pVariable("${VarName}min", $MinDefault), -format => $format, -takefocus => 1, -state => $state )->grid(-row => $row, -column => 4, -columnspan => 1, -sticky => 'e' ); $Frame->MyEntry( -name => $VarName, -width => $EntryWidth-2, -textvariable => $this->{dini}->pVariable("${VarName}max", $MaxDefault), -format => $format, -takefocus => 1, -state => $state )->grid(-row => $row, -column => 5, -columnspan => 1, -sticky => 'e' ); } sub EntryFocusedIn { my ($this, $obj, $event, $type) = @_; #print "In: obj=$obj, this=$this, event=$event, type=$type\n"; if($event eq 'FocusIn') { $obj->{PrevValue} = $obj->GetText(); } } sub EntryFocusedOut { my ($this, $obj, $event, $type) = @_; #print "Out: obj=$obj, this=$this, event=$event, type=$type\n"; my $ini = $this->{ini}; my $dini = $this->{dini}; if($event eq 'FocusOut') { } if($ini->{AutoUpdate} and defined $dini->{"${type}check"} and $obj->{PrevValue} != $obj->GetText()) { $this->Recalc(); # $this->CreateGraphFrame(); $this->AssignGraphData(0); $this->Draw(); } else { $this->UpdateParameters(); } } sub SelChangeListBox { my ($this, $type, $lb) = @_; return if(!$this->{ini}->{AutoUpdate}); $this->Recalc(); # $this->CreateGraphFrame(); $this->AssignGraphData(0); $this->Draw(); } 1;