Procedure

TfrmGraphs.timHintPauseTimer

Module

fGraphs

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public/Published

Owner

TfrmGraphs

Declaration

procedure timHintPauseTimer(Sender: TObject);

Calls Hierarchy


TfrmGraphs.timHintPauseTimer
 ├TfrmGraphs.InactivateHint
 ├TitleOK
 ├TfrmGraphs.ValueText
 │ ├TfrmGraphs.NonNumText
 │ │ ├TfrmGraphs.FileNameX
 │ │ ├TfrmGraphs.ItemName
 │ │ └TfrmGraphs.SetRefNonNum
 │ │   └TfrmGraphs.RefUnits
 │ │     └TfrmGraphs.SelectRef
 │ │       └CheckRef
 │ ├TfrmGraphs.ItemCheck
 │ ├TfrmGraphs.CheckMedNum
 │ ├TfrmGraphs.FileNameX
 │ ├TfrmGraphs.ValueDates
 │ ├TfrmGraphs.ResultValue
 │ │ ├TfrmGraphs.serDatelineTopGetMarkText
 │ │ └TfrmGraphs.BPValue
 │ └TfrmGraphs.OtherInfo
 │   └TfrmGraphs.SetRef
 │     └TfrmGraphs.RefUnits...
 └TfrmGraphs.FormatHint
   ├TfrmGraphs.TypeString
   └TfrmGraphs.LabNameResults

Calls

Name Declaration Comments
TfrmGraphs.FormatHint procedure FormatHint(var astring: string); -
TfrmGraphs.InactivateHint procedure InactivateHint; -
TitleOK function TitleOK(aTitle: string): boolean; -
TfrmGraphs.ValueText function ValueText(Sender: TCustomChart; aSeries: TChartSeries; ValueIndex: Integer): string; -


Source

7144  procedure TfrmGraphs.timHintPauseTimer(Sender: TObject);
7145  
7146    function TitleOK(aTitle: string): boolean;
7147    begin
7148      Result := false;
7149      if Copy(aTitle, 1, 7)= 'Ref Low' then exit
7150      else if Copy(aTitle, 1, 8)= 'Ref High' then exit
7151      else if aTitle = TXT_COMMENTS then exit
7152      else if aTitle = TXT_NONNUMERICS then exit
7153      else if aTitle = '' then exit;
7154      Result := true;
7155    end;
7156  
7157  var
7158    ClickedValue, j: Integer;
7159    textvalue: string;
7160    Rct: TRect;
7161  begin
7162    with FActiveGraph do
7163    begin
7164      ClickedValue := -1;
7165      for j := 0 to SeriesCount - 1 do
7166      with (Series[j] as TChartSeries) do
7167      begin
7168        if FHintStop then break;
7169        ClickedValue := Clicked(FX, FY);
7170        if ClickedValue = -1 then ClickedValue := Marks.Clicked(FX, FY);
7171        if ClickedValue > -1 then break;
7172      end;
7173      if FHintStop then          // stop when clicked
7174      begin
7175        timHintPause.Enabled := false;
7176        InactivateHint;
7177        FHintStop := false;
7178        exit;
7179      end;
7180      if (ClickedValue > -1) and ((FOnValue <> ClickedValue) or (FOnSeries <> j)) then
7181      begin     // on a value but not the same value or series
7182        if FHintWinActive then
7183          InactivateHint;
7184        if not TitleOK(Series[j].Title) then
7185          exit;
7186        FOnSeries := j;
7187        FOnValue := ClickedValue;
7188        textvalue := ValueText(FActiveGraph, Series[j], ClickedValue);
7189        FormatHint(textvalue);
7190        Rct := FHintWin.CalcHintRect(Screen.Width, textvalue, nil);
7191        OffsetRect(Rct, FX, FY + 20);
7192        Rct.Right := Rct.Right + 3;
7193        Rct.TopLeft := ClientToScreen(Rct.TopLeft);
7194        Rct.BottomRight := ClientToScreen(Rct.BottomRight);
7195        FHintWin.ActivateHint(Rct, textvalue);
7196        FHintWinActive := true;
7197      end
7198      else if (ClickedValue = -1) and ((FOnValue <> BIG_NUMBER) and (FOnSeries <> BIG_NUMBER)) then
7199      begin  // not on a value anymore (used to be on a value and series)
7200        FOnSeries := BIG_NUMBER;
7201        FOnValue := BIG_NUMBER;
7202        timHintPause.Enabled := false;
7203        InactivateHint;
7204      end;
7205    end;
7206  end;