BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Challenge for the experts !

How would you cut a hole through front panel objects ? Could you build something equivalent to the vi below ?

 

 

And if you know the trick, please don't post it immediately... 😉
Message Edité par chilly charly le 12-28-2008 07:46 AM
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 1 of 23
(13,314 Views)


chilly charly wrote:

Could you build something equivalent to the vi below ?

Yes .


And if you know the trick, please don't post it immediately... 😉


Oh, well. Since you insist.

Here's a hint for those who want to look (select the text to view it): this is just a special case of making something in the FP partially transparent.

Message Edited by tst on 12-28-2008 10:34 AM

___________________
Try to take over the world!
Message 2 of 23
(13,302 Views)

Let's make things slightly more difficult : Dig also a round hole through the front panel objects, as shown on the image below. 

Post your achievements as images, we shall compare the codes later... Pure LabVIEW only of course !

 

Have fun !

 

Message Edité par chilly charly le 12-28-2008 04:11 PM
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 3 of 23
(13,282 Views)
The challenge is missing a few parameters: Is the VI supposed to be operational? Are you still supposed to be able to use the controls? For example, are you supposed to be able to select the max value of the knob to be able to change it? Is the hole supposed to move as you move the window? Your front panel does not appear to have a title bar, so I'm not sure if you're supposed to be able to move the window. Are any temporary redrawing side-effects allowed? If so, to what extent?
Message 4 of 23
(13,280 Views)
smercurio_fc a écrit:
Is the VI supposed to be operational ?   Yes of course ! 
Are you still supposed to be able to use the controls ? For example, are you supposed to be able to select the max value of the knob to be able to change it ? Well, if there is a hole there, there is nothing to be selected ! Otherwise, everything should be functional.
Is the hole supposed to move as you move the window ? The holes belong to the pane. So they move when you move the window or when you scroll the pane.
Your front panel does not appear to have a title bar... 😮 ???
Are any temporary redrawing side-effects allowed ? If so, to what extent ? Redrawing side-effects should be kept minimal, if any 😉

 

Message Edité par chilly charly le 12-28-2008 05:59 PM
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 5 of 23
(13,275 Views)

How about this (8.0)?

 

Of course, people who know what they're doing will be able to play with the VI to find out at least some of the trick, but these people probably have an idea already.


___________________
Try to take over the world!
Message 6 of 23
(13,242 Views)
Well done Tst !
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 7 of 23
(13,238 Views)

chilly charly wrote:
Your front panel does not appear to have a title bar... 😮 ???

Never mind. I thought I was looking at your Windows desktop with the gray pane being the LabVIEW window. I don't normally see such scenic vistas on LabVIEW front panels. Kind of reminds me of an interviewee at my previous job who was so proud of the wood-grain paneling he had for his VI's front panel. Note that I'm not dinging your style! Smiley Very Happy

Message 8 of 23
(13,228 Views)

smercurio_fc a écrit: [...] Kind of reminds me of an interviewee at my previous job who was so proud of the wood-grain paneling he had for his VI's front panel. Note that I'm not dinging your style! 

I have to confess that I'm not using usually such panel backgrounds :D. It was just a convenient way to illustrate the hole idea. 
But may be we should push your idea ahead, and try to dig a hole through the VI pane to see the window board below... 😉 

 

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 9 of 23
(13,221 Views)

chilly charly wrote:  

try to dig a hole through the VI pane to see the window board below...


I don't think you'll be able to do this using pure G, but I do have VIs which call into the Windows API which can do that.


___________________
Try to take over the world!
Message 10 of 23
(12,395 Views)

Since there are few contributions to this thread, I'll give the solution to the original question : the answer is 0x01000037.

This is simply the hex code for the chameleon color (d16777271, although it appears as R0:G0:B0 in the LabVIEW color picker).

It makes a front panel or diagram object adopt the background color (and not the color of the underlying FP object).

I found the idea on the LabVIEW wiki (although there was originaly a confusion with transparency...). The use of the system label was suggested to create labels for the diagram wires as a form of code commenting. Of course you can also use it to dig holes through FP or diagram objects !..

 

 
 The creation of round holes is a bit more complicated... 😉
Message Edité par chilly charly le 01-04-2009 09:46 PM
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 11 of 23
(8,332 Views)

chilly charly wrote:

This is simply the hex code for the chameleon color


Ah, that's good to know. 

 

(Now, how would you punch a hole all the way to the computer desktop? 🐵


chilly charly wrote:
The creation of round holes is a bit more complicated... 😉

We can possibly get some clues by looking at the hierarchy in tst's solution. Can we?

Message 12 of 23
(8,326 Views)

While I did know about the system label color, I have to admit I didn't think about it, maybe because I already had code which needed only a couple of minutes of modification to do your first example. There are also problems with the system label color (e.g. it only works on the background image and it doesn't work inside tab controls).

 

As I mentioned, those who know what they're doing can get some details from my example. Also, I decided to choose a password which would be simple, so the first to figure it out is welcome to post an image of part of the BD.


___________________
Try to take over the world!
Message 13 of 23
(8,315 Views)

altenbach wrote:

 

(Now, how would you punch a hole all the way to the computer desktop? 🐵


Like this,

 

 

 

but it doesn't satisfy CC's requirement, as it uses the Windows API.


___________________
Try to take over the world!
Message 14 of 23
(8,314 Views)
I downloaded this several years ago and have never been able to play with it.  I checked it out before posting and the USA example only worked if I put the full path to the bmp.  Primetest wrote this code and posted it to a LTR challenge.  It used to be a toolkit they sold until the challenge.  I am assuming it uses several of the WinAPI functions tst is referring to.  Theie examples do not put a hole in the middle of the front panel, but make the panel non-rectangular (very prominent in media players and such).
Message Edited by Matthew Kelton on 01-05-2009 05:34 AM
Message 15 of 23
(8,310 Views)

Matthew Kelton wrote: 
I am assuming it uses several of the WinAPI functions tst is referring to.

I was actually thinking of using these functions, but didn't feel like working out exactly how to create the right shape, so I went down another (actually simpler, and one which I probably should have thought of first) path.


___________________
Try to take over the world!
0 Kudos
Message 16 of 23
(8,290 Views)

Here's tst's BD for the beef of his code.

 

 

Message Edited by Matthew Kelton on 01-05-2009 09:10 AM
Message 17 of 23
(8,275 Views)

Since you've gone and exposed the important bits, you might as well post the password as well.

 

P.S. This was quick code written from scratch, since I didn't have anything which would have done the round hole. That's why it's not documented and not particularly clean. It's quite possible that there are more efficient ways of doing this.


___________________
Try to take over the world!
0 Kudos
Message 18 of 23
(8,262 Views)
Well, you said it was "simple".
Message 19 of 23
(8,255 Views)

For those wondering, the Windows API function used to cut a hole in the window can be seen here. One of its parameters is a color input (I believe in that example that color is a constant) and when you use a color and make the panel opaque, everything of that color in the window becomes completely transparent. You can even click through it to whatever's below the window.

 

You should note that the VI posted there was just a quick example. It needs work and cleaning up.


___________________
Try to take over the world!
Message 20 of 23
(7,585 Views)

tst wrote:

altenbach wrote:

 

(Now, how would you punch a hole all the way to the computer desktop? 🐵


Like this,

 

 

 

but it doesn't satisfy CC's requirement, as it uses the Windows API.


OW OW...who's alice 😉 lol

0 Kudos
Message 21 of 23
(4,883 Views)

Wouldn't you like to know? 😉

 

... 

 

 

...

 

 

Well, if you would, you could just do a Google search. It's the first result. There was a tunnel, so I guess I thought it might be appropriate.


___________________
Try to take over the world!
0 Kudos
Message 22 of 23
(4,854 Views)


tst wrote:

Wouldn't you like to know? 😉

 

... 

 

 

...

 

 

Well, if you would, you could just do a Google search. It's the first result. There was a tunnel, so I guess I thought it might be appropriate.


Aw that wasn't nearly as exciting as i thought it might be 😞

0 Kudos
Message 23 of 23
(4,847 Views)