Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » How to use callbacks with "embedded" controls...
Re: How to use callbacks with "embedded" controls... [message #2636 is a reply to message #2613] |
Wed, 19 April 2006 16:44 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
fudadmin wrote on Wed, 19 April 2006 06:26 | Ok, I think, this should help: [snip]
|
Aris,
I tried the code and it works nicely, but... there is a little drawback.
If you remind I wanted to intercept the clicked embedded OptionImage to get its status and prompt the user with a message (and write in the infoctrl too). Now I can do it because, thanks to you, the focus go on the row in which the button is. This is the code that shows its status:
int VegaTab1::GetAvail()
{ int n = 0;
String s, player, s1;
for(int i=0; i<arr.GetCount(); i++) {
if ( arr.Get(i, "Avail") ) n=n+1;
}
//try this here. Later we'll rearrange...
arr.ChildGotFocus(); //lets move the focus after calculations...
//do you tests below...
n = arr.GetCursor();
s=AsString( arr.Get(n, "Avail") );
PromptOK( s );
return n;
}
Now, when I click the optionimage, the PromptOK( s ) appear TWO times, instead of one, and it is annoying. This is due both do the click and the refocus connected connected to WhenCtrlsAction :
void VegaMain::Init()
{ info1="Ready";
tab1.arr.WhenEnterRow = THISBACK(UpdateInfo);
tab1.arr.WhenCtrlsAction = THISBACK(UpdateInfo);
}
that call GetAvail:
void VegaMain::UpdateInfo()
{ int int_row, nTotal, nAvail;
nTotal = tab1.arr.GetCount();
nAvail = tab1.GetAvail();
info1 = NFormat("Total players: %d - Available: %d", nTotal, nAvail);
}
I've noticed that if you comment
// tab1.arr.WhenCtrlsAction = THISBACK(UpdateInfo);
then the consecutive click on the option image will not produce a PromptOK dialog.
So now I'm a bit confused on the place where I have to put the hands to correct this behaviour.
I hope to have been clear.
Luigi
|
|
|
|
|
How to use callbacks with "embedded" controls...
By: forlano on Sun, 16 April 2006 18:54
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Mon, 17 April 2006 02:54
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Mon, 17 April 2006 09:33
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Mon, 17 April 2006 10:03
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Mon, 17 April 2006 10:19
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Mon, 17 April 2006 11:04
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Mon, 17 April 2006 11:19
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Mon, 17 April 2006 11:55
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Mon, 17 April 2006 12:15
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Wed, 19 April 2006 06:26
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Wed, 19 April 2006 09:16
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Wed, 19 April 2006 16:44
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Wed, 19 April 2006 17:25
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Wed, 19 April 2006 17:35
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Wed, 19 April 2006 21:36
|
|
|
Re: How to use callbacks with "embedded" controls...
By: forlano on Thu, 20 April 2006 00:46
|
|
|
Re: How to use callbacks with "embedded" controls...
By: fudadmin on Thu, 20 April 2006 05:02
|
Goto Forum:
Current Time: Thu May 09 20:52:17 CEST 2024
Total time taken to generate the page: 0.02360 seconds
|