From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Smartphone Style Sliding Menu in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example illustrates hidden menus that slide out from the edges of the screen.

 

Description

Every major computing platform, whether on a desktop, or a smartphone, now uses some form of sliding menu.  Menus don't just appear, but rather slide from an edge at different rates.  An ideal solution would have all user interface special effects separated from the main application in a modular Sub VI.

 

Requirements

  • LabVIEW 2012 (or compatible).

 

Steps to Implement or Execute Code

  1. Run the program.
  2. Click on the Top Menu (located at the top edge of the panel).
  3. Notice the animated slide out menu.
  4. Click on one of the controls.
  5. Note the event being captured, via the LED indicator.
  6. Click on the Side Menu (located at the left edge of the panel).
  7. Press the Stop button to exit.

Additional Information or References 

Block Diagram

  capture.JPG

The aim of this example was to use the simplest algorithm possible for creating the slide effect, with minimal CPU usage.

Slide002.png

 

The Sub VI requires three inputs: The Close position, the Start position and the Splitter bar reference.  Typically, the Close position is 1, and the Open position is greater than one.

 

 Capture 2.JPG

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

George T.
Senior Applications Engineer
National Instruments UK and Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.