Having trouble coming up with a do/while loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jvzj017
    New Member
    • Oct 2006
    • 10

    Having trouble coming up with a do/while loop

    void draw_button( const Point & upper_left)
    {

    cwin <<Message(Point (12,20),"Click for new location and enter label");
    string a1="";
    Point topleft = upper_left;
    a1 = cwin.get_string (a1);
    topleft.move(-.5*LETTER_WIDTH ,.1*LETTER_HEIG HT);
    Point topright = topleft;
    topright.move(( a1.length()+1)* LETTER_WIDTH,0) ;
    Point botleft = topleft;
    botleft.move(0, 1.5*LETTER_HEIG HT);
    Point botright = botleft;
    botright.move(( a1.length()+1)* LETTER_WIDTH,0) ;

    cwin << Line(topleft,to pright) << Line(topright,b otright)
    << Line(botright,b otleft) << Line(botleft,to pleft);

    cwin << Message(upper_l eft,a1);

    return;
    }

    // Write the control flow of your program in the main function
    int ccc_win_main()
    {
    cwin.coord(0,0, 100,100);
    draw_button(Poi nt(70,70));
    do
    {




    return 0;
    }
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Which bit of code needs repeating?

    Comment

    • Jvzj017
      New Member
      • Oct 2006
      • 10

      #3
      I want to output the draw button up top. What this code needs to do is execute, run and wait for the user to enter "QUIT". Then after doing so, the program will then terminate. Thats what I need my do/while loop to do

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        well I would guess that you will have to call some cwin member to wait for a mouse button press and then verify that it is in the correct place.

        Comment

        Working...