LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Easter eggs in Labwindows/CVI

SHIFT and CTRL are indeed defined as "key modifiers", but have two distinct values whose bits do not overlap. this means that you can use a bitwise AND to combine the two.

writing the resulting expression is left as an exercise for the reader...

0 Kudos
Message 11 of 14
(1,210 Views)

Actually the combined modifier for SHIFT+CTRL is the bitwise OR of the individual modifiers (not AND).

It is already defined in <userint.h> as VAL_SHIFT_AND_MENUKEY.

 

If you bitwise AND you end up with 0 (zero), because their bits really do not overlap.

 

Checking which one (AND or OR) gives the correct answer is left as an exercise for the reader 😉

S. Eren BALCI
IMESTEK
0 Kudos
Message 12 of 14
(1,194 Views)

hum... well... i did this mistake on purpose, to see who is really following this course on boolean algebra. bonus point for those of you who noticed this error.

 

(in other words: ooops, sorry, i screwed up !)

0 Kudos
Message 13 of 14
(1,186 Views)

Here's how I did an easter egg.  I put an icon onto the splash panel as a picture control and wired it up with this control callback.  A right double click on the icon makes the easter egg text (inserted onto the panel with the uir editor, but made initially invisible) visible.

 

 

 

INT CVICALLBACK IconCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) {
      
    switch (event)    {
   
        case EVENT_RIGHT_DOUBLE_CLICK :

            SetCtrlAttribute (panel, HELPABOUT_EASTEREGG, ATTR_VISIBLE, TRUE);
       
        break;
    }
   
    return 0;
   
}     // end, IconCallback

0 Kudos
Message 14 of 14
(1,165 Views)