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 » 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 #60626 is a reply to message #60623] Wed, 12 June 2024 14:11 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
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.
 
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: Wed May 14 05:15:35 CEST 2025

Total time taken to generate the page: 0.03886 seconds