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++ Widgets - General questions or Mixed problems » Problem with TopWindow and Widgets using Layout editor
Re: Problem with TopWindow and Widgets using Layout editor [message #23740 is a reply to message #23738] Wed, 18 November 2009 17:01 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Well, there are more problems than that.

- Callback assigment must be in a function
- Callback assigment should use the <<= operator
- Use RejectBreak so that the window is restored to it's previous state.

// gameSettings
struct gameSettings : WithSettingsWindow<TopWindow>
{
	typedef gameSettings CLASSNAME;
	
	void Exit() {
		if (PromptOKCancel("Cancel changes to settings?"))
			{ RejectBreak(IDCANCEL); }		
	}
	
	gameSettings()
	{
		CtrlLayout(*this, "Game Settings");
		
		CANCELBUTTON <<= THISBACK(Exit);
	}
};
And while naming conventions are generally a matter of style I would strongly advise against using all uppercase for variable names. It will conflict with macros and make your code more difficult to read.

Keep at it, and feel free to ask more questions Smile

[Updated on: Wed, 18 November 2009 17:03]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sending an email from Upp application
Next Topic: Calling windows not in main.cpp
Goto Forum:
  


Current Time: Sat May 11 22:07:38 CEST 2024

Total time taken to generate the page: 0.02763 seconds