Well, it doesn't look like I can attach an event to multiple functions and this is what I would need to do. The first function that gets attached is the one that gets called, and the other(s) is ignored.
For instance, if I have a context menu for a control inside my main frame and I click an item in that menu, I may want 1) the value of a combo box inside my splitter window to change and 2) the value of another combo box in my main frame's toolbar to change as well. Now the toolbar would be part of the main frame's class, and the splitter window would be inside of the splitter window's class. So I'd need to 1) associate the context menu click event with a function call inside the splitter window's class which alters the combo box's value and 2) also associate the event with a function call inside the main frame which alters the toolbar combo box's value.
Now of course I could have a function inside the main frame (pseudo code again):
Code: Select all
void MyFrame::setComboValues(...)
{
this->_splitterWindow->setComboValue(value);
this->_myCombo->setValue(value);
}
But then I'd have to write wrapper functions for setting the value of each and every control (e.g. setComboValue()) - and that's annoying. There has to be a better way. I could make the classes friend classes, but that seems bad.
Does anyone know of a way to connect an event with multiple function calls? Or does any have any
other solutions besides using the Connect() method, wrapper functions, or friend classes?