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 feature request + patch
TabCtrl feature request + patch [message #16547] Tue, 24 June 2008 17:36 Go to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
I would like to add a new method to set the active slave control.

The situation is that maintaining data entry dialogs is very uncomfortable currently.

The tabs are identified by indexes and after inserting a new tab, the programmer has to modify all the code setting tabs.

In a data entry app, where every field is checked and focused on unexpected data, it is very easy to get incorrect behaviour after inserting a new tab.

Being able to setting tabs based on slave controls would prevent this problem.

the suggested patch:
Index: TabCtrl.cpp

===================================================================

--- TabCtrl.cpp	(revision 303)

+++ TabCtrl.cpp	(working copy)

@@ -302,6 +302,16 @@

 	ScrollInto(sel);
 }
 
+void TabCtrl::SetActiveSlave(Ctrl& slave)
+{
+	for(int i = 0; i < tab.GetCount(); i++){
+		if(tab[i].slave == &slave){
+			Set(i);
+			return;
+		}
+	}
+}
+
 void TabCtrl::SetData(const Value& data)
 {
 	Set(data);
Index: TabCtrl.h

===================================================================

--- TabCtrl.h	(revision 303)

+++ TabCtrl.h	(working copy)

@@ -117,6 +117,7 @@

 	const Item& GetItem(int i) const             { return tab[i]; }
 
 	void Set(int i);
+	void SetActiveSlave(Ctrl& slave);
 	int  Get() const                             { return sel; }
 
 	void GoNext()                                { Go(1); }

Re: TabCtrl feature request + patch [message #16561 is a reply to message #16547] Thu, 26 June 2008 10:46 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Good idea, patched.

I have only shortened the name to just "Set" (I think this is hard to confuse).

Mirek
Previous Topic: Missing API for what I need to do?
Next Topic: Tabs at bottom of TabCtrl
Goto Forum:
  


Current Time: Thu Mar 28 16:20:15 CET 2024

Total time taken to generate the page: 0.01015 seconds