Receive message from component:

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
esbxp
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Jul 29, 2015 8:58 pm

Receive message from component:

Post by esbxp » Wed Jul 29, 2015 9:24 pm

Hi:
I have a component within a Notebook, are separate files, this is the diagram, the example tells GetParent (), but that would give wxPanel, wherein the component is housed, + GetParent (), would give the Tab Notebook, + GetParent () and becomes the Notebook, I am using CodeBlocks. Like I do not get the message. Aliguien has a small example that follow the idea, the diagram below !!!
Image
Regards !!!


Original Languaje:
Hola:
Tengo un componente dentro de una Notebook, son archivos separados, este es el diagrama, el ejemplo dice GetParent(), pero eso daria wxPanel, donde se aloja el componente, + GetParent(), daria el Tab del Notebook, + GetParent(), y viene a ser el Notebook, estoy usando CodeBlocks. Igual no recibo el mensaje. Aliguien tiene un pequeño ejemplo que siga la idea, del diagrama abajo !!!

Saludos !!!

User avatar
doublemax
Moderator
Moderator
Posts: 13909
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Receive message from component:

Post by doublemax » Wed Jul 29, 2015 10:30 pm

wxCommandEvents propagate upwards in the window hierarchy until they are processed. So instead of handling the button clicks in the tab panels, you could handle them in the notebook directly.

If you want to send an event yourself, send a wxCommandEvent to the parent of the button, from there it will travel upwards until it it handled anywhere, e.g. in the notebook.
Use the source, Luke!

esbxp
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Jul 29, 2015 8:58 pm

Re: Receive message from component:

Post by esbxp » Sun Aug 30, 2015 12:55 am

[google Translator]
Hello:
I again, I failed to manage the entire shipment of events, please appreciate him, he could make an example, this would be the situation, are 2 classes, which themselves are panels with buttons, then these two panels are instantiated in the Main Windows, including 2 black boxes "Custom", pressing the button, the message is sent from a black box to the other, as they belong to a different class, I would like to see his example of this situation, the CodeBlocks, because I'm probably doing some things wrong ... in advance thank you very much !!!
Cheers !!!

[original español]
Hola:
Yo de nuevo, no he logrado manejar del todo el envio de eventos, por favor le agradeceria, que pudiera hacer un ejemplo, esta seria la situacion, son 2 clases, que en si son paneles, con botones, luego estos 2 paneles se instancian en el la Windows Principal, como 2 cajas negras, "Custom", al presionar el boton , el mensaje se envia desde una caja negra a la otra, ya que pertenecen a una class diferente, me gustaria ver su ejemplo de esta situacion, en el CodeBlocks, porque seguramente estoy haciendo alguna cosas mal... de antemano muchas gracias !!!
Saludos !!!

Post Reply