LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting text in 'Two Button Dialog Function'

Solved!
Go to solution

With high resolution monitors the text in the panel that the Two Button Dialog Function displays is often small and hard to read (at least for these old eyes).  Is there any way to format this text?

 

Roy

0 Kudos
Message 1 of 11
(5,277 Views)
Solution
Accepted by topic author RoyA

You can make your own.

 

Make a simple subVI with two buttons and a text indicator. Make the windows apperance "dialog" style and add some logic (e.g. an event structure) to return the button that was pressed.

Message 2 of 11
(5,271 Views)

One way you can quickly roll your own is to modify an Express VI:

  1. Place the "Prompt User" Express VI on your block diagram. Configure it to display the second button (and set anything else you may want).
  2. Click OK. 
  3. Right-click on the Express VI and select "Open Front Panel". You'll get a confirmation asking you if you really want to convert it to a regular VI. Click "Convert".
  4. You'll end up with a new VI that you can modify to your needs. Specifically, set the font of the string indicator that displays the message.
You can also search the examples that ship with LabVIEW. There's a couple of dialog (popup) VI examples in there that you can copy and modify.
Message Edited by smercurio_fc on 05-24-2009 07:22 AM
Message 3 of 11
(5,259 Views)

Thanks, all.  I knew I could 'make my own'.  I was wondering if there was any way to format the text in that specific premade vi.

 

Roy

0 Kudos
Message 4 of 11
(5,235 Views)

I'm using a two-button dialog that I'd like to be more dramatic.  Does anyone have a vi sample as a pop-up message that they will share?  I could use a cluster message, but I'd like the pop-up to hold the program like the dialog.

 

Thanks,

 

Dave

0 Kudos
Message 5 of 11
(5,000 Views)

Define "dramatic". Are we talking Meryl Streep narrating the dialog box? Or were you thinking something a little less subtle? Smiley Wink

 

Also, what does "cluster message" mean? And what do you mean by "the pop-up to hold the program like the dialog"?

Message 6 of 11
(4,976 Views)

dj143 wrote:

I'm using a two-button dialog that I'd like to be more dramatic.  Does anyone have a vi sample as a pop-up message that they will share?  I could use a cluster message, but I'd like the pop-up to hold the program like the dialog.


 

 
 As explained higher up long ago, you can make any subVI as a dialog, so you can make it as dramatic as you want with flashing red lights, videos, and even music. 😉
 
With "hold the program" you are probably talking about a "modal" window. It is on top of everything else and the calling program will not continue until it is closed. LabVIEW has a predefined set of windows appearance properties called "dialog". One you have made your subVI, go to "vi properties...windows appearance" and select "dialog".
 
See how far you get. 😉 
 
 
Message 7 of 11
(4,958 Views)

In this case I’d like a red background with bold yellow text as opposed to the grey and black dialog.  (Sorry Meryl…)  I’m probably using the wrong jargon, but a “cluster message” is just a pop-up cluster that is formatted with whatever colors and text along with control buttons, indicators, etc.  Of course the application continues to run when displaying a cluster.  In my current project I need to hold the loop while waiting for the operator to make a decision.  Additionally it’s a critical decision that could foul things if the correct choice is not made.  In other words I want the operator to take an extra moment to think as opposed to mindlessly clicking a ubiquitous grey and black dialog.

I appreciate Altenbach’s response because it tells me what I need to know such as the modal issue.  Also I was not aware of the “dialog” option.  (I learn something new every day.)  I assume this dialog vi does not need to be controlled by VI Server.

I’m very behind in my projects and am grateful for any help that I get.

Dave

0 Kudos
Message 8 of 11
(4,929 Views)

You indicated you want the application to continue running when displaying this popup, but you want to hold the loop. These seem contradictory, unless you have parallel loops in your applicaiton, and you are trying to pause just one loop. Either way, when you call a subVI within a loop LabVIEW will wait until that VI is finished before proceeding to the next iteration. If the subVI is set up to display itself in a modal manner, then that will force the loop to hold until the user dismisses the dialog box. This would not hold a parallel loop. See attached example as a starting point.

 

WARNING: Be careful with VIs that are set up as "dialog"/"modal" via their properties. If you have its front panel open and you run the top-level VI then it will display itself in the front, preventing you from manipulating the main VI. If you've chose to hide the close box (the "X" in the title bar) then you won't be able to close the window, and you'll have to force-close LabVIEW. 

Download All
Message 9 of 11
(4,922 Views)

This is exactly what I was looking for.  When I said “hold the program” I meant “hold the loop.”  I apologize for being sloppy.  The example vi’s sent is like my application where the pop-up resides in while loop that runs the user interface.

Attached is a two-button version.  How is the X button (close window) used without stalling the main vi?  I tried customizing it to no avail.  At worse case I can opt to not show the X button, but I’d prefer to have it like the two-button dialog function.

Dave

Download All
0 Kudos
Message 10 of 11
(4,901 Views)