CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 1999
    Location
    Jerusalem, Israel
    Posts
    304

    Question Tooltip on a rectangular area

    Hello,

    I'm trying to add a rectangular area as a tool to a tooltip control.
    It's working without a problem...

    When I tried to put a button inside this rectangular area and I hovered the mouse over the button - the tooltip disappear.

    I read the whole documentation about tooltips, and I know I should relay the button messages to the tooltip control, but still it doesn't work.

    How can I make the whole area including the button a tooltip dispatchable?

    Thank you,
    InfraRed.
    Please rate my post, if it helped you.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Tooltip on a rectangular area

    If you are using MFC, create a CToolTipCtrl

  3. #3
    Join Date
    Apr 1999
    Location
    Jerusalem, Israel
    Posts
    304

    Re: Tooltip on a rectangular area

    I'm using win32.
    InfraRed.
    Please rate my post, if it helped you.

  4. #4
    Join Date
    Apr 2009
    Posts
    57

    Re: Tooltip on a rectangular area

    I would make a separate tooltip for the BUTTON, with the same information.

  5. #5
    Join Date
    Apr 2009
    Posts
    4

    Re:Forth Point Rectangle Point from Third point

    POINT fn_drawRectangle(POINT P1,POINT P2,POINT P3);
    double fn_getDistance(POINT P,POINT Q);
    void fn_Reorder(POINT &P1,POINT &P2,POINT &P3);



    POINT CRectanglePointerDlg::fn_drawRectangle(POINT P1,POINT P2,POINT P3)
    {
    fn_Reorder(P1, P2, P3);//reoder
    POINT P4;
    double distanceP1P2X,distanceP1P2Y,distanceP2P3X,distanceP2P3Y;
    distanceP1P2X=abs(P1.x-P2.x);
    distanceP1P2Y=abs(P1.y-P2.y);
    distanceP2P3X=abs(P2.x-P3.x);
    distanceP2P3Y=abs(P2.y-P3.y);
    int intLengthP2P3,intLengthP1P3,intLengthP1P2;
    intLengthP2P3 = fn_getDistance(P2,P3);//find distance b/n 2 point for middle point
    intLengthP1P3= fn_getDistance(P1,P3);
    intLengthP1P2= fn_getDistance(P1,P2);
    if(intLengthP2P3>intLengthP1P3)
    {
    if(intLengthP2P3>intLengthP1P2)
    {
    if(P1.y<P2.y)
    {
    P4.x=abs(distanceP1P2X+P3.x);
    P4.y=abs(distanceP1P2Y+P3.y);
    }
    else
    {
    P4.x=abs(distanceP1P2X+P3.x);
    P4.y=abs(distanceP1P2Y-P3.y);
    }


    }
    else
    {
    if(P3.y>P2.y)
    {

    P4.x=abs(distanceP2P3X-P1.x);
    P4.y=abs(distanceP2P3Y-P1.y);

    }
    else
    {
    P4.x=abs(distanceP2P3X-P1.x);
    P4.y=abs(distanceP2P3Y+P1.y);
    }

    }
    }
    else
    {
    if(intLengthP1P3>intLengthP1P2)
    {
    if(P2.y<P1.y)
    {
    P4.x=abs(distanceP1P2X-P3.x);
    P4.y=abs(distanceP1P2Y+P3.y);
    }
    else
    {
    P4.x=abs(distanceP1P2X-P3.x);
    P4.y=abs(distanceP1P2Y-P3.y);
    }

    }
    else
    {

    if(P3.y>P2.y)
    {
    P4.x=abs(distanceP2P3X-P1.x);
    P4.y=abs(distanceP2P3Y-P1.y);
    }
    else
    {
    P4.x=abs(distanceP2P3X-P1.x);
    P4.y=abs(distanceP2P3Y+P1.y);
    }
    }
    }

    return P4;

    }
    double CRectanglePointerDlg::fn_getDistance(POINT P,POINT Q)
    {
    double dDistance;
    dDistance = sqrt((Q.x - P.x)*(Q.x - P.x)+(Q.y - P.y)*(Q.y - P.y));
    return dDistance;
    }
    void CRectanglePointerDlg::fn_Reorder(POINT &P1,POINT &P2,POINT &P3)
    {
    POINT arrayPoint[4];
    arrayPoint[0]=P1;
    arrayPoint[1]=P2;
    arrayPoint[2]=P3;

    for(int i=0;i<2;i++)
    {
    for(int j=0;j<2;j++)
    {
    //int ii=i+1;
    if(arrayPoint[j].x>arrayPoint[j+1].x)
    {
    int inttempx,inttempy;
    inttempx=arrayPoint[j].x;
    inttempy=arrayPoint[j].y;
    arrayPoint[j].x=arrayPoint[j+1].x;
    arrayPoint[j].y=arrayPoint[j+1].y;
    arrayPoint[j+1].x=inttempx;
    arrayPoint[j+1].y=inttempy;
    }
    }
    }
    P1=arrayPoint[0];
    P2=arrayPoint[1];
    P3=arrayPoint[2];

    }

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Forth Point Rectangle Point from Third point

    Quote Originally Posted by softmuthu84 View Post
    POINT fn_drawRectangle(POINT P1,POINT P2,POINT P3);
    double fn_getDistance(POINT P,POINT Q);
    void fn_Reorder(POINT &P1,POINT &P2,POINT &P3);
    ...
    What does your post "Forth Point Rectangle Point from Third point" with an absolutely unreadable code have to do with the OP's problem "Tooltip on a rectangular area"?
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured