Xemuth Messages: 387 Registered: August 2018 Location: France
Senior Member
Hello Jimlef,
Without thinking about Upp, you could implement in second and third window a reference to the master window (the first one opened), then with this references, you can access to all function of your 3 windows :
class MainWindow : TopWindow {
private:
SecondWin second;
ThirdWin third;
public:
MainWindow() : second(*this), third(*this){}
SecondWin& GetSecond(){return second;}
ThirdWin& GetThird(){return third;}
}
class SecondWin : TopWindow {
private:
MainWindow& mainWindow;
public:
SecondWin(MainWindow& _mainWindow) : mainWindow(_mainWindow) { /*Your code here, can be in .cpp too */ }
SecondUpdate();
}
class ThirdWin : TopWindow {
private:
MainWindow& mainWindow;
public:
ThirdWin(MainWindow& _mainWindow) : mainWindow(_mainWindow) { /*Your code here, can be in .cpp too */ }
DoSomething(){
//Here I call the SecondUpdate() function from SecondWin:
mainWindow.GetSecond().SecondUpdate();
}
}