Method pointer Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
User avatar
nelson777
Earned some good credits
Earned some good credits
Posts: 117
Joined: Mon Sep 19, 2005 3:50 pm
Location: Fortaleza - Brasil

Method pointer

Post by nelson777 »

How do I set a method pointer ? I got a wxDialog object created in another central wxDialog. This main dialog is called frmPrincipal and I want to set a method pointer in it from the sub-dialog. Goes like this:

In the main Dialog I have this code:

Code: Select all

    
Animacao   *frmAnimacao; 
void (Animacao::* Temporizador)();
Temporidador is the pointer I want to set. I set the class pointer like this:

Code: Select all

    
frmAnimacao   = new Animacao(this);
Animacao class is extende from wxDialog class.

So in Animacao class, I
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Re: Method pointer

Post by upCASE »

Hi!
nelson777 wrote:with no success. Anybody has an ideia what would be the problem ?
You will have to use a pointer to a method of an instanciated class.
This

Code: Select all

princ->Temporizador = (((void *)Animacao::*Timer)()); 
doesn't point to an "existing" method. Try somthing like

Code: Select all

princ->Temporizador = (this->*Timer); 
or

Code: Select all

princ->Temporizador = (SomeClass->*Timer); 
or

Code: Select all

princ->Temporizador = (&SomeClass::Timer); 
instead.

Here are some nice references that may help
http://oopweb.com/CPP/Documents/Functio ... lback.html
http://www.newty.de/fpt/fpt.html#assign
http://www.codeproject.com/cpp/FastDelegate.asp
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
User avatar
nelson777
Earned some good credits
Earned some good credits
Posts: 117
Joined: Mon Sep 19, 2005 3:50 pm
Location: Fortaleza - Brasil

Post by nelson777 »

Thnx upCase. It
buildere
Super wx Problem Solver
Super wx Problem Solver
Posts: 358
Joined: Thu Oct 28, 2004 3:45 pm
Location: Costa Rica

Post by buildere »

Shouldn't the "Accepted Answer" points be asigned to upCASE in this case? I've seen a lot of "self acceptance" lately in the forums :-k
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

buildere wrote:I've seen a lot of "self acceptance" lately in the forums :-k
They say accepting yourself is the first step on the path to change.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
Shaba1
Earned a small fee
Earned a small fee
Posts: 12
Joined: Wed Jul 13, 2005 1:14 pm

Post by Shaba1 »

How exactly do you "accept" an answer. I asked a question here a few weeks back and got a good answer and a not so good answer. The person that gave me the good answer asked me to "accept" his so he could earn some kind of points. I would not have minded doing it but I could not find any kind of link or area where I could do that.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

Shaba1 wrote:How exactly do you "accept" an answer.
When you read the answers to your question, you should see several words on the upper right of each answer.

The standard ones are "Quote" (which is usually blue) "Edit" "Delete" "IP"

When the post is a question (and created as such) Then there are an additional two options to these words (both blue) "Assist" and "Accept".

Their use is simple, if the answer provided some help but did not completely answer your question, then click on the word "Assisting" (you can do this several times). If the answer solved your question, then you should click on "Accept". You should only click on ONE Accept, but you can click on several Assisting.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
Shaba1
Earned a small fee
Earned a small fee
Posts: 12
Joined: Wed Jul 13, 2005 1:14 pm

Post by Shaba1 »

NinjaNL wrote:
Shaba1 wrote:How exactly do you "accept" an answer.
When you read the answers to your question, you should see several words on the upper right of each answer.

The standard ones are "Quote" (which is usually blue) "Edit" "Delete" "IP"

When the post is a question (and created as such) Then there are an additional two options to these words (both blue) "Assist" and "Accept".

Their use is simple, if the answer provided some help but did not completely answer your question, then click on the word "Assisting" (you can do this several times). If the answer solved your question, then you should click on "Accept". You should only click on ONE Accept, but you can click on several Assisting.
There must be something wrong with my browser. I am using Internet Explorer 6.0.2900.2180. On windows XP Service pack2.

In any case I can see the quote button and the edit button for my own post but I do not see a "Delete", "IP","Assist" or Accept

Is there a special way that I am supposed to post a "Question". YOu did say "and is created as such"
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

Shaba1 wrote:In any case I can see the quote button and the edit button for my own post but I do not see a "Delete", "IP","Assist" or Accept
Since I am a mod on this board, it could be that I can see the Delete and IP and you do not. I am unsure about this.
Shaba1 wrote:Is there a special way that I am supposed to post a "Question". YOu did say "and is created as such"
When you make a new topic, there is a row of radio buttons at the bottom of the form. These should be "Normal", "Question" (which should be selected by default) "Sticky" again a possible mod only item and "Announcement".

Make sure that "Question" is selected when you post.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
Post Reply