11-09-2014 01:41 AM
tnx a lot Zwired1
yes, actually i want use a button with invisible color on the tank. and then, when I click on the tank, actually I click on the button and invisible tab control will be visible. are you sure, it is possible to invisible color? i checked it but I couldnt find any color by name invisible or colorless. could you? it seems simpler than "mouse down" event .
if it dosnt work, I would research more about "mouse down" event .
Best Regards
11-09-2014 02:01 AM
Reeeeaaallllly don't need the transparent Boolean button on top of the tanks indicator.
You're not saving yourself any time by trying to do things that you don't need and "if that doesn't work" read the help files. We all need to learn that lesson now and then, I suppose.
I reworked the VI to show tabs one or two if you click on tank one or two. I also added tabs three and four and have them show when you move the mouse over tank three and four. Look up "mouse enter" event if you like the way that works.
11-09-2014 02:39 AM - edited 11-09-2014 02:51 AM
thank you Zwired1, yor suggestion is admirable and I will try to learn it more. but there is a problem: showing my water levels change depend on passing my mouse over it or click on the tank, while tank level should be update auto. isnt true?
11-09-2014 03:42 AM
I don't quite understand your question.
As it is now, the tank level is not set by any process. The "mouse down" or "mouse enter" event do nothing to change the tank level -- they only cause the tab indicator to change which tab is displayed.
11-09-2014 04:42 AM - edited 11-09-2014 04:45 AM
I want visible a tab control by click on the object(like tank) and invisible that by click on the object too. I checked mouse events, it seems it not possible by that. and there is some limitaion like associate other object to mouse events . for example, I add control tank level by knob, but any change by knob apply after mouse change(mouse events).you said i can do invisible color of a switch ot button, why you are not compliant with?
11-09-2014 05:03 AM
It is possible with mouse events but it takes just a little more logic. Inside the mouse down event for tank 2, for instance, check to see if the incoming wire (also attached to the tab indicator terminal) is already equal to 1 (the tab associated with tank 2). If it is, set the out going wire to a blank tab, otherwise set it equal to 1.
I'm opposed to creating transparent objects to do something that can already be done easily without them. Add to that the fact that you're talking about many tanks, you'd end up with a lot of extra stuff you don't need. That being said, what you're suggesting will work so go for it if you feel strongly.
11-13-2014 12:46 AM
i couldnt do it. other friends have any more suggestion?
11-13-2014 01:28 AM
I modified what I sent earlier. Now if you click on any of the tank controls, it's associated page in the tab indicator shows. If you click again, it goes away.
Essentially, the logic is "if the tab indicator is already showing the page associated with the tank that was clicked show a blank page (0), otherwise show the page associated with the tank."
I know I shouldn't add extras beyond the concept inherent in the post, but it just kills me to code four evnts with the same code except for a constant. Instead, I used a trick (a property node and a string operation) to extract the number out of the tank control's label and used that to drive the tab indicator. That way, if you add more tanks you only have to add them to the event already programmed rather than create another event case (assuming you keep the same naming scheme).
I also added a timeout -- after 10 sec the indicator will revert to a blank page.
11-13-2014 05:09 AM
dear Zwired1
I really appriciated for your kindly help. it was really useful but for achieving my goals it's need to be changed a little. so would you mind to explain the program in more detail?
In addition to understand each part role i need to find out the reason and detial of each used block.
Regard.
11-13-2014 11:35 AM
Here are the concepts used in the VI:
while loop
shift register
event structure
use default if unwired
control reference
property node
scan from string
Please search the help files (the above list would make good search terms to start) and post a concise question if you're still fuzzy.