10-18-2012 05:12 PM
Can tab controls go into a classes private data? I am trying to get one to drop into the classes private data cluster and it just won't go in. What is up with that?
Since it is a container is it not really considered to be data?
10-18-2012 06:19 PM - edited 10-18-2012 06:19 PM
The private data of a class is protected and not accessable outside of the class itself. This is a core feature of OO. If you want to access private data of a class you must provide accessor methods to read/set the data.
BTW, this is not something uniqeu to LabVIEW. This is an integral part of OO design.
10-18-2012 06:33 PM
I personally see this as more of a LV thing than an OO thing. Fundamentally the class private data is a cluster and clusters are not allowed to have tab controls. If you would like to change this, see here:
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-clusters-to-have-quot-pages-quot/idi-p/1481862
10-18-2012 06:51 PM
@Darin.K wrote:
I personally see this as more of a LV thing than an OO thing. Fundamentally the class private data is a cluster and clusters are not allowed to have tab controls. If you would like to change this, see here:
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-clusters-to-have-quot-pages-quot/idi-p/1481862
A class's private data is not accessible outside of a class. This is basic OO so it doesn't matter if it is a cluster in LabVIEW or anything else. OO stipulates that private data as well as methods are protected and not accessible outside of the class.
10-18-2012 07:04 PM
@Mark_Yedinak wrote:
A class's private data is not accessible outside of a class. This is basic OO so it doesn't matter if it is a cluster in LabVIEW or anything else. OO stipulates that private data as well as methods are protected and not accessible outside of the class.
Who says anything about accessing the data outside of the class? It sounds like the OP wants his private data cluster to have some organization by placing tabs inside the cluster which would not change the underlying data, just his way of looking at it. As such I am simply stating that the limitation is not OO related, it is LV's implementation of OO (using clusters) combined with the implementation of Tabs which is causing the problem.
10-19-2012 12:38 AM
@Darin.K wrote:
@Mark_Yedinak wrote:
A class's private data is not accessible outside of a class. This is basic OO so it doesn't matter if it is a cluster in LabVIEW or anything else. OO stipulates that private data as well as methods are protected and not accessible outside of the class.
Who says anything about accessing the data outside of the class? It sounds like the OP wants his private data cluster to have some organization by placing tabs inside the cluster which would not change the underlying data, just his way of looking at it. As such I am simply stating that the limitation is not OO related, it is LV's implementation of OO (using clusters) combined with the implementation of Tabs which is causing the problem.
Ah yes, you are right. I misread the post and thought he was asking to display the contents of the private in a tab control.
10-19-2012 05:46 AM
@zenthoef wrote:
Can tab controls go into a classes private data? I am trying to get one to drop into the classes private data cluster and it just won't go in. What is up with that?
Since it is a container is it not really considered to be data?
I'm trying to figure out why anyone would like to have such composite UI element(s) in a cluster?
Usually you would like to access GUI controls and indicators using a reference to the UI element.
In this case perhaps what you are looking for having a ctrl/indicator reference to the tab control in your (GUI) class?
Br,
/Roger
10-19-2012 06:40 AM
While i understand that elements like the tab control are desired to categorize and organize data (from a visual view point), i have to point out that this does not organize data from a data structure point of view.
So, tab control is a pure graphical "goodie". Adding up stuff as private data as such that you NEED goodies like tab control (for making all the stuff manageable) is something, i would want to prevent.
If i came up to have a class with such many elements in private data that i require management like that, i would question the design of the class and/or the whole OOD.
So i suggest you to redesign the class(es) to be more sophisticated using a good inheritance hierarchy.
hope this helps,
Norbert
10-20-2012 11:30 AM
@User002 wrote:
I'm trying to figure out why anyone would like to have such composite UI element(s) in a cluster?
Like Darin (and my idea he linked to) said, this is about making the cluster organized.
10-20-2012 11:33 AM
@Norbert_B wrote:
If i came up to have a class with such many elements in private data that i require management like that, i would question the design of the class and/or the whole OOD.
But what do you do if the class DOES need a lot of specific data which can't be split up? In the idea Darin linked to, I gave the example of the VI server hierarchy. If you take the Control class as an example, it has a couple of dozen properties, and that's just the ones which are visible through VI server. All that data needs to be saved somewhere.