U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » TabCtrl » TabCtrl CancelClose No longer work (as intended) (Some recent changes (could be as old as a few years) has broken its intention)
Re: TabCtrl CancelClose No longer work (as intended) [message #60635 is a reply to message #60626] Sun, 16 June 2024 14:10 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 12 June 2024 14:11
So far this looks to be the right solution.

1. Take the old CancelClose method and assign it to ConfirmClose.
2. Rewrite the logic in the new ConfirmClose so that the return value bool is reversed.
3. Write a new CancelClose, this for one reason only: if you want to perpetuate the behavior of TabBar of not allowing you to close the last tab. This needs a bit further investigation. The new CancelClose is something very simple, like testing how many tabs you have open:

bool EditorManager::OnCancelClose(Value val) {
	int count = tabFiles.GetCount();
	return count <= 1;
}


I also removed the *Some variant of these callbacks, these needs further investigation if they are of use to me.


Uhm, I am not sure I am supposed to taky any cation here... ?

I there is something to fix, can you send a testcase?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TabCtrl.WhenSet is called when app closes
Goto Forum:
  


Current Time: Fri Sep 11 03:15:21 GMT+2 2026

Total time taken to generate the page: 0.00899 seconds