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++ Library : Other (not classified elsewhere) » Close() callback not conditioned in a dialog
Close() callback not conditioned in a dialog [message #6347] Tue, 07 November 2006 21:28 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

in some dialog containing for example an edit widget I perform a control to avoid if it is empty. So I force the flag Notnull in the designer for that widget. The dialog has then an OK and Close buttons.
The problem: when the user press Close o whatever button that performs a Close() action the dialog does not close if the user do not enter some weird thing in the edit widget. So the widget has priority on the close callback.
I think that the closure of the dialog connected with the Close() callback should be immediate and irrespective of the condition of the others widgets (not null for example), because these eventual data will lost be in any case. It should be responsability of the programmer eventually confirm the closure of the dialog.
This is particularly annoying if the dialog contains many ctrls with not null flag activated.
Of course this problem can be bypassed removing the Notnull flag and performing a control on each widget but this seems to me not natural if the notnull method exists.

Luigi

[Updated on: Tue, 07 November 2006 21:29]

Report message to a moderator

Re: Close() callback not conditioned in a dialog [message #6365 is a reply to message #6347] Thu, 09 November 2006 20:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Then make your Close button a Rejector (or simply Breaker)!

There are three modal loop breakers:

- Breaker simply exits it
- Acceptor accepts widgets first (accepting makes the check for Null)
- Rejector rejects all widgets (this can be different from simple Break sometimes, e.g. open database data are canceled etc..)

Mirek
Re: Close() callback not conditioned in a dialog [message #6372 is a reply to message #6365] Thu, 09 November 2006 21:48 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Thu, 09 November 2006 20:33

Then make your Close button a Rejector (or simply Breaker)!

There are three modal loop breakers:

- Breaker simply exits it
- Acceptor accepts widgets first (accepting makes the check for Null)
- Rejector rejects all widgets (this can be different from simple Break sometimes, e.g. open database data are canceled etc..)

Mirek



I've used the following code line

    //btnClose.WhenAction = THISBACK(Close); // previous
    btnClose <<= Breaker(999); // new


and it works as I wanted. Now the Breaker is promoted to my default method for Close/Exit button.

Thanks!
Luigi
Previous Topic: examples/SQLApp crashes on double click in SQL console [BUG]
Next Topic: minimalist example with GridCtrl
Goto Forum:
  


Current Time: Mon Apr 29 07:04:42 CEST 2024

Total time taken to generate the page: 0.04381 seconds