Solved

Button with 2 actions

Posted on 2006-10-30
3
209 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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to convert c++ code to Android App 3 108
Grammars for C C++ and java 1 131
IdTCPClient1->Disconnect(); not working 3 76
C++ question 3 70
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

838 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