LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can you enable a scroll bar in a disabled control

I was playing around filtering all key own events on the string control. This prevents typing, but still allows scrolling because mouse-down is still allowed..

 

One interesting observation is that even if I filter out all key down events (event case: key down?, empty case, discard=true), I can still press ctrl+v and paste any amount of text into the text control. I guess copy/paste operation etc. are intercepted by the OS before the event structure can discard them. Strange....

0 Kudos
Message 21 of 33
(1,670 Views)

I've been reading them....

 

The short answer is "no".

0 Kudos
Message 22 of 33
(1,639 Views)

I would say the short answer is "Yes". but it requires a workaround unless altenbach's idea is implemented someday. There are many solutions in this thread.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 23 of 33
(1,628 Views)

@James.M wrote:

... unless altenbach's idea is implemented someday.


.CORRECT WOULD BE: .. unless the idea mentioned by altenbach is implemented someday....

 

(It is not my idea :D)

 

 

The more I think about it, the "disabled" property should have no effect on the scroll bar at all.

If the programmer does not want the control to be scrolled, he can hide the scrollbar.

Scrolling is not a data operation but a cosmetic UI feature.

Maybe only "dsiabled&Grayed" should disable the scrollbar?

0 Kudos
Message 24 of 33
(1,612 Views)

what about my method that I send it in my last post ?!
isnt that fix this problem ?!   I just use a slid as a scroll bar for text control use property node of control string  !
so you can disable control but also could scroll down or up bu slide

0 Kudos
Message 25 of 33
(1,596 Views)

@Hatef wrote:

what about my method that I send it in my last post ?!
isnt that fix this problem ?!   I just use a slid as a scroll bar for text control use property node of control string  !
so you can disable control but also could scroll down or up bu slide


Yes, yours is one of many workaround solutions, it just requires an extra slider that may or may not match the look of the string control.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 26 of 33
(1,591 Views)

@Hatef wrote:

what about my method that I send it in my last post ?!


There are plenty of solutions presented here. Are you expecting a detailed discussion of your VI? Nobody else does. 😄

 

OK, here are some comments to your last attachment:

  • First of all, the stop terminal is still outside the stop event. Why not eliminate the true diagram constant and place the terminal in its place?
  • The "solution" is still cluttered with irrelevant code that has nothing to do with the question, such as updating the scroll position in a second indicator. Nobody asked for that.
  • A "select" function would be cleaner than the inner case structure, because it shows all code at once.
  • It would be simpler to define a value change event on the entire cluster, no need to exclude the string and separately list all other controls in the cluster. A string value change cannot occur because the control is disabled. Now you only have two instead of four event conditions, making the code more readable.
  • If the user toggles the "string control mode" during editing, the control states are initially inconsistent. You need initialization code.
  • Why are your terminal labels so gigantic?
  • Instead of a classic vertical slide, you should use a modern vertical scroll bar control. Nobody expects a slide to act as a scrollbar. The UI needs to be intuitive!
  • The slide range does not adapt to the text lenght. For example if we add a few more paragraphs to the string, we no longer can scroll to the bottom
  • ...
Message 27 of 33
(1,580 Views)

thank you for your points in your comment they are so helpful but 

first why should i do that  or even do not do that it is just to make event and there no important where there is ! is it?
also I try to show it is possible to Simultaneously  change the indicator and control of string
also I do not want to give this vi as software to a customer so I do not think it is so important to wait my time to fix the front panel as like as some especial body like it or not  just try to emphasize on slide bar as important icon by make it gigantic and  also use  classic vertical slide because it is more look like as a scroll bar
also I think we should remained that we are looking to find a clue of answer and other detail could be fix then

for example you can add range to slide bar to  adapt to the text length I think it is easy to do!! Isn’t it?
also if you make text enable this vi still will not run with text control change this was a reason why I do not select whole cluster as event
any way really thank about your some of advice I will be keep it in your mind when I try to make a vi for especial
customer

 

0 Kudos
Message 28 of 33
(1,558 Views)

Thanks to everyone who commented.  It is apparent that there are many work arounds, but no direct solutions.  I was curious to find if there was a property setting that I may have missed.

0 Kudos
Message 29 of 33
(1,547 Views)

Hatef wrote:

first why should i do that  or even do not do that it is just to make event and there no important where there is ! is it?


I assume you are talking about the comment about the stop terminal placement.

 

The stop button is latch action, meaning it gets reset to false once it  is in the non-default state and read by the code. If it is outside the event structure, it gets read by the code before the event occurs and, after the stop event occurs, the VI stops without reading the terminal once more. Newer versions of  LabVIEW also seem to reset once the VI stops, but it is a general rule that latch action booleans should be in their respective event cases or there needs to be code in place that force a new read after certain other things have occurred, for example.

Placing latch action terminals inside their respective event case is an excellent habit and exceptions should be rare and well researched. It is also a good debugging tool, because if the button does not reset during run, it means that the event did not fire, probably because of faulty code.

0 Kudos
Message 30 of 33
(1,540 Views)