Discussions related to Visual Prolog
marco62118
Posts: 9
Joined: 16 Feb 2011 19:21

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

Unread post 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
Novice, very novice in Visual Prolog and even poorer in English
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post 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.
Regards Thomas Linder Puls
PDC
marco62118
Posts: 9
Joined: 16 Feb 2011 19:21

Unread post 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
Novice, very novice in Visual Prolog and even poorer in English
Post Reply