- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Having (frequently) read the on-line documentation about DLGSETSUB (which I regularly use with no problems), I note that there is an (optional) fourth argument to it which
supposedly lets one distinguish between multiple-callback functions assigned to a control using it. I am at a loss as to how this can work.
I understand that one can assign more than one call-back to a dialog control.
How can this work? I have not seen an example. Can anyone enlighten me?
TIA
supposedly lets one distinguish between multiple-callback functions assigned to a control using it. I am at a loss as to how this can work.
I understand that one can assign more than one call-back to a dialog control.
How can this work? I have not seen an example. Can anyone enlighten me?
TIA
Lien copié
1 Répondre
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
If you look at "Available Indexes for Each Dialog Control" in the "Using Dialogs" section, the last column identifies the "events" on which a control will do a callback. With the Edit box, for example, there are 4 different events on which the edit control can do a callback. It will only do the callback if you call DLGSETSUB with the appropriate index. Each control has a default index which is the most common event that programmers are interested in. For the Edit box, the default index is DLG_CHANGE. If you call DLGSETSUB on an edit control and leave off the 4th argument, your callback will be invoke after every change made to the Edit box by the user. Suppose that instead, or in addition, you wanted to know when the edit box loses the input focus. You would call:
DlgSetSub(dlg, IDC_EDIT1, MyLoseFocusCallback, DLG_LOSEFOCUS)
See an example in SAMPLESDIALOGTHERMTHERM.F90. For each control, you can have none, 1, all of its callbacks active at the same time. The callbacks can invoke the same routine (where you distinguish by the "callbacktype" argument), or they can call different routines.
I hope this helps,
Leo
If you look at "Available Indexes for Each Dialog Control" in the "Using Dialogs" section, the last column identifies the "events" on which a control will do a callback. With the Edit box, for example, there are 4 different events on which the edit control can do a callback. It will only do the callback if you call DLGSETSUB with the appropriate index. Each control has a default index which is the most common event that programmers are interested in. For the Edit box, the default index is DLG_CHANGE. If you call DLGSETSUB on an edit control and leave off the 4th argument, your callback will be invoke after every change made to the Edit box by the user. Suppose that instead, or in addition, you wanted to know when the edit box loses the input focus. You would call:
DlgSetSub(dlg, IDC_EDIT1, MyLoseFocusCallback, DLG_LOSEFOCUS)
See an example in SAMPLESDIALOGTHERMTHERM.F90. For each control, you can have none, 1, all of its callbacks active at the same time. The callbacks can invoke the same routine (where you distinguish by the "callbacktype" argument), or they can call different routines.
I hope this helps,
Leo

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable