delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/05/00:48:28

From: "Gautam N. Lad" <gautam AT interlog DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: While button is down...
Date: 4 Jan 1997 22:13:50 GMT
Organization: InterLog Internet Services
Lines: 40
Message-ID: <5amkmu$4rq@news.interlog.com>
NNTP-Posting-Host: ip220-148.cc.interlog.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,
I have created classes for a GUI, that responds to button presses,
and such.  In my program, if I press the button once, a variable gets 
incremented.  

Now, what sort of loop do I use that keeps the variable
incrementing until the button is UP (GR_M_LEFT_UP).  I have the 
following snippet:

        for( ; ; )
        {
            GrMouseGetEventT(GR_M_EVENT,&evt,0L);
            if (evt.flags & GR_M_LEFT_DOWN)
                {
                    if(RGB[0].ClickedD(evt.x,evt.y))
                     {
                     if (R[SelectG]==0) RGBInc=0;
                     else if (R[SelectG]==255) RGBInc=5;
                        GradB[SelectG].DrawP(17+BA[SelectG],22,21,40,R[SelectG]+=RGBInc,G[SelectG],B[SelectG],1);                       
                     }
blah, blah..........

Here, if the LEFT button is down, the RGB[0] object passes the 
cordinates to the ClickedP member, which checks the location of
the click.  If it's within the button's cordinates, it increments 
the RGBInc variable.  This works fine for single clicks, but what
do I do to make it incrementing until the button goes UP?

Thanks!
Bye!
****************************************************
* Gautam N. Lad                                    *
*--------------------------------------------------*
*                                                  *
* E-Mail	: gautam AT interlog DOT com              *
* Website	: http://www.interlog.com/~gautam  *
*                                                  *
* OS/2, DOS/Windows, Graphics Gallery, Software,   *
* Links, Rayzor Editor/2, POV-Ray,  and more.      *
****************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019