05-07-2024 08:51 AM
I edit a custom button , set boolean text size in customized mode, and now it can't adjust width automatically.
I compare it with the original button in labview, the properties size to text are different.
The help document says "You can write this property only for free labels, control labels, and captions."
what I mean can I set the property in edit mode.
Solved! Go to Solution.
05-07-2024 08:57 AM
Input more strings in custom control shows only the fixed width content, the original button can adjust width automatic.
05-07-2024 10:14 AM
Pictures are useless to debug.
Can you attach your control? Is it a control, typedef, or strict typedef? From what palette was the original?
What are you trying to achieve with all this? What "width" are you trying to adjust?
05-07-2024 11:48 AM
@MR_SUN wrote:
I edit a custom button , set boolean text size in customized mode, and now it can't adjust width automatically.
I compare it with the original button in labview, the properties size to text are different.
The help document says "You can write this property only for free labels, control labels, and captions."
what I mean can I set the property in edit mode.
It is more or less clear how did you get it — just occasionally resized Boolen Text it a little bit. This is enough to lost "default" "Size to Text" property.
But it is not clear how to revert it back (without recreation control from the scratch), because you can't set this property manually nor programmatically. Also reverting to the original size will not help.Theoretically should be possible to disassemble *.ctl to the separate parts, "tamper" this property and "assemble" it back, but there is no any documentation exists.
05-07-2024 12:20 PM
Try this:
05-07-2024 07:56 PM
Thanks for all your reply, and
is exactily what I mean.
I have already created a serial of controls and rebuild consume much more time. here is one of them
05-07-2024 07:58 PM
one of ctls.
05-07-2024 11:11 PM
@paul_a_cardinale wrote:
Try this:
Unfortunately this will help only partially, because "Size to Text" will remain inactive, in aditional, this will cause overlap with icon if Boolean Text should be not centered absolutely:
05-08-2024 06:29 AM - edited 05-08-2024 06:30 AM
Finally got this.
That was easy and complicated at the same time. Below is a long comment.
Let's say - initially we have two Boolean Buttons, they are "copy-pasted":
So far, so good. I will save this VI as "2 Buttons - Original+Copy.vi". As you can see above, for both Buttons we have 'Size for Text' == True, as expected (and they work as expected).Now, I will save this as "2 Buttons - Original+Modified.vi", then navigate to the second Button and customize the Boolean Text - just resize it a little bit using the Control Parts Window (you can use the mouse, it's the same). Now, see the difference:
As you can see above, the "Size to Text" Property has gone away (and there's no known way to turn it back).And the major problem is that any attempt to enter text larger than the original will look like this:
I'll save this VI now in this state.What's the difference between these two controls? To check this, I will open the Heap Peek Window (you have to put "LVdebugKeys=True" key into the LabVIEW.ini file, then restart LabVIEW and open it by hitting Ctrl+Shift+D+H). This is the original Control, note the Flags:
and this is modified control:
So, the difference between both controls in flags:
Original: 0x60966 (0110 0000 1001 0110 0110)
Modified: 0x00966 (0000 0000 1001 0110 0110)
So, two bits are lost. One is responsible for "Size for Text", and another one is unknown (may be "Centered"), but this is not very important for the moment — the 'good' value is known as 0x60966. Now, we should revert this back. I will copy the modified VI with two buttons as "2 Buttons - Original+Repair.vi" and open it via the VI Server. The good point is that we can also read the flags which we have seen in the Heap Peek Window with some private Property Nodes ("stolen" from LAVA Forum). I guess you have to enable scripting in the VI Server and put "SuperSecretPrivateSpecialStuff=True" into the LabVIEW.ini. This is what I have (closing opened references and other not-important things are omitted):
Now the flags are in our hands, the rest is trivial, because Flags can be written programmatically as well:
Now "Size to Text" is restored, and acts as original:
Slightly "rusty nails stuff", use it at your own risk. Obviously, you can easily damage your controls by setting the wrong values.
Experiment in the attachment, downgraded to LV2018.
05-08-2024 07:40 AM - edited 05-08-2024 08:25 AM
@Andrey_Dmitriev wrote:
Finally got this.
This is very risky. The bit meanings of Basic Object Flags can, and sometimes do, change between versions of LabVIEW.
For instance, on LV 2021 BOF returns 60000 hex regardless of whether STT is True or False.