LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A Class's Private Data and A Tab Control

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?

0 Kudos
Message 1 of 24
(3,680 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 24
(3,677 Views)

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

 

 

 

0 Kudos
Message 3 of 24
(3,672 Views)

@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.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 24
(3,668 Views)

@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.

 

0 Kudos
Message 5 of 24
(3,664 Views)

@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.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 24
(3,651 Views)

@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

 

Message 7 of 24
(3,642 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 24
(3,638 Views)

@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.


___________________
Try to take over the world!
0 Kudos
Message 9 of 24
(3,603 Views)

@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.

 


___________________
Try to take over the world!
0 Kudos
Message 10 of 24
(3,601 Views)