1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

problem with tool tip

Discussion in 'MFC' started by answerme, Jul 4, 2009.

  1. answerme

    answerme New Member

    Joined:
    Dec 17, 2007
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    0
    I am facing problem with my the tool tip
    I have 2 bit map images & i want to display to display there respective values when iam putting cursor on those bitmap images. But whenever my cursor point to both bitmap images ,It is showing the same values.

    Code:
    void CScenGenView::OnMouseMove(UINT nFlags, CPoint point)
    {
    CString le le1;
    if(texture_land[0]==2)
    	{
    		if(((point.x >=tcx-5)&&(point.x <=tcx+5))&&((point.y >= tcy-5)&&(point.y <= tcy+5)))
    		{
    			//m_objToolTipCtrl.UpdateTipText(le,this);
    			le.Format("DADC\nName:%s\nLatitude:%lf\nLongitude:%lf %d ",objFlightParam.m_strEntId,fLat,fLong,stTgtPos.entityType,ENT_LAND);
    			m_objToolTipCtrl.SetMaxTipWidth(100);
    			m_objToolTipCtrl.SetDelayTime(10000,10000);
    			/*m_objToolTipCtrl.AddTool(this,le,2,IDB_BITMAP5);*/
    			m_objToolTipCtrl.SetTipBkColor(105);
    			m_objToolTipCtrl.SetTipTextColor(RGB(12,45,56));  
    			m_objToolTipCtrl.AddTool(this,le);
    			Invalidate(TRUE);
    			UpdateWindow();
    		}
    	}
    
    	if(texture_land[1]==3)
    	{ 
    
    		if(((point.x >=tcx-5)&&(point.x <=tcx+5))&&((point.y >= tcy-5)&&(point.y <= tcy+5)))
    		{
    
    			[B]le1.Format("ADOC\nName:%s\nLatitude:%lf\nLongitude:%lf %d ",objFlightParam.m_strEntId,fLat,fLong,stTgtPos.entityType,ENT_LAND);[/B]
    			m_objToolTipCtrl.SetMaxTipWidth(100);
    			m_objToolTipCtrl.SetDelayTime(10000,10000);
    			m_objToolTipCtrl.SetTipBkColor(225);
    			m_objToolTipCtrl.SetTipTextColor(RGB(120,45,56));  
    			m_objToolTipCtrl.AddTool(this,le1);
    			/*m_objToolTipCtrl.AddTool(IDB_BITMAP4,le);*/
    			//m_objToolTipCtrl.UpdateTipText(le,this);
    			/*m_objToolTipCtrl.AddTool(this,le,3,IDB_BITMAP4);*/
    			Invalidate(TRUE);
    			UpdateWindow();
    		}
    	}
    }
    I am Able to see only le1.format output (marked with bold) in both the images
    Any solution ?
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    I hate tooltips. If I want to know what something is I RTFM. Tooltips usually appear in front of something you're trying to look at, obscuring your vision by displaying something you already know.

    Then they have a timeout that's too short so on the one occasion in 2000000000000000000000000000000 that you do actually want to read what it says, it disappears before you get the chance.
     

Share This Page