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 » How does TheIDE instant update Settings dialog work?
How does TheIDE instant update Settings dialog work? [message #46052] Wed, 24 February 2016 09:57 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
So I noticed that when using the Setting dialog in TheIDE, changes instantly reflect in the current editor, without having to click Apply or anything.

So I thought that is a great idea and tried to implement that to my dialogs.

I looked over the code in TheIDE and the dialog is opened by Ide::SetupFormat(). Bu this does nothing special. It has a loop like this:

for(;;) {
		int c = dlg.Run();
		
		UpdateFormat(); 
		
		if(c == IDEXIT)
			break;
	}


The thing I'm not figuring out how this updates the editor asynchronously. I tried similar code with my dialog and the updates happen only when closing the dialog...
Re: How does TheIDE instant update Settings dialog work? [message #46053 is a reply to message #46052] Wed, 24 February 2016 10:18 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
OK, it is done with dialog breakers and CtrlRetriever:
edt.tabsize <<= rtvr <<=
		hlt.hlstyle.WhenCtrlsAction = ed.WhenAction = tf.WhenAction =
		con.WhenAction = f1.WhenAction = f2.WhenAction = dlg.Breaker(222); 


Since we were recently on the topic of how to make U++ more popular, code like that might as well be voodoo for the casual GUI enthusiast.

It may be short but it is hard to understand and probably most people will skip trying to. Also when dealing with callback, the difference between <<, <<= and = is a bit too much.
Previous Topic: How to view that U++ generated from *.lay and *.sch files
Next Topic: DrawText and carriage return
Goto Forum:
  


Current Time: Fri Mar 29 01:24:26 CET 2024

Total time taken to generate the page: 0.01450 seconds