Jump to content

[CR] Type Sensitive Popup


Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=31

Name: Type Sensitive Popup

Submitter: LAVA 1.0 Content

Submitted: 02 Jul 2009

File Updated: 04 Jul 2009

Category: User Interface

LabVIEW Version: 8.2

Version: 1.0.1

License Type: BSD (Most common)

Potentially make this available on the VI Package Network?: Undecided

Copyright © 2007, David Saunders

All rights reserved.

Author:

David Saunders

--see readme file for contact information.

Description:

Provides an intuitive interface for tabular controls containing multiple data types. Users can use various controls and datatypes. Users can also use provided functions for registering and looking up type parameters by control (as well as by column, row, or cell).

When you click on a cell, a correctly positioned and sized popup appears allowing for a controlled and intuitive input. Appears like it is a built-in feature, not an annoying popup window.

Features:

- Supports tables, listboxes, multicolumn listboxes, trees, and string controls.

- Implements many data types : string, integer, float, color, ring, boolean, captioned string, etc.

- Can use multiple tabular controls in same program with no programming changes

- Can pre-register controls with certain data types

- Register the entire control, or columns, rows, and cells.

- Can edit the registered data type by registering again at any time

- Allows for different font sizes

- Works even on modal windows

Instructions:

Run the Demo program to see example usage.

To recreate --

1. Drop 'TSPopup.Popup Cluster.ctl' anywhere on your front panel.

2. Create program logic, similar to the demo

MANDATORY elements

a. TSPopup.Initialize.vi (register for the user event in your event structure)

b. TSPopup.Lookup.vi (returns positioning information, looks up any registered controls)

c. TSPopup.Show Popup.vi (called in a Mouse Down? event case)

d. an event case for the user event output from (a.)

e. TSPopup.Close.vi (called at end of program)

OPTIONAL elements

f. TSPopup.Register.vi (register controls with popup type parameters)

g. TSPopup.Update Cell String.vi (provided to show how to change the cell string after popup is completed)

3. Bring the Popup Cluster to the front on the front panel. Otherwise the popup will show up behind some of the other controls on your User Interface.

Limitations:

- Can't programmatically bring popup cluster to front. Must do this manually.

Change Log:

1.0.0: Initial release of the code.

1.0.1: Added another demo using dynamically changing data types in a tree

Removed LV version specific event handling (only dealt with LV 7.1)

Fixed bug where headers defaulted to have same type as their column/row

Fixed cluster scanning from text

Fixed ring to default to index 0 if string unrecognized

Changed the background event monitor to always be hidden

Click here to download this file

  • Like 1
Link to comment
  • 2 months later...
  • 3 months later...

Hi David,

I've built an application using the Type Sensitive Popup VIs you've provided.

When I build an exe out of your Demo (and my VIs) they do not seem to work. The pop-up occurs but the VIs do not update the cell and your VIs freeze the program.

Your help would be greatly appreciated.

Please try to build an exe out of your Demo.

Cheers.

Link to comment
  • 9 months later...

One drawback I found in the code: TSPopup.Update Cell String.vi uses Replace Array Subset primitive to update Listboxes, MCListboxes and Tables. That makes impossible to insert new rows into control. Says, if the control doesn't have any data initially, then popups appears and allows to select/type a value, but the control is not updated.

Link to comment
  • 1 year later...

Great API.

Couple comments and suggestions.

I was using a couple of panes in my application and so the locations got a little messed up. I modified it so it could register pane mouse down events instead of vi mouse down and it works pretty good.

Although I don't have a current need I noticed that you can't register multiple controls on the same window or in two windows that are up at the same time.

Finally it seems to take a little bit of time to load because it is using vi server. I am using it on some popup windows and when I switch between step interfaces quickly it is a bit noticable (not really bad, but should be almost instant). I tracked it down to the init call where it launches the vi dynamically. Possible update could be to run as a daemon?? It could solve the time to load and the multi-control / window open at the same time.

Link to comment
  • 5 years later...

I know this is an old post, but just in case someone else tries this code...

I just downloaded the code and the TSPopu.FG.Poup.vi was broken, I made a minor modification in the Show case to have the event registration pass through (I don't think the Generate User Event.vi does anything to the reference itself. The code seems to work fine after this change.

modified Show case.jpg

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.