package GraphFrame @ISA = qw() sub SetScalePlotType my ($object, $axis, $type) = @_; sub ResetCurColor sub GetColor my ($idx) = @_; return $PredefinedColors[$idx % ($nColors-1)]; sub App return shift->mw()->App(); sub Application return shift->mw()->App(); sub MainMenu return shift->mw()->MainMenu(); sub mw return shift->{'MainWindow'}; sub MainWindow return shift->{'MainWindow'}; return shift->{'Canvas'}; sub Canvas my ($this, $canvas) = @_; return $canvas; return $this->mw()->Canvas(); my ($this,$c)=@_; return shift->{'Canvas'} = $c; sub GraphScaleArray return shift->{'GraphScaleArray'}; sub Index return shift->{'Index'}; sub CanvasHeight return shift->{'CanvasHeight'}; sub CanvasWidth return shift->{'CanvasWidth'}; sub GetViewXRange sub GetViewXRange { my $this= return ($this->{'ViewX0'}, $this->{'ViewX1'}); sub GetViewYRange sub GetViewYRange { my $this= return ($this->{'ViewY0'}, $this->{'ViewY1'}); sub GetViewRange sub GetViewRange { my $this= sub GetPosition sub GetPosition { my $this= sub nDataArray return @$da; sub GetnGraphData my ($this) = @_; return scalar @$pDataArray; sub GetPlotData my ($this, $idx) = @_; return $this->{'DataArray'}->[$idx]; sub GetXYGraphDataRefs my ($this, $idx) = @_; sub SetSmoothLine sub SetSmoothLine { my ($this,$f)= return $this->{'SmoothLine'} = $f; sub SmoothLine sub SmoothLine { my ($this)= return $this->{'SmoothLine'}; sub SetIndex sub SetIndex { my ($this,$i)= return $this->{'Index'} = $i; sub XScalePlotType return shift->{'XScalePlotType'}; sub YScalePlotType return shift->{'YScalePlotType'}; sub BottomLineVisible return shift->{'BottomLineVisible'}; sub RightLineVisible return shift->{'RightLineVisible'}; sub TopLineVisible return shift->{'TopLineVisible'}; sub LeftLineVisible return shift->{'LeftLineVisible'}; sub SetX0LineVisible sub SetX0LineVisible { my ($this,$f)= return shift->{'X0LineVisible'} = $f; sub X0LineVisible return shift->{'X0LineVisible'}; sub SetY0LineVisible sub SetY0LineVisible { my ($this,$f)= return shift->{'Y0LineVisible'} = $f; sub Y0LineVisible return shift->{'Y0LineVisible'}; sub SetBottomLineVisible sub SetBottomLineVisible { my ($this,$f)= return shift->{'BottomLineVisible'} = $f; sub SetRightLineVisible sub SetRightLineVisible { my ($this,$f)= return shift->{'RightLineVisible'} = $f; sub SetTopLineVisible sub SetTopLineVisible { my ($this,$f)= return shift->{'TopLineVisible'} = $f; sub SetLeftLineVisible sub SetLeftLineVisible { my ($this,$f)= return shift->{'LeftLineVisible'} = $f; sub SetLinesVisible my ($this, $left, $right, $top, $bottom, $x0, $y0) = @_; sub SetFlipX my ($this, $f) = @_; return $this->{FlipX} = $f; sub SetFlipY my ($this, $f) = @_; return $this->{FlipY} = $f; sub SetFlipXY my ($this, $fx, $fy) = @_; sub XMin return shift->{XMin}; sub XMax return shift->{XMax}; sub YMin return shift->{YMin}; sub YMax return shift->{YMax}; sub XRange my ($this, $ConvertFunc, $FillWithValue) = @_; return ($x0, $x1) = Utils::Sort($x0, $x1); sub YRange my ($this, $ConvertFunc, $FillWithValue) = @_; return ($y0, $y1) = Utils::Sort($y0, $y1); sub XYRange my ($this, $ConvertFunc, $FillWithValue) = @_; return ($x0, $y0, $x1, $y1); sub CalMaxMarginRange my ($this, $marginx0, $marginx1, $marginy0, $marginy1) = @_; return ($xm0, $ym0, $xm1, $ym1); sub new my ($module, $mainwindow, $idx) = @_; my ($module, $mainwindow, $canvas, $idx) = @_; return $this; sub DESTROY my $this = shift; # $this->SUPER::DESTROY( sub IsInside my ($this, $x, $y) = @_; return 0 if($r < 0 or 1.0 < $r); return 0 if($r < 0 or 1.0 < $r); return 1; sub AddXScale my ($this, $position, $plottype) = @_; sub AddYScale my ($this, $position, $plottype) = @_; sub SaveCSVFile my ($this, $path, $LimitToViewYRange) = @_; return undef if($nDataArray == 0); return 1; sub ClearAllData my ($this) = @_; sub AddGraphData my ($this, $pXDataArray, $pYDataArray, $LineWidth, $LineColor, $SymbolType, $SymbolSize, $SymbolFillColor, $SymbolLineWidth, $SymbolLineColor, $Option, $XName, $YName) = @_; return if(!$pXDataArray or !$pYDataArray); return scalar @$pDataArray; sub AddDiffractionData my ($this, $pX, $pY, $pI, $pTag, $pCallBackHoverItem, $SymbolType1, $SymbolSize1, $SymbolColor1, $SymbolType2, $SymbolSize2, $SymbolColor2, $XName, $YName) = @_; return if(!$pX or !$pY); return scalar @$pDataArray; sub CalXMinMax my ($this) = @_; return undef; return (0, 0) if($nData <= 0); return ($min, $max); sub CalYMinMax my ($this) = @_; return unless($pDataArray); return (0, 0) if($nData <= 0); return ($min, $max); sub CalMinMax my ($this) = @_; sub CalAdjustViewRange my ($this, $marginx0, $marginx1, $marginy0, $marginy1, $DoSynchronizeX, $DoSynchronizeY) = @_; return ($xmin, $ymin, $xmax, $ymax); sub AdjustViewRange my ($this, $marginx0, $marginx1, $marginy0, $marginy1, $DoSynchronizeX, $DoSynchronizeY) = @_; return $this->SetViewRange($this->CalAdjustViewRange($marginx0, $marginx1, $marginy0, $marginy1, $DoSynchronizeX, $DoSynchronizeY)); sub SetCanvasSize my ($this, $width, $height) = @_; return $this->SetPosition($x0, $y0, $x1, $y1); sub SetScaleStringVisible my ($this, $XYStr, $f) = @_; sub SetScaleVisible my ($this, $XYStr, $f) = @_; sub GetXScale my ($this, $idx) = @_; return unless(defined $pScaleArray); return $scale if($c == $idx); sub GetYScale my ($this, $idx) = @_; return unless(defined $pScaleArray); return $scale if($c == $idx); sub SetXCaption my ($this, $caption) = @_; return $this->{'XCaption'} = $caption; sub SetYCaption my ($this, $caption) = @_; return $this->{'YCaption'} = $caption; sub SetFont my ($this, $pFont) = @_; sub SetXScalePlotType my ($this, $type, $DoSynchronize) = @_; return unless($pScaleArray); sub SetYScalePlotType my ($this, $type, $DoSynchronize) = @_; return unless($pScaleArray); sub PositionToValue my ($this, $cx, $cy) = @_; return unless($y1); return (&$ixf($vx), &$iyf($vy)); sub ValueToPosition my ($this, $vx, $vy) = @_; return ($x, $y); sub XVal my ($this, $v) = @_; return &$xf($v); sub YVal my ($this, $v) = @_; return &$yf($v); sub CheckGraphFrameSize my ($this) = @_; sub Draw my ($this, $canvas) = @_; return $rect; sub SetViewXRange my ($this, $x0, $x1, $DoSynchronize) = @_; sub SetViewYRange my ($this, $y0, $y1, $DoSynchronize) = @_; sub SetViewRange my ($this, $x0, $y0, $x1, $y1, $DoSynchronizeX, $DoSynchronizeY) = @_; return ($x0, $y0, $x1, $y1); sub RecalcScale my ($this) = @_; sub SetPosition my ($this, $x0, $y0, $x1, $y1) = @_; sub SetPositionByRatio my ($this, $rx0, $ry0, $rx1, $ry1) = @_; return $this->SetPosition($x0, $y0, $x1, $y1); sub SetPositionByStr my ($this, $str) = @_; sub AddSynchronousFrame my ($this, $XorY, $GraphFrame) = @_; sub IsPointInFrame my ($this, $x, $y) = @_; return 0 unless(defined $y); return 0 unless(defined $y1); return 0 if($rx > 1.0 or $rx < 0.0); return 0 if($ry > 1.0 or $ry < 0.0); return 1; sub ShowScaleDialog my ($this, $title, $x0, $y0, $x1, $y1, $XPlotType, $YPlotType, $SyncXScalePlotType, $SyncYScalePlotType, $DoRedraw) = @_; return unless(defined $x0); sub ShowGraphFrameDialog my ($this, $title) = @_; return unless(defined $x0);