LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SizeRingCtrlToText not working

Hello all,
I'm trying to use SizeRingCtrlToText on a Recessed Menu Ring Lab Style,
thinking it would save me a lot of font-related headaches. But it doesn't
work. I get error -45 UIEInvalidControlType

The help says "The ring control must be a plain ring control or a recessed
menu ring (styles CTRL_RING or CTRL_RECESSED_MENU_RING)." Is the missing
CTRL_RECESSED_MENU_RING_LS an oversight or a bug ?
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 1 of 8
(3,412 Views)

Yes, it looks like this was an oversight, and therefore a bug. We'll fix it soon (bug id = 343989).

 

In the meanwhile, since you have the source code for this function (.\toolslib\toolbox\toolbox.c), you can make the fix yourself. Simply add CTRL_RECESSED_MENU_RING_LS to the switch statement (you might have to tweak the value of extraRingWidth until it looks right to you).

 

Whenever you do modify toolbox.c, you should regenerate msvc\toolbox.obj and msvc64\toolbox.obj (Options>>Create Object File) and then restart CVI.

 

Luis

Message 2 of 8
(3,406 Views)
Unfortunately it needs to work on Linux too, and recompiling the libs on
Linux is not easy.

Damn, it's friday night and I'm still posting on the group... :-X
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 3 of 8
(3,401 Views)

Did you try simply removing toolbox.o to see if cvicc would automatically recompile toolbox.c? (My guess is that it would, although I don't have a test machine here to test it out)

 

Luis

0 Kudos
Message 4 of 8
(3,387 Views)
> Did you try simply removing toolbox.o to see if cvicc would automatically
> recompile toolbox.c? (My guess is that it would, although I don't have a
> test machine here to test it out)

Nice try but:
$ cvicc MyProject.prj
gcc: /usr/local/natinst/cvi2010/toolslib/toolbox/toolbox.o: No such file or
directory

--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 5 of 8
(3,379 Views)
I remembered message 7 here:
http://forums.ni.com/t5/LabWindows-CVI/tool-tip-memory-leak/m-
p/877950#M40559
But it applied to CVI 8 and I just tried without success (lots of compile
errors). Something must have changed with version 2010.
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 6 of 8
(3,379 Views)

I was able to compile it by also using Michael's gcc command in the post that you linked to. The only difference is that I added the -c flag, so that gcc wouldn't try to link. If you don't use that option you should still not see any compile errors, but you do see a lot of link errors.

 

gcc -c -fPIC -O2 -D_REENTRANT -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I./include -I./toolslib/toolbox-I./toolslib/custctrl/custsupp toolslib/toolbox/toolbox.c -o toolslib/toolbox/toolbox.o

 

Luis

Message 7 of 8
(3,375 Views)
Done, here's the patch in SizeRingCtrlToText():

case CTRL_RING:
case CTRL_RING_LS:
extraRingWidth = 19;
break;
case CTRL_MENU_RING:
case CTRL_RECESSED_MENU_RING:
case CTRL_MENU_RING_LS:
case CTRL_RECESSED_MENU_RING_LS:
extraRingWidth = 21;
break;
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 8 of 8
(3,359 Views)