LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

toolbar icon dimmed

Hello,
I need to set the status of a toolbar icon to dimmed or undimmed programmatically.
Until I used LabWindows/CVI up to 7.x everything worked fine and I did this simply using the function Toolbar_DimItem().
Now with version 8.0 this function causes all the nearby icons to become "gray".
I have noticed that function Toolbar_SetAttribute() does not have the "dimmed" attribute in the list.
Can you help me solving this problem ?
Thanks in advance,
Marco



0 Kudos
Message 1 of 5
(3,951 Views)

Marco,

I made a quick change to the toolbar shipping example (found in sampes/userint/custctrl/toolbar) to dim every other control and didn't see any apparent problems. You should be able to dim the items by calling either Toolbar_DimItem or using Toolbar_SetItemAttribute with the TOOLBAR_ATTR_DIMMED attribute; the behavior of these should be identical.

If possible, could you post a screenshot of what you are seeing, or post a small code snippet that reproduces the issue on your system? Or post some more details about what you are seeing specifically? Which types of control do you have on your toolbar, which types are you dimming and how is this affecting the surrounding controls, etc.

Thanks,

-alex

0 Kudos
Message 2 of 5
(3,943 Views)
Hello,
many thanks for your help !
I have figured out that I should have some conflict between the "old" 7.x toolbar driver and the novel one. This is suggested by the following fact: several link errors appear when I compile my program if I have compiled before the NI toolbar sample. Then if I just close CVI and re-open it, the compilation of my program does not show any link error further.
However, for a sake of completeness, I enclose two jpg images showing what I see normally and when I select one of the toolbar icons, whose code causes the other to become dimmed. Please notice that those icons which remain unchanged are not affected by the code.
Now my question can be turned to the following: how can I tell CVI 8.0 to use the novel toolbar driver forgetting the old one, which I believe still is in my PC, being also present CVI/7.1.1 ?
Thanks again,
Marco

0 Kudos
Message 3 of 5
(3,935 Views)
I try again attaching the screenshots 🙂
Sorry !

Download All
0 Kudos
Message 4 of 5
(3,933 Views)
Marco,
 
I believe what you're seeing is the result of a bug that was introduced in 8.0 that had to do with:
 
1. images
2. on buttons
3. that have a transparency mask
4. that are stretched when they are drawn
5. and the button is dimmed
 
In the case that all those 5 things are true, the image will fail to draw.
 
You can work around this by setting the toolbar image size to match the size of your images (so they don't have to be stretched down). You can do this by calling Toolbar_SetAttribute with the TOOLBAR_ATTR_BUTTON_IMAGE_SIZE attribute.
 
As far making CVI 'use' the new toolbar, it should do this automatically. You should be able to resolve any compile errors by simple marking your project for recompilation and rebuilding everything (although I'm surprised this would be necessary). It's true that if you didn't uninstall CVI 7.1, both toolbar instruments are present but projects that you compile in CVI 8.0 will update themselves to point to the 8.0 instrument. Similarly, if you reopen one of these projects in CVI 7.1, it will use the 7.1 instrument. If for some reason you wanted to not do this, you can force files included in your project to use an absolute path (and not adjust if they are under the CVI directory, etc.) by going to Edit->Project, selecting the .fp and checking "Use Absolute Path for File".
 
Hope this helps,
 
-alex

Message Edited by Alex D on 04-12-2006 11:13 AM

0 Kudos
Message 5 of 5
(3,887 Views)