Prod.: Engine, ver.: 6, ID: 60000494, HowTo : How to display tooltips of entities while a command (or action) is active

HowTo : How to display tooltips of entities while a command (or action) is active

Article60000494
TypeHowTo
ProductEngine
Version6
Date Added5/2/2008
Submitted byNathan Stayte
Keywords

Subject

How to display tooltips of entities while a command (or action) is active

Summary

I want to display the entities' tooltips that are under cursor while a command (or action) is active. How can I do this ?

Solution

By default, tooltips cannot be shown during an action or active command like the GetUserPoint.
 
This is also the default behavior of famous CAD applications, and there are two problems that may arise if this is added to the VDF default behavior;
- Hide useful information (endpoints, snappoints etc) beneath the tooltip area,
- Slow down the performance as Osnaps, Intersections etch must be calculated also, aside of the drawing database search for the text that must be drawn inside the tooltip window.
 
For this we cannot add this behavior in our component. If you like you can use the ActiveDocument.ActionLayout.GetEntifromPoint (with the boolean true faster response)  or GetTooltipFigure and get the tooltip text of the figure beneath the cursor and set this to the ToolTipText property of the document. Like :
 
        private void Form1_Load(object sender, EventArgs e)
        {
            vdFramedControl.BaseControl.ActiveDocument.EnableToolTips = true;
            vdFramedControl.BaseControl.MouseMove += new MouseEventHandler(BaseControl_MouseMove);
        }
 
        void BaseControl_MouseMove(object sender, MouseEventArgs e)
        {
            bool allobjectsAresearched = false;
            vdFigure fig = vdFramedControl.BaseControl.ActiveDocument.ActionLayout.GetToolTipFigure(e.Location,vdFramedControl.BaseControl.ActiveDocument.ActiveActionRender.GlobalProperties.PickSize,true,out allobjectsAresearched);
            vdFramedControl.BaseControl.ActiveDocument.ToolTipText = "";
            if(fig == null) return;
            vdFramedControl.BaseControl.ActiveDocument.ToolTipText = fig.ToolTip;
        }