LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access Splitter Bar Style Programmatically

Solved!
Go to solution

As we know the Splitter bars are very handy in developing multi-pane UIs.

 

We might use them quite often in our applications.

 

This Splitter bars can be of different Styles each have their own appearance.

 

Multi-pane UIMulti-pane UIWe can select the appropriate Splitter Style according to our requirement at edit time.

 

 

 

Splitter Style SelectionSplitter Style Selection

So I was playing with the VI Scripting to automate the process of creating VIs with multi-pane FP.

 

In the way of doing this, it was straight forward to create a Splitter bar into a VI FP with the required Splitter Style.

 

Creating Splitter Bar using Scripting VIsCreating Splitter Bar using Scripting VIs

 

But once the Splitter is created, there is no Property or Invoke node available (as far as I searched) to actually access its style (including Scripting & Private options).

Splitter Properties & MethodsSplitter Properties & Methods

 

 

 

Is there any other way to access the Splitter Style ?

  • Splitter Style: Read
  • Splitter Style: Write
  • Splitter Style: Set
  • Splitter Style: Get
0 Kudos
Message 1 of 8
(3,365 Views)

@Its_Me_Ashiq(ஆஷிக்) wrote:

Is there any other way to access the Splitter Style ?

  • Splitter Style: Read
  • Splitter Style: Write
  • Splitter Style: Set
  • Splitter Style: Get

Pretty sure the short answer is no.

 

We've been over this not too long ago, although I can't find the thread.

 

You may have to get all info from panes (like objects on it) and splitters, then delete the splitters, create new splitters in correct style, put all objects on the correct pane. I'd opt out. It won't be fun. It might not even be possible...

 

Note that, IIRC, style can't be changed for any control, although I'd assume the "Replace" method works for controls (, but not for splitters 🤤).

0 Kudos
Message 2 of 8
(3,298 Views)

No there isn't. LabVIEW front panel controls and other elements are implemented as classes. (Nowadays likely as C++ classes but in old times it was implemented as a class hierarchy in plain C code). And the styles are implemented as subclasses. Changing the style of an object means that you have to recreate the full object from scratch, there isn't just an attribute that can be changed, and that is represented in the absence of such a property in the class view for these objects.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 8
(3,292 Views)

It is a pity that the Replace method doesn't work for Splitters though.

 

It does work for controls.

 

It does feel like a bug to me, but I'm sure there are arguments against it.

0 Kudos
Message 4 of 8
(3,278 Views)
Solution
Accepted by topic author Its_Me_Ashiq(ஆஷிக்)

Thank you everyone for the responses 👍.

 

I have some good news about this query.

  • Found a way to access the Splitter Style programmatically
  • Implemented it in Pane Relief QD Shortcut

Source code (LabVIEW 2020) for the Splitter Style implemented Pane Relief QD can be found here.

 

To view how it works, view this page.

 

Disclaimer
0 Kudos
Message 5 of 8
(3,233 Views)

It's nasty though. 😊

 

Manipulating the BD heap XML? I would (and did 🙄) use it, but wouldn't want to depend on it in any way.

0 Kudos
Message 6 of 8
(3,206 Views)

We are not touching any of the Block Diagram resources here (so it does not create any dependency to the BD references 🙈).

 

Just manipulating the cosmetics of the required splitter in the FP Heap XML.

(similar to setting 0px size to splitter bar in the QD)

 

It does not modify the Splitter Hierarchy or anything but the cosmetic Style of the Splitter bar.

0 Kudos
Message 7 of 8
(3,199 Views)

OK, FP Heap... just as bad.

0 Kudos
Message 8 of 8
(3,193 Views)