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 » Deleting Tabs
Re: Deleting Tabs [message #11110 is a reply to message #6829] Mon, 20 August 2007 13:41 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Added TabCtrl::Remove(int n) method. But didn`t have time for complete testing, for now it seems to work for my application.

bool TabCtrl::Remove(int n)
{
	if (n >= tab.GetCount())
		return false;
	
	if(tab[n].ctrl)
		tab[n].ctrl->Remove();
	if(tab[n].slave)
		tab[n].slave->Remove();
	
	tab.Remove(n);
	if (tab.GetCount())
		Set(sel ? sel-1 : sel);
	else
	{
		x0 = 0;
		CancelMode();
		sel = -1;
		accept_current = false;
		WhenSet();
	}
	SyncTabs();
	Refresh();
	return true;
}


Also, I propose adding WhenSet() call to TabCtrl::Reset() for it just changed selected tab index to -1. It would be more convenient for user to have one uniform handler, than explicit code going right after Reset() in user`s application code.

[Updated on: Mon, 20 August 2007 15:09]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon4.gif
Read Message
Read Message
Previous Topic: How to resize TabCtrl?
Next Topic: [BUG - FIXED] Add() crashes system
Goto Forum:
  


Current Time: Mon May 13 13:13:12 CEST 2024

Total time taken to generate the page: 0.03699 seconds