LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pull down menu for color selection

Solved!
Go to solution

Hello all

 

I am looking for help on the forum to a situation i have in my current project.

 

i have a feature where my GUI displays the status of the current step being executed.

 

eg: if the user starts an action: start acquisition, stop acquisition or say, read log file

 

i have a status indicator (string) which says.. 'acquisition complete/ acquisition failed/ acquisition aborted (say by user control)/ data logged to file/ error occurred' and so on as per the situation.

 

now, along with the text, i want to display a color indicator which reprents the status. I can use these colors for my reports as well.

 

i want to provide a pull down menu of select colors ( i have 7 status messages, so 7 colors). the user can configure which status message goes with which color. i am not sure how to provide such a pull down menu.

 

i tried this: i provided an array of colors and then an array of text rings, where the user can select the status message for each color corresponding to the array index. but, i am not happy with this. i want it the other way round.

 

i want to make a type def control of such a selection control so that i can use it in all my sub modules for each indexing and displaying. with the array of colors, i cannot make it a type def and use it everywhere. also, if i want to change the color in future, i do not think this array of colors is an option.

 

request you to give your suggestions. i am still trying out for the solution. i shall post the solution if i find one myself.

 

thank you

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 1 of 3
(2,191 Views)

Why can't you make it a type def and user it "everywhere"? What exactly is stopping you? It seems as if you are trying to make the UI dictate your data layer. You should not do this. Make your datatype logical for your code. The UI can be whatever you want, and it should take care of doing the translation between UI elements and the underlying datatype. I have no idea what the correct datatype is for you since I don't know how you're actually using it in your code. For example, a cluster consisting of an enum (message type) and a color box seems like a start. This would be your typedef. You can then have an array of these to have as many message/color definitions as you need. Or, you could make a cluster containing multiple elements like that. Or, you could have a cluster of these clusters. Or...

Message 2 of 3
(2,174 Views)
Solution
Accepted by topic author Freelance_LV

I found a work around for my problem. it is an extension of what i did earlier (as mentioned in my prev post).

 

i have a type def array of color options the user can choose and then i have a type def combo box control for the status messages.

 

instead of passing the two type def data through my code, i am using the color box array values to set the 'values' of strings in the combo box.

 

so i pass only the combo box array through the sub modules, the string of the combo box is mys tatus message and the value is the color numeric (converted to decimal string).

 

thank you for the response, smercurio_fc

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 3 of 3
(2,171 Views)