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 » U++ Library support » U++ Core » How to program real U++ applications
Re: How to program real U++ applications [message #26026 is a reply to message #25966] Fri, 26 March 2010 15:30 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 702
Registered: December 2005
Location: Budapest, Hungary
Contributor
koldo wrote on Mon, 22 March 2010 15:55

Hello all

I would like to ask you how you design professional U++ applications.

Thinking in a GUI application with a main window, how do you connect classes with main class containing main Serialize/Xmlize configuration:

- Main class is a global variable.
- You include in classes constructor as argument a pointer to main class
- You access from a subclass the main class using dynamic_cast<MainClass *>(GetParent()->GetParent()-> ... as many times as necessary.



I usually use the global config scheme as well:

In your dialog cpp:
#define CONFIG_KEY "YourDialogClassName"

INITBLOCK {
	RegisterGlobalConfig(CONFIG_KEY);
}


before showing your dialog:
	LoadFromGlobal(*this, CONFIG_KEY);

After closing it:
	StoreToGlobal(*this, CONFIG_KEY);


And in your main window's Serialize method will be like this:
void MainWindow::Serialize(Stream& s)
{
	int version = 1;
	s / version;

	SerializePlacement(s);
	some_member.Serialize(s);
	SerializeGlobalConfigs(s);
	
	if(version<2) return;
	//this is used in newer versions
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Xmlize hates spaces
Next Topic: Strange issue with VectorMap<String, String>
Goto Forum:
  


Current Time: Wed May 14 22:21:09 CEST 2025

Total time taken to generate the page: 0.02603 seconds