Solved

Button with 2 actions

Posted on 2006-10-30
3
204 Views
Last Modified: 2010-04-01
Hi i use BC++ and i want to use button to handle two actions
like first click do action 1
second click do action 2 and so
0
Comment
Question by:altra22
3 Comments
 
LVL 3

Expert Comment

by:loki982
Comment Utility
an easy way to go about this would be to connect the button to an intermediate slot where you could increment a member variable
from there you could create some logic on that member variable to determine what functions to call from there
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 50 total points
Comment Utility
just use a static int:

static int numClicked = 0;
numClicked++;

switch (numClicked)
{
 case 1:
   //do something
   break;
 case 2:
   //do something else
   break;
 default:
   //more than 2 clicks....
}
0
 
LVL 2

Author Comment

by:altra22
Comment Utility
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now