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 » Strange behaviour of my modal dialog
Re: Strange behaviour of my modal dialog [message #2807 is a reply to message #2804] Tue, 25 April 2006 23:10 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Maybe I did not get it completely, but I guess the mistake you have done is that you think that "<<=" somewhat "binds" the variable with EditField (or other Ctrl).

However, that is not true - it is simple assignment, it sets the value of EditField, but the value of "TD.TOURNAMENT" is further unchanged by the EditField. If you need to have it changed, you have to perform "backward" assignment like

TD.NAMETONEO = ~newt.editTourn;

Of course, doing so for each variable would be boring, so U++ gives you better options.

First of all, you can consider whether you really need to have separate variable for tournament name. Sometimes you can simply use the dialog to store data and do not store to variable at all.
(Data are stored in widgets regardless it is "open").

Another option is to use "CtrlRetriever". This provides a kind of binding you perhaps have expected:

CtrlRetriever r;
r(newt.editTorneo, TD.TORNEO)
(newt.anotherField, TD.ANOTHER)
....
;
newt.Run();
r.Retrieve();

First past, using operator(), simply performs

ctrl <<= val;

and stores references to both to the list. Then Retrieve method goes through those references and performs

val = ~ctrl;

Primitive, but effective Wink

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DropList cores on ClearList()
Next Topic: what is the situation with MDI and Dock widget in U++?
Goto Forum:
  


Current Time: Fri Jun 06 11:01:13 CEST 2025

Total time taken to generate the page: 0.04204 seconds