Page 1 of 1

how to find the name of a parent dialog box that contains a control drawing

Posted: 10 Jan 2016 14:59
by marco62118
Hello

I draw control uses to draw playing cards.
These controls appear in multiple dialog boxes or shapes.
When I pass the mouse over the cards, I need to know what it comes dialog that will give a different event on.
How to get the name of this dialog which contien my card?

I tried with

Code: Select all

  onMouseDown(Source, _Point, _ShiftControlAlt, _Button):-             stdio::write("source ",Source,"\n"),         stdio::write("label ",getLabel(),"\n"),         Parent=getContainer(),         stdio::write("container ",Parent,"\n"), ...
but these codes do not refer me the same references for the different calls

thank you for your help

Posted: 11 Jan 2016 10:15
by Thomas Linder Puls
It would be a bad idea to put that code into the control. You should handle the control in the dialog rather than handling the dialog in the control.

Think of a button, the only thing it does when it is pressed is to invoke the clickResponder. The clickResponder is implemented in the dialog, because it is the dialog that knows what the button click should mean.

Posted: 13 Jan 2016 18:09
by marco62118

Code: Select all

clauses %whether it is in a phase input cards         boite()=Saisie:-         Saisie=saisie.
in SupportCartes.pro

Code: Select all

clauses     onMouseDown(_Source, _Point, _ShiftControlAlt, _Button):-              Saisie=annonceJoueur::boite(),        if Saisie=true then % acquisition phase maps, tip shape on the move