This implementation subclasses CSelectableDialogObserver, not CObserver, to help provide the dialog switching mechanism. Note that each of the methods in this class first call the method in the parent class, CSelectableDialogObserver. (e.g. BscSlDlgTabDialogObserver::Update calls CSelectableDialogObserver::Update)
In addition, this implementation allows dynamic processing of the dialog's info button.
For the tabs to switch correctly, it is necessary to listen to kSelectedTabChangedMessage and react accordingly. It is illustrated in the Update() method, and it is actually from production code of TabBasicSelectableDialogObserver class, since the header is private, we provide the implementation here for developer who might need it. The previous version of this sample used an icon observer to dynamically process widget's state change, but it is impractical for plug-in that has many widgets to have one observer for each widget, thus we provide this dialog observer.
| void BscSlDlgTabDialogObserver::Update | ( | const ClassID & | theChange, | | | ISubject * | theSubject, | | | const PMIID & | protocol, | | | void * | changedBy | | ) | | |
| virtual |
Called by the host when the observed object changes. In this case: the tab dialog's info button is clicked.
Since this class inherits CSelectableDialogObserver, it only handles the default list box widget, which is not used in the tab style. for tab style, we need to handle the kSelectedTabChangedMessage
- Parameters
| theChange | specifies the class ID of the change to the subject. Frequently this is a command ID. |
| theSubject | points to the ISubject interface for the subject that has changed. |
| protocol | specifies the ID of the changed interface on the subject boss. |
| changedBy | points to additional data about the change. Often this pointer indicates the class ID of the command that has caused the change. |
Reimplemented from CSelectableDialogObserver.