LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Macintosh application menu item


gmiles@inventeering.com wrote:
earlevel,

Thank for the info...


now I have to figure out how to get the mouse wheel info.





You're welcome. Speaking of mouse info in general, I really need to make knobs and sliders from scratch (external)--hate the way LabVIEW handles them. For instance, the angular dragging of the knobs--it may make sense, but it's awkward and impractical in practice. Most knobs in music/recording apps use vertlcal/horizontal movements, for instance, because it's practical. You can almost fake it by pasting a knob into a slider, but the sliders themselves jump to the mouse location instead of allowing a relative drag--another no-no. Ultimately, I think version 2 of my app will ditch LabView altogether, sorry to say. I'm surprised the knob and sliders don't have more flexibility (or alternate versions) after being out all these years. Other people figured these usability issues out 15-20 years ago (gripe gripe).
0 Kudos
Message 21 of 24
(730 Views)
If I understand you right, You can cover the slide path of the slider with a bitmap that should keep it from jumping to the spot if you click on the slide track.... I will check this out and get back to you... you can customize the sliders a lot.  Also in the past I have closed the start and stop points on the knobs scale so say 0 and 100 are almost on top of each other, and I have used the knobs like they are on a test digital test equipment so you can rotate them in multiple turning inc.   This requires tracking direction.
0 Kudos
Message 22 of 24
(722 Views)
Here is code that I am going to put into a Framework so I can use the mouse wheel.   Now I just need to get Reading and Writing TIFF files working.

case kEventClassMouse:
{
    switch ( GetEventKind(inEvent) )
    {
        case kEventMouseWheelMoved:
        {
            OSStatus status;
            UInt32 modifiers;
            EventMouseWheelAxis axis;
            SInt32 delta;
            
            status = GetEventParameter( inEvent, kEventParamKeyModifiers, typeUInt32,
                    NULL, sizeof(modifiers), NULL, &modifiers );
            ASSERT_NO_ERR(status);
                        
            status = GetEventParameter( inEvent, kEventParamMouseWheelAxis,
                    typeMouseWheelAxis, NULL, sizeof(axis), NULL, &axis );
            ASSERT_NO_ERR(status);

            status = GetEventParameter( inEvent, kEventParamMouseWheelDelta,
                    typeLongInteger, NULL, sizeof(delta), NULL, &delta );
            ASSERT_NO_ERR(status);

            if ( axis == kEventMouseWheelAxisY )
            {
                SInt32 deltaPixels = 40 * delta;

                if (modifiers & optionKey)
                    deltaPixels *= 10;

                this->ScrollVertically( -deltaPixels );
                result = noErr;
            }
            break;
        }
    }
    break;
}
0 Kudos
Message 23 of 24
(718 Views)

gmiles@inventeering.com wrote:
If I understand you right, You can cover the slide path of the slider with a bitmap that should keep it from jumping to the spot if you click on the slide track.... I will check this out and get back to you... you can customize the sliders a lot.





You can put something else transparent on top of them, as you suggest, but I'm not sure if there's a good way to track it within LabVIEW. For instance, you could get a mouse down from the "cover" object, and subsequently use mouse move events to track movement, but you only get those while the mouse is within the object's bounds. You could track it while remaining in the mouse down handler, but I think only the Windows version comes with a VI to track the mouse (obviously I could do it via call function). But then I'd need to make sure I can keep the UI working and not stalled in the mouse-tracking loop... need to think about that...
0 Kudos
Message 24 of 24
(692 Views)