Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Friends? Cousins? Half-siblings?
Re: Friends? Cousins? Half-siblings? [message #54987 is a reply to message #54984] Sat, 03 October 2020 20:56 Go to previous messageGo to previous message
Xemuth is currently offline  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();
    }
}


Hope it helped ! Very Happy
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: double click
Next Topic: sqlarray and sqlite
Goto Forum:
  


Current Time: Sun May 05 19:13:27 CEST 2024

Total time taken to generate the page: 0.03074 seconds