Solved

Button with 2 actions

Posted on 2006-10-30
3
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:loki982
ID: 17839154
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
ID: 17847293
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
ID: 17858594
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

729 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