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 » [PROPOSAL] Adding GetCtrlGroup() method to TabBarCtrl.
[PROPOSAL] Adding GetCtrlGroup() method to TabBarCtrl. [message #56686] Sat, 03 April 2021 01:10 Go to next message
Oblivion is currently offline  Oblivion
Messages: 1096
Registered: August 2007
Senior Contributor
Hi,

Sometimes it is useful to get or inspect all the ctrls belonging to a specific tab group (e.g. for batch-updates, etc.).
Unfortunately, I couldn't find a method suitable for this task.
And to this end, I propose adding the following method to TabBarCtrl:

Vector<Ctrl*> TabBarCtrl::GetCtrlGroup(const String& group)
{
	auto sCheckMatch = [group](const TabBar::Tab& t) { return t.group == group; };

	Vector<Ctrl*> v;
	for(int i : FindAll(tabs, sCheckMatch)) {
		Ctrl *c = GetCtrl(tabs[i].key);
		if(c) v.Add(c);
	}

	return pick(v);
}


Best regards,
Oblivion


Re: [PROPOSAL] Adding GetCtrlGroup() method to TabBarCtrl. [message #56821 is a reply to message #56686] Sat, 17 April 2021 22:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13995
Registered: November 2005
Ultimate Member
OK, why not. I have changed the code a bit, so please check.
Re: [PROPOSAL] Adding GetCtrlGroup() method to TabBarCtrl. [message #56822 is a reply to message #56821] Sat, 17 April 2021 22:33 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1096
Registered: August 2007
Senior Contributor
Thanks!

It works fine.

Best regards,
Oblivion


Previous Topic: TabCtrl related question
Next Topic: How to dynamically add remove tabs
Goto Forum:
  


Current Time: Sat Jul 20 17:35:17 CEST 2024

Total time taken to generate the page: 0.01431 seconds