Jump to content

Color Box Menu Dismissed


Recommended Posts

So lets say I have a Multicolumn Listbox.  In this MCLB one of the cells isn't intended to contain text, but instead to just allow the user to set the background color of the cell.  So the user clicks on the cell, and I will move a frameless color box control to be under the mouse, then I'll invoke a mouse click so the color selection box comes up.  This all works well enough.  It would work better if there were a property node for opening a color box but that's a different post.

 

Now lets say the user doesn't pick a color, and instead when the color selection window comes up, the user clicks on another cell of the table.  This mouse click will not behave like you would expect.  If you click on a control the mouse down event won't be triggered.  I'm guessing this is because the mouse down isn't registered, and instead the dismissal of the color box is seen.  So what I'd like to do is perform another mouse click after the dismiss so it works like it normally would where the first click dismisses the color selection, and the second then clicks on whatever the user intended to.

 

But the problem is how do I detect a dismissal of a color box control?  Enums luckily have a "Operate Menu Dismissed" event that can be generated (with super secret stuff) but the color box doesn't have an equivalent event.  So what's a good way to allow a user to select a color and have more control over this?  Should I just resort to making a separate VI that floats that I can have more control over?  Anyone make an XControl for color selection?

Link to comment

I've done this exact thing, but I used a system call to display the OS color dialog. Pretty sure it handled the case you describe. If this is an option for you I can dig up the utility VI I wrote. It's for Windows, though I can't recall if it used the Win32 or .NET API.

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.