Home » Community » Newbie corner » CanClose? Mechanism to prompt user to save edits
Re: CanClose? Mechanism to prompt user to save edits [message #34801 is a reply to message #34793] |
Tue, 13 December 2011 01:15 |
Lance
Messages: 527 Registered: March 2007
|
Contributor |
|
|
I am sorry. The post was from long ago, I actually changed TabCtrl to TabBarCtrl to allow closing individual TabPages. Your samples are very interesting; the serialization part in particular is something I knew was useful but never have a chance to study.
Anyways, I figured out the thing I was looking for should be CancelClose gate of TabBar (parent of TabBarCtrl), hook up the following code fixed my problem, quite decently IMHO
bool MyMain::TabCancelClose(Value key)
{
return !myTabBarCtrlInstance.FindCtrl(key)->Accept();
}
Each Complex Ctrl that's to be hosted in a Tab page can individually decide its Accept() logic. For example, my example code above will query user to see if he/she wants to save/discard/cancel when there are modifications, and takes action accordingly.
My only remaining question was, for the TabBar libary developers, should the above logic be built in, as it should the very purpose of Accept() in Ctrl's designers intention? Sorry I don't know enough to judge, just raising a question.
TabBar has CancelCloseSome and similar gates, I am not sure if they are of any interests. For my purpose, the above is exactly what I wanted.
Thanks again to Wolfgang and Sender Ghost.
|
|
|
|
|
CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 10 April 2011 04:57
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 10 April 2011 05:26
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 11 December 2011 18:28
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 11 December 2011 18:37
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Wolfgang on Sun, 11 December 2011 18:48
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 11 December 2011 23:57
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Mon, 12 December 2011 16:52
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Tue, 13 December 2011 01:15
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Tue, 13 December 2011 04:29
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: mdelfede on Fri, 16 December 2011 21:09
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sat, 17 December 2011 04:31
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: mdelfede on Sat, 17 December 2011 10:54
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Lance on Sun, 18 December 2011 16:28
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: mdelfede on Sun, 18 December 2011 16:35
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Wolfgang on Mon, 12 December 2011 00:14
|
|
|
Re: CanClose? Mechanism to prompt user to save edits
By: Wolfgang on Mon, 12 December 2011 09:38
|
Goto Forum:
Current Time: Tue May 07 00:04:02 CEST 2024
Total time taken to generate the page: 0.02793 seconds
|