EBSILON®Professional Online Dokumentation
In diesem Thema
    Tooltippfunktion
    In diesem Thema

    Tooltippfunktion


    Allgemeines

    function onGetTooltiptext(obj:ebsobject; ebs2html:boolean):string;
    

    Es besteht die Möglichkeit, die Tooltipps, die beim Überfahren von Objekten mit der Maus angezeigt werden, gemäß eigenen Wünschen zu gestalten. Dazu muss


    Beispiel

    Beispiel für eine Implementierung von onGetTooltipText:

    unit tooltips;
    
    interface
    
    function onGetTooltiptext(obj:ebsobject; ebs2html:boolean):string;
    
    implementation
    
    uses @units,@variant;
    
    function onGetTooltiptext(obj:ebsobject; ebs2html:boolean):string;
    
    var s:string;
    sEntries:string;
    objtype:string;
    onpipe:ebspipe;
    data:ebsdata;
    var ar:array[1..50] of ebsvar; 
    count1,count2:integer;
    speclist,i,j:integer;
    name:string;
    u:UNIT_Enum;
    v:variant;
    validEntry:Boolean;
    begin
    
    s := "<center class='tooltip-header'>";
    s := s + obj.name;
    if isKindOf( obj, "ebscomp" ) then
    begin
    objtype := getRuntimeClass( obj );
    s := s + "<br>" + objtype;
    if objtype ="ebscomp33" or objtype ="ebscomp45" or objtype ="ebscomp46" then
    begin
    onpipe := getPipeAtLink( ebscomp(obj), 1 );
    if not isnull( onpipe ) then
    begin
    s := s + "<br>on " + onpipe.name;
    
    end;
    
    end;
    
    end;
    
    s := s + "</center>";
    data := ebsdata(obj);
    if not isnull( data ) then
    begin
    count1:=getspecs(data,ar,0,false);
    count2:=getspecs(data,ar,0,true);
    if count1 > 0 or count2 > 0 then
    begin
    validEntry := false;
    sEntries := sEntries + "<br><hr class='tooltip-rule'><table cellpadding=2 cellspacing=0 border=0 bgeffect=hgradient bgcolor=white bgmidcolor=#F0F7FF bgendcolor=#C0C0D0>";
    for speclist:=1 to 2 do
    begin
    count1:=getspecs(data,ar,50,speclist = 2);
    i := min(count1,50);
    for j:=1 to i do
    begin
    if not isempty(ar[j]) then
    begin
    u := unitsGetVisibleUnit( ar[j], false );
    
    if UnitsErrorOK = unitsGetValueWithUnit( ar[j], v, u, false ) then
    begin
    validEntry := true;
    sEntries := sEntries + "<tr border=0><td><span class='tooltip-col1'>";
    if getName( ar[j], name ) then
    begin
    name := stringreverse( name );
    name := stringSpanExcluding( name, "." );

    name := stringreverse( name );
    sEntries := sEntries + name;
    end;
    
    sEntries := sEntries + "</span></td><td bgeffect=solid><span class='tooltip-col2'>";
    
    sEntries := sEntries + varToStr(v);
    
    sEntries := sEntries + "</span></td><td bgeffect=solid><span class=\'tooltip-col3'>";
    
    sEntries := sEntries + unitsGetTextFromUnit( u );
    
    sEntries := sEntries + "</span></td></tr>";
    
    end;
    
    end;
    
    end;
    
    end;
    
    sEntries := sEntries + "</table>";
    
    end;
    
    end;
    
    if validEntry then
    
    s := s + sEntries;
    
    onGetTooltiptext := s;
    
    end;
    
    end;