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 » DOCU: Ctrl design concepts
Re: DOCU: Ctrl design concepts [message #29890 is a reply to message #29795] Sat, 27 November 2010 18:41 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Wed, 17 November 2010 11:27

hi mirek,

could you spot some light on the Accept() / Reject() behaviour?
i dont quite get it yet. reading the documentation does not clear the questions very well.



The primar motivation is that on many dialogs, once you press OK button, some widgets should "finish" processing. E.g. widget contains some database data, which are edited and they need to be written to DB.

Also, during this processing, it can be impossible to continue, because data are somewhat invalid. That is why there is a 'bool' return value - if first Accept returns false, "OK" is canceled (and typically user stays in dialog).

Then, as we already have this return value, Accept is also used to simply check the content of widget. E.g. if there is invalid date in EditDate, Accept shows error message and returns false.

Default implementation simply calls Accept for all children, returns false as soone as first returns false, if all return true, returns true.

Reject is simply Accept counterpart for Cancel button. As the whole dialog is rejected, it does not need to return any value. Reject is much less often implemented.

When speaking of "OK" and "Cancel", I describe the default (and typical) behaviour/usage. Of course, Accept/Reject can be used outside this scope.

Quote:


and one more: which controls so far do use the ValueArray?
i imagine of ArrayCtrl, which probably uses it to insert multiple values as row..


Yes. Anyway, controls do not need to use it explicitly, quite often ValueArray is used in client code as means to 'transport' some data to Convert and/or Display.

Speaking about ArrayCtrl, it actually creates ValueMap (but you can get ValueArray from ValueMap).
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: widget or source code to handle dicom files
Next Topic: NEW: LogPosCtrl, for editing LogPos of a Ctrl
Goto Forum:
  


Current Time: Mon Apr 29 16:38:48 CEST 2024

Total time taken to generate the page: 0.03800 seconds